Skip to content

Commit

Permalink
feat: TOC generation works
Browse files Browse the repository at this point in the history
  • Loading branch information
aeimer committed Oct 24, 2023
1 parent 3b056c0 commit 914810f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
13 changes: 5 additions & 8 deletions .ci-scripts/update-toc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,11 @@ set -euo pipefail
#set -x

function generateToc() {
echo "* TODO"
return
# while read -r file; do
# adrNumber=$(cut -d- -f1 <<<"$file")
# adrTitle=$(sed '/---/,/---/d' "$file" | sed -En 's/^# (.+)$/\1/p' | head -1)
# 1>&2 echo " - $file => ($adrNumber) $adrTitle"
# printf -- "* [ADR-%s](%s) - %s\n" "$adrNumber" "$file" "$adrTitle"
# done < <(find . -maxdepth 1 -type f -regex '\./[0-9]+-.*\.md' -exec basename {} \; | sort)
while read -r file; do
formulaName=${file//.yaml/}
1>&2 echo " - $formulaName"
printf -- "* %s\n" "$formulaName"
done < <(find /tmp/parsed-formula -maxdepth 1 -type f -regex '.*\.yaml' -exec basename {} \; | sort)
}

echo "Generating TOC in README.md"
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ brew install qaware/tap/protocurl
## Content

<!-- BEGIN TOC -->
* TODO
* foo
* foo2
* foo3
<!-- END TOC -->

## Formulae maintainer
Expand Down

0 comments on commit 914810f

Please sign in to comment.