A custom DocFX template with a light and dark theme, and a heavy focus on readability
The sample project's build is configured by a dependency on docfx.console, and a reference to the Theme/Clean folder.
To change this to run your own builds, add docfx.console to your solution, and edit the templates section in docfx.json to use the Theme/Clean (you'll need to edit the relative path according to where the Theme/Clean folder is to your docfx.json file)
-
Clone or fork the repository
-
Open
Sample/SampleProject.slnin Visual Studio -
Build the solution
-
A new folder in
SamplecalledSampleProject.Sitewill be generated -
Open that folder with a server that can serve static files (such as http-server), and you will be able to browse generated documentation site
- All dependencies are managed by Node Package Manager, so make sure you have npm installed. If you don't already have npm installed, you can install npm as part of node.js
- Navigate to the template folder (
Theme/Clean) in a terminal- Run
npm installto install all packages- If you want to add, change or remove a dependency, make sure to update
gulpfile.jswith your changes, as this is the file that configures which items go intodocfx.vendor.jsanddocfx.vendor.css- Run
npm run gulpto builddocfx.vendor.jsordocfx.vendor.css- It is recommended that once you're happy with your changes to 3rd party JS/ CSS and have run
npm run gulp, you remove thenode_modulesfolder generated bynpm install. This is not a necessary step, but it will make docfx builds much quicker
-
The main (non-vendor) JS and CSS files for the site are located in
styles, and aredocfx.jsanddocfx.cssaccordingly -
The site builds HTML using the master page (
layout/_master.tmpl), which in turn uses a combination of partial views (in thepartialsfolder)

