A modular tool for automatically generating README documentation for Kubeflow Pipelines components and pipelines.
Run from the project root directory:
# Generate README for a component
python -m scripts.generate_readme --component components/some_category/my_component
# Generate README for a pipeline
python -m scripts.generate_readme --pipeline pipelines/some_category/my_pipeline
# Check if READMEs are in sync (default, exits 1 if diffs found)
python -m scripts.generate_readme --component components/some_category/my_component
# Fix out-of-sync READMEs
python -m scripts.generate_readme \
--component components/some_category/my_component \
--fix
# Or with uv
uv run -m scripts.generate_readme --component components/some_category/my_component- Automatic metadata extraction: Parses Python functions decorated with
@dsl.componentor@dsl.pipeline, and augments with metadata frommetadata.yaml - Google-style docstring parsing: Extracts parameter descriptions and return values
- Custom content preservation: Preserves user-added content after the
<!-- custom-content -->marker - Type annotation support: Handles complex type annotations including Optional, Union, and generics
- Component-specific usage examples: Includes/Updates an example usage
for the given pipeline or component, if provided via
example_pipelines.py - Category index generation: Automatically creates and updates category-level READMEs that index all components/pipelines in a category
Users can add custom sections to their READMEs that will be preserved across regenerations:
- Add the marker
<!-- custom-content -->at the desired location - Write custom content below the marker
- The content will be preserved when regenerating the README
Example:
## Metadata 🗂️
...
<!-- custom-content -->
## Additional Examples
Custom examples that won't be overwritten...