This sample demonstrates generating scoped documentation of .NET projects.
-
Build the solution
dotnet build
The above should involve restoring nuget packages, which includes the
docfx
command-line tool. -
Build and serve the documentation for Contracts in the solution (you may need to add the
docfx.console/{version}/tools
directory to your PATH)```sh docfx ./docs/contracts/dtos/docfx.json --serve ```
-
Feel free to modify files within
docs
subdirectories. A brief outline of these files, relative todocs/contracts/dtos
are:docfx.json
: The configuration that thedocfx
tool uses to construct static documentation from .NET source code. See docfx.json Format for moreindex.md
: The main landing page of the scoped documentation. For the purposes of this sample, the 'scope' chosen is theContracts
project of theDotnetGeneratingDocumentation
solutiontoc.yml
: Configuration for the main site navigationoverview/toc.yml
: Configuration for the 'Overview' directory's navigationapi
directory: Contains mostly generated (bydocfx
) files.api/index.md
is the landing page for the 'Api Documentation'images
: Houses any visual resources referenced in documentation that is to be hosted on the site_site
: Once thedocfx
command has been run as described in the previous step, this generated directory serves as the web root for the documentation site
For further details, see Getting Started with DocFX.
- Following documentation here,
you can customise content and appearance of the built documentation site. This sample uses a
minimalism
theme defined withindocs/contracts/dtos/templates
. Based on thedocfx.json
'sbuild.template
property, files are merged between thedefault
theme and the customminimalism
theme, with theminimalism
theme taking precedence.