Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bash script which rebuilds the indexes (index.txt and the links listed in git-extras.md) based on the collection of .md file documents avalable. By interrogating the .md file for the documented description we null and void yet another possible consistency issue and avoid manual duplication mistakes. Once the indexes are up to date we start from the begining of the directory listing again calling ronn on each .md to generate the man and html files as well as renaming the incerrectly name html file. Result several incorrectly named .html documents are now removed, and all the documentation is up to date. Documentation also updated.
- Loading branch information
Showing
2 changed files
with
37 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
echo '# manuals' > index.txt.tmp | ||
ln=$(awk '/## COMMANDS/{print NR};' ./git-extras.md) | ||
awk "NR <= $ln+1" git-extras.md > git-extras.md.tmp | ||
for file in $(ls git*.md); do | ||
extra=${file/.md/} | ||
spaced=" " | ||
echo "$extra(1)${spaced:${#extra}}$extra" >> index.txt.tmp; | ||
title=$(grep -m=1 $extra"(1) -- " $file) | ||
test "$extra" != "git-extras" && echo " - **"${title/" --"/"**"} >> git-extras.md.tmp | ||
done | ||
ln=$(awk '/## AUTHOR/{print NR};' ./git-extras.md) | ||
awk "NR >= $ln-1" git-extras.md >> git-extras.md.tmp && mv -f index.txt.tmp index.txt && mv -f git-extras.md.tmp git-extras.md | ||
|
||
for file in $(ls git*.md); do | ||
extra=${file/.md/} | ||
ronn $file && mv -f $extra.1.html $extra.html | ||
done |