This folder contains the documentation site for bUnit.
Here is a small getting started guide for contributing to the documentation...
- The
site
folder contains the code for generating the documentation site, and the documentation in markdown files, located insite/docs
. - The
samples
folder projects for the sample code that is displayed in the documentation. It has the following projects:
samples/components
: A Blazor component library project where components under test are placed.samples/tests/mstest
: An MSTest project where MSTest test samples are placed.samples/tests/nunit
: An NUnit project where NUnit test samples are placed.samples/tests/razor
: An xUnit-based test project where razor test samples are placed.samples/tests/xunit
: An xUnit project where xUnit C#-only test samples are placed.
These sample components, source files, and tests source files are included in the documentation using DocFx's Code Snippet syntax. They are created as real projects, making them runnable, which helps ensure that the code samples shown in the documentation pages are correct and in working order.
The following chapter describes how you can run and view the documentation locally
The following tools are required to build and view the documentation locally:
- The
dotnet serve
tool - The
docfx
dotnet global tool:dotnet tool install -g docfx
. - DocFx.
- Build the
bunit.sln
solution in the root folder in release configurationdotnet build -c Release
. - From
docs/site
rundocfx metadata
to generate the documentation site's metadata. - After that run
docfx build
to generate the documentation site. - From
docs/
runserve-docs.cmd
. This will start up a local web server (usingdotnet serve
), hosting the generated documentation site. - After changing samples from
docs/samples
, rundotnet test
. This will compile the sample components and run the sample tests.
- All pages should have a YAML header with a
UID
to make it easy to cross reference between pages - All page and code references should be created using the
xref:UID
cross reference syntax. - By default, you should include code snippets as sample files in the
samples
projects, using the code snippet syntax. - All code snippets should use 2 spaces as an indention unit (1 tab = 2 spaces).