diff --git a/.github/utils/pydoc-markdown.sh b/.github/utils/pydoc-markdown.sh index 670bd0969..0344db5bc 100755 --- a/.github/utils/pydoc-markdown.sh +++ b/.github/utils/pydoc-markdown.sh @@ -1,10 +1,24 @@ #!/bin/bash +# Usage: ./pydoc-markdown.sh [CONFIG_PATH] +# +# Generate documentation from pydoc-markdown config files. +# +# Examples: +# ./pydoc-markdown.sh # Uses default path: ../config/* +# ./pydoc-markdown.sh ../config/api/* # Uses custom path +# ./pydoc-markdown.sh /path/to/configs/* # Uses absolute path + set -e # Fails on any error in the following loop + +# Set default config path or use provided parameter +CONFIG_PATH="${1:-../config/*}" + cd docs/pydoc rm -rf temp && mkdir temp cd temp -for file in ../config/* ; do +echo "Processing config files in $CONFIG_PATH" +for file in $CONFIG_PATH ; do echo "Converting $file..." pydoc-markdown "$file" done diff --git a/pyproject.toml b/pyproject.toml index c2eb0633c..b82663a4a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -176,7 +176,7 @@ detached = true # To avoid installing the dependencies f dependencies = ["haystack-pydoc-tools"] [tool.hatch.envs.readme.scripts] -sync = "./.github/utils/pydoc-markdown.sh" +sync = "./.github/utils/pydoc-markdown.sh {args}" delete-outdated = "python ./.github/utils/delete_outdated_docs.py {args}" [project.urls]