Command Line Usage
Once installed, pdocs
exposes a simple command line utility for generating documentation websites.
To verify the tool is installed correctly, run pdocs
from the command line and you should be given the available commands and the version of pdocs installed.
To get help for any individual subcommand run pdocs SUBCOMMAND --help
:
Serving Documentation Locally
Before you push documentation out publicly, it's a good idea to test it locally and ensure it looks as desired.
Running pdocs server YOUR_MODULES
will generate a new static website for your project in a temporary directory and start a local server to allow you to browse it (at localhost:8080 by default).
This command takes an optional --port
and --host
argument if you wish to override the defaults.
Tip
Every module you pass in to pdocs must be installed or otherwise available on your PYTHON_PATH
Outputting HTML Locally
You can also output pdocs
's generated documentation to a local directory.
To do so run pdocs as_html YOUR_MODULES
:
By default the generated documentation is outputted into a site
subdirectory.
If this directory exists for any reason, including previous documentation generation,
the command will fail. Passing in --overwrite
will delete any existing directory
before output to ensure the command passes. You can change the output directory using -o DIRECTORY
.
Outputting Markdown Locally
It is also straight-forward to output Markdown documentation for your project generated from your code via pdocs
.
To do so run pdocs as_markdown YOUR_MODULES
:
By default the generated documentation is outputted into a docs
subdirectory.
If this directory exists for any reason, including previous documentation generation,
the command will fail. Passing in --overwrite
will delete any existing directory
before output to ensure the command passes. You can change the output directory using -o DIRECTORY
.