Skip to content

Repository files navigation

DocGen

The purpose of this tool is to automate api documentation generation from the source code itself. DocGen avoids having to completely compile the source and reading the metadata as it uses an AST parser for each supported language.

Languages currently supported are:

  • C
    • For C - you can pass dependencies to the --dependencies arguments. If you need compilation symbols, you can pass the symbol you need to the --args arguments.
  • C#
    • Simply parses without needing to provide all of the dependencies.

Many tools such as

can already do what DocGen does, but they emit primarily html files or read existing markdown files to generate an entire documentation website.

DocGen generates markdown files after reading the source files. This works for static website generators such as hugo or jekyll. There is no theme provided by docgen. Themes are entirely provided by whatever your static website generator uses.

Dependencies

  • Scriban
  • CppAst.NET
  • Roslyn
  • CommandLine
  • .NET 10

Build Steps

dotnet restore
dotnet build -c Release
dotnet publish -c Release

Usage

Description:
  DocGen - Documentation Generator for Markdown Files

Usage:
  docgen [options]

Options:
  -p, --path <path> (REQUIRED)        Path to the source files. Currently supports *.cs and *.h files.
  -o, --output <output> (REQUIRED)    Where to write the generated markdown files to.
  -l, --lang <lang> (REQUIRED)        What programming language can are we parsing?
  -a, --args <args>                   What additional arguments to provide. For example, for C based 
                                      projects, you may need compilation arguments. Multiple
                                      args can be provided split by whitespaces.
  --d, --dependencies <dependencies>  Provide any dependencies needed for compilation to happen for 
                                      C. CSharp does not require this.
  -?, -h, --help                      Show help and usage information
  --version                           Show version information

Currently only C and C# are supported languages.

docgen -p path_to_src_dir -o path_to_output_dir --lang csharp

About

Minimal documentation generator to markdown

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages