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.
- Super easy to set up for an existing Mojo🔥 project.
- 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. See the Modo🧯 slides for a feature overview.
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
With Go, you can also install the latest development version:
go install github.com/mlange-42/modo@main
Pre-compiled binaries for manual installation are available in the Releases for Linux, Windows and MacOS.
To initialize an existing Mojo🔥 project for Modo🧯 and an SSG like Hugo, run command init
once:
modo init hugo
This sets up everything to be able to build Markdown files for the target SSG with command build
:
modo build
Finally, serve or build the site with the target SSG (here Hugo):
hugo serve -s docs/site/
See Project setup for details and other supported SSGs.
This project is distributed under the MIT license.