diff --git a/.github/workflows/manpages.yml b/.github/workflows/manpages.yml index 38277f5219..18aa04bf59 100644 --- a/.github/workflows/manpages.yml +++ b/.github/workflows/manpages.yml @@ -22,7 +22,8 @@ jobs: run: | for d in $MAN_DIR*/; do dir_name=$(basename "$d") - mkdir -p output/${dir_name/man} + section="${dir_name/man}" + mkdir -p "output/${section}" done - name: Convert markdown to html run: | @@ -33,18 +34,26 @@ jobs: return el end EOF - find $MAN_DIR -iname '*.md' -type f -exec sh -c 'relative_path=$(realpath --relative-to=$MAN_DIR $0) && stripped_path=${relative_path#man} && pandoc -f gfm -t html5 -s --lua-filter=link-fixup.lua -o output/${stripped_path%.md}.html ${0}' {} \; + find $MAN_DIR -iname '*.md' -type f -exec sh -c '\ + relative_path="$(realpath --relative-to=$MAN_DIR $0)" \ + && stripped_path="${relative_path#man}" \ + && section="${stripped_path%%/*}" \ + && filename="${stripped_path#*/}" \ + && name="${filename%.md}" \ + && pandoc -f gfm -t html5 -s --lua-filter=link-fixup.lua --metadata title="${name}(${section}) - SerenityOS man pages" -o "output/${section}/${name}.html" "${0}" \ + ' {} \; - name: Generate man page listings run: | for d in output/*/; do - dir_name=$(basename "$d") - echo "
${file_name%.html}
" >> "$d/index.html" + echo "${name}(${section})
" >> "${d}/index.html" done echo "" >> "$d/index.html" done diff --git a/Meta/Websites/man.serenityos.org/index.html b/Meta/Websites/man.serenityos.org/index.html index fe28d2eb76..46cb5b3514 100644 --- a/Meta/Websites/man.serenityos.org/index.html +++ b/Meta/Websites/man.serenityos.org/index.html @@ -6,12 +6,12 @@Man 1
-Man 2
-Man 3
-Man 4
-Man 5
-Man 7
-Man 8
+Section 1
+Section 2
+Section 3
+Section 4
+Section 5
+Section 7
+Section 8