Skip to content

Commit

Permalink
merge by sed
Browse files Browse the repository at this point in the history
  • Loading branch information
sator-imaging authored Jan 10, 2024
1 parent 1a30617 commit 03b2934
Showing 1 changed file with 26 additions and 7 deletions.
33 changes: 26 additions & 7 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -331,8 +331,6 @@ runs:
- name: DEBUG
shell: bash
run: |
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
cat .docfx/toc.yml
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
cat .docfx/docfx-metadata-mref.json
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
Expand Down Expand Up @@ -374,19 +372,40 @@ runs:
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
# merge toc
# sed
sed -n -E '
/^- uid\: Global$/{
:a;
N;
/[\r\n]+- uid\: /!ba;
s/[\r\n]+[^\r\n]+$//;
s/[\r\n]+ name\: ..[\r\n]+/\n name\: "global\:\:"\n/;
p;
}' -i __stmg__toc_global.txt
head -1 __stmg__toc_api.txt > api/toc.yml
cat __stmg__toc_global.txt >> api/toc.yml
tail -n +2 __stmg__toc_api.txt >> api/toc.yml
# api/toc.json to api/index.md
echo "# API Reference" > api/index.md
mv __stmg__toc.txt toc.yml
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
cat api/index.md
cat toc.yml
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
cat api/toc.yml
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
# build
mv __stmg__toc.txt toc.yml
docfx build docfx-build.json
# api/toc.json to api/index.md
echo "# API Reference" > api/index.md
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
cat api/index.md
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
popd
Expand Down

0 comments on commit 03b2934

Please sign in to comment.