Modo🧯 is a documentation generator (DocGen) for the Mojo🔥 programming language.
It generates Markdown for static site generators (SSGs) from mojo doc
JSON output.
This example in the User guide shows a Mojo🔥 package processed with Modo🧯 and rendered with Hugo, to demonstrate Modo🧯's features.
- Generates Mojo🔥 API docs for Hugo, mdBook or just plain Markdown.
- Provides a simple syntax for code cross-references.
- Optionally structures API docs according to package re-exports.
- Optionally extracts doc-tests for
mojo test
from code blocks. - Customizable output through user templates.
See the User guide for more information.
Modo🧯 is available on PyPI as pymodo
.
Install it with pip:
pip install pymodo
This installs the
modo
command. If the command is not found, try:
python -m pymodo
With Go installed, you can install Modo🧯 like this:
go install github.com/mlange-42/modo@latest
Pre-compiled binaries for manual installation are available in the Releases for Linux, Windows and MacOS.
In your Mojo🔥 project, set up Modo🧯:
modo init
This sets up the project with default settings and paths.
See the generated modo.yaml
file to modify them.
Next, run mojo doc
to extract the API docs in JSON format:
mojo doc src/ -o api.json
Finally, build the Markdown documentation:
modo build
See the User guide for more information.
This project is distributed under the MIT license.