Skip to content

Commit a4271a5

Browse files
committed
chore: enhance documentation generation workflow with markdown conversion
- Added steps to install a markdown converter and convert .md files to .html. - Updated the workflow to clean the output folder and handle the renaming of the main entry point. - Improved logging for the conversion process and adjusted file checks for the generated index.html.
1 parent bc00be2 commit a4271a5

1 file changed

Lines changed: 31 additions & 11 deletions

File tree

.github/workflows/test-docs-generation.yml

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,50 @@ jobs:
5555
mkdir -p .github/scripts/docs
5656
bash .github/scripts/docs/generate-and-publish-docs.sh "$BRANCH_TYPE" "$VERSION"
5757
58-
# Create proper structure for GitHub Pages
58+
- name: Generate and convert documentation
59+
run: |
60+
# Install markdown converter
61+
npm install -g marked
62+
63+
# Clean and setup output folder
64+
rm -rf _site
5965
mkdir -p _site
6066
61-
# Copy all docs
67+
# Copy all docs recursively
6268
cp -r docs/* _site/
6369
64-
# Rename entry point (GitHub Pages needs lowercase index.md)
65-
cp docs/INDEX.md _site/index.md
66-
67-
# Create .nojekyll file to bypass Jekyll processing
70+
# Touch .nojekyll to disable Jekyll processing
6871
touch _site/.nojekyll
72+
73+
# Convert all .md files to .html
74+
find _site -name '*.md' | while read -r file; do
75+
html_file="${file%.md}.html"
76+
echo "Converting $file → $html_file"
77+
npx marked -i "$file" -o "$html_file"
78+
done
79+
80+
# Rename main entry point
81+
if [ -f _site/INDEX.html ]; then
82+
cp _site/INDEX.html _site/index.html
83+
fi
84+
85+
# Remove all .md files after converting (optional)
86+
find _site -name '*.md' -delete
87+
88+
echo "Conversion complete!"
6989
7090
- name: List _site contents
7191
run: |
72-
echo "Files in _site:"
92+
echo "Files in _site after conversion:"
7393
find _site -type f | sort
74-
94+
7595
# Check index file specifically
7696
echo "Index file check:"
7797
ls -la _site/index*
78-
98+
7999
# Peek at the content of the index file
80-
echo "First 10 lines of index.md:"
81-
head -n 10 _site/index.md || echo "index.md not found"
100+
echo "First 20 lines of index.html:"
101+
head -n 20 _site/index.html || echo "index.html not found"
82102
83103
- name: Setup Pages
84104
uses: actions/configure-pages@v5

0 commit comments

Comments
 (0)