mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 06:47:34 +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
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
Add a link
Reference in a new issue