Building the manual

  1. cargo install --git --branch installable (May require --force if you already have mdbook installed. Requires custom changes to resolve symlinks, hopefully will be merged into upstream soon)
  2. mdbook build in the root source directory
  3. The manual should now be available in the book subdirectory.

Adding to the manual

  1. Add a new Markdown file somewhere in the repository.
  2. Edit manual/ and add a link to the new file. Use a path relative to the repository root.
  3. Add the new Markdown file to the git index (git add ...)
  4. Run scripts/ from the root directory. This will create a symlink for the new file in the manual/ directory. This symlink should be added to git as well.

Generated docs

The manual/ script runs as an mdbook preprocessor and replaces {{#generate GEN ARGS}} anywhere in the book with the output of running generator GEN on ARGS. The set of available generators is defined in

As one example, this is used in manual/c2rust-refactor/ to replace the {{#generate refactor_commands}} placeholder with auto-generated docs for refactoring commands, by running c2rust-refactor/doc/

API documentation for the Lua scripting interface is generated by calling ldoc . in the c2rust-refactor directory. This updates the c2rust-refactor/doc/scripting_api.html file which we keep checked into source control and linked into the manual.