chore: Update pydoc-markdown.sh (#9547)

* Make config path a $1 param ; Add usage in comment ; Add echo log

* Update sync command
This commit is contained in:
Michele Pangrazzi 2025-06-24 14:01:51 +02:00 committed by GitHub
parent 9ed0b9b0bc
commit 3207a76d50
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 16 additions and 2 deletions

View File

@ -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

View File

@ -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]