mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
Meta: Create nested manpage section indices for the website
This is probably committing some sed crimes, but it looks very nice!
This commit is contained in:
parent
20f44e095d
commit
8fb7c32ec3
Notes:
sideshowbarker
2024-07-17 05:02:42 +09:00
Author: https://github.com/kleinesfilmroellchen Commit: https://github.com/SerenityOS/serenity/commit/8fb7c32ec3 Pull-request: https://github.com/SerenityOS/serenity/pull/16776 Reviewed-by: https://github.com/BenWiederhake ✅
1 changed files with 6 additions and 2 deletions
|
@ -76,11 +76,15 @@ for section_directory in output/*/; do
|
|||
<(
|
||||
for f in $(find "${section_directory}" -iname '*.html' | ${SORT}); do
|
||||
filename=$(realpath --relative-to="${section_directory}" "$f")
|
||||
name="${filename%.html}"
|
||||
if [[ "$filename" == "index.html" ]]; then
|
||||
continue
|
||||
fi
|
||||
echo "- [${name}](${filename})"
|
||||
filename_no_extension="${filename%.html}"
|
||||
# Generate indentation by subdirectory count: Replace each slash by the two Markdown indentation spaces, then remove all non-space characters.
|
||||
indentation=$(echo "${filename_no_extension}" | sed -e 's/ //g' -e 's/\// /g' -e 's/[^ ]//g')
|
||||
name="$(basename "${filename}")"
|
||||
name="${name%.html}"
|
||||
echo "${indentation}- [${name}](${filename})"
|
||||
done
|
||||
) &
|
||||
done
|
||||
|
|
Loading…
Add table
Reference in a new issue