c# DocFx. Direct way to create the web page or pdf of documentation?

1.1k Views Asked by At

I have my visual studio 2022 project with c# and I want to create the documentation but I don't want more files and folders to my project.

  • Docfx create folders and files.
  • SandCastle you even have to create another project inside your solution.

There is a way to run a command and generate the web page without creating any extra file in the project/solution?

Thanks.

1

There are 1 best solutions below

0
groogiam On BEST ANSWER

If you are just wanting to generate documentation from your source code xml comments than DocFx does not require that many new files to be be checked into source control. Sure you will need the basic project structure but all the intermediate / generated files in the output can be excluded from your committed source code using .gitignore files (assuming you are using git).

For example, in these tutorials

You would only really need

  • docfx.json
  • index.md
  • toc.yml
  • api/index.md
  • api.index.yml
  • .gitignore

If you add the following lines to the generated .gitignore from tutorial 1 then all the intermediate and generated documentation yml files will never be committed to git.

api/*.yml
api/.manifest

Hopefully this helps, I know it does not get you 0 extra files like you asked but its a fairly light weight solution to generating api documentation.