Generate beautiful API documentation for Nextflow pipelines
Choose from 4 different output formats:
|
|
|
Important
This is not an official Nextflow project. It's a fun side-project by Phil Ewels. Please use at your own risk :)
Information is pulled from multiple sources to construct the docs (each only if available):
- README.md - Pipeline overview and description
- nextflow.config - Runtime configuration defaults
- nextflow_schema.json - Typed input parameters with descriptions and validation rules
- Language Server - Processes, workflows, functions with their Groovydoc comments
- meta.yml - nf-core module metadata (tools, keywords, authors)
The documentation for workflows, processes and functions is relatively unique. nf-docs extracts
this from your Nextflow pipelines by querying the
Nextflow Language Server. It produces structured
API documentation similar to Sphinx for Python or Javadoc for Java.
See https://ewels.github.io/nf-docs
With uv:
uvx nf-docs generate ./my_pipelineWith pip:
# Install
pip install nf-docs
# Generate HTML documentation
nf-docs generate ./my_pipelineWith Bioconda (requires channel setup):
pixi global install nf-docs
# or
conda install nf-docsThat's it! Open docs/index.html in your browser.
Pass a single .nf file to generate a focused, module-style README:
nf-docs generate modules/mytool/subtools/main.nf --format mdBy default this writes README.md next to main.nf. Use --output to pick a different path, or
--format json / --format yaml to print structured output to stdout instead.
nf-docs can generate pipeline documentation automatically before each commit using
Prek or pre-commit:
repos:
- repo: https://github.com/ewels/nf-docs
rev: v0.3.0
hooks:
- id: nf-docsInstall the hook into your repo:
# With Prek (recommended)
prek install
# Or with pre-commit
pre-commit installThe hook defaults to nf-docs generate . --format html, which writes HTML output to docs/.
Override args in your .pre-commit-config.yaml to use another format or output path:
repos:
- repo: https://github.com/ewels/nf-docs
rev: v0.3.0
hooks:
- id: nf-docs
args: [., --format, markdown, --output, docs/api]See CONTRIBUTING.md for development setup, testing, and contribution guidelines.
Apache 2.0 - see LICENSE for details.
