diff options
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/build-docs | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/bin/build-docs b/bin/build-docs index f3e29c5..ee8811e 100755 --- a/bin/build-docs +++ b/bin/build-docs | |||
| @@ -42,20 +42,23 @@ build_manpages() | |||
| 42 | dst_dir=$1 | 42 | dst_dir=$1 |
| 43 | man_dir=$2 | 43 | man_dir=$2 |
| 44 | 44 | ||
| 45 | find "$man_dir" -name 'check_*.md' -exec rm -f '{}' '+' | 45 | for pattern in 'check_*' 'negate' 'urlize' |
| 46 | find "$dst_dir/libexec" -name 'check_*' | while read plugin_path | ||
| 47 | do | 46 | do |
| 48 | plugin_name=${plugin_path##*/} | 47 | find "$man_dir" -name "$pattern" -exec rm -f '{}' '+' |
| 49 | man_file="$man_dir/${plugin_name}.md" | 48 | find "$dst_dir/libexec" -name "$pattern" | while read path |
| 49 | do | ||
| 50 | name=${path##*/} | ||
| 51 | man_file="$man_dir/${name}.md" | ||
| 50 | 52 | ||
| 51 | { | 53 | { |
| 52 | echo "title: $plugin_name" | 54 | echo "title: $name" |
| 53 | echo 'parent: Manpages' | 55 | echo 'parent: Manpages' |
| 54 | echo '---' | 56 | echo '---' |
| 55 | echo "# The $plugin_name Plugin" | 57 | echo "# The $name Plugin" |
| 56 | echo | 58 | echo |
| 57 | $plugin_path --help | sed 's/./ &/' | 59 | $path --help | sed 's/./ &/' |
| 58 | } >"$man_file" | 60 | } >"$man_file" |
| 61 | done | ||
| 59 | done | 62 | done |
| 60 | } | 63 | } |
| 61 | 64 | ||
