Skip to content

Latest commit

 

History

History
64 lines (46 loc) · 1.97 KB

File metadata and controls

64 lines (46 loc) · 1.97 KB

Generate README Module

A modular tool for automatically generating README documentation for Kubeflow Pipelines components and pipelines.

Usage

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

Features

  • Automatic metadata extraction: Parses Python functions decorated with @dsl.component or @dsl.pipeline, and augments with metadata from metadata.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

Custom Content

Users can add custom sections to their READMEs that will be preserved across regenerations:

  1. Add the marker <!-- custom-content --> at the desired location
  2. Write custom content below the marker
  3. The content will be preserved when regenerating the README

Example:

## Metadata 🗂️
...

<!-- custom-content -->

## Additional Examples

Custom examples that won't be overwritten...