module apibook.cli

Main entrypoint for the CLI usage.

This module provides a command line interface for the apibook package. The CLI accepts the following arguments:

  • root_dir: the root directory to search for Python files
  • output_dir: the output directory for markdown files
  • summary_template_file: Optional path to a file containing a summary template.

Example usage:

python -m apibook.cli my_package/ doc/src --summary-template-file doc/SUMMARY.tmpl

Running the above command will generate markdown files for all Python files in the my_package, and write them to the doc/src directory. The SUMMARY.md file will be generated using the template found in doc/SUMMARY.tmpl.

An example template file might look like this:

# SUMMARY

[Introduction](README.md)

# Usage

- [Quickstart](quickstart.md)
- [Advanced Usage](advanced.md)

# API Reference

{{apibook_toc}}

Functions

def main() -> None

Classes

class Args:

Class to hold command line arguments.

Fields

  • root_dir: str

  • output_dir: str

  • summary_template_file: str | None = None

  • verbose: bool = False

Methods

def parse() -> Args

Parse command line arguments.