Skip to content

Commit 6444e3c

Browse files
authored
feat: Add option to use HTML comments instead of details/summary (#3)
1 parent 48ed9f0 commit 6444e3c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

action.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,19 @@ runs:
4545
git checkout main
4646
4747
echo "Remove 'open' from any <details> tags"
48-
sed -i.tmp -r 's/<details id=([0-9]+) open>/<details id=\1>/g' README.md
48+
sed -i.tmp -r 's/<details id=([0-9X]+) open>/<details id=\1>/g' README.md
4949
5050
echo "Add 'open' to step TO_STEP"
5151
sed -i.tmp -r "s/<details id=$TO_STEP>/<details id=$TO_STEP open>/g" README.md
5252
53+
echo "Update all HTML comments to hide everything"
54+
sed -i.tmp -r 's/<!--step([0-9X]+)-->/<!--step\1/g' README.md
55+
sed -i.tmp -r 's/<!--endstep([0-9X]+)-->/endstep\1-->/g' README.md
56+
57+
echo "Show the current TO_STEP"
58+
sed -i.tmp -r "s/<\!--step$TO_STEP/<\!--step$TO_STEP-->/g" README.md
59+
sed -i.tmp -r "s/endstep$TO_STEP-->/<\!--endstep$TO_STEP-->/g" README.md
60+
5361
echo "Update the STEP file to TO_STEP"
5462
echo "$TO_STEP" > .github/script/STEP
5563

0 commit comments

Comments
 (0)