support h4 titles

This commit is contained in:
OniriCorpe 2024-04-30 01:16:23 +02:00
parent e76d43b440
commit 730e3cb989
2 changed files with 12 additions and 0 deletions

View file

@ -72,6 +72,14 @@ do
# converting .gmi files in .html
/usr/local/bin/gmnitohtml < "$gmi_file" > "$tempdir/body.html"
# trick to support h4 titles
lines=$(grep "<h3># .*<\/h3>" "$tempdir/body.html")
while read -r line; do
fixed_line=${line//<h3># /<h4>} # replace '<h3># ' by '<h4>'
fixed_line=${fixed_line//<\/h3>/<\/h4>} # replace '</h3>' by '</h4>'
sed -i "s~$line~$fixed_line~" "$tempdir/body.html"
done <<< "$lines"
# retrieving of the path of the current .gmi file
file_path="$(dirname "$gmi_file")"
# retrieving of the filename of the current .gmi file, without its extension

View file

@ -64,6 +64,10 @@
content: "### ";
}
h4::before {
content: "#### ";
}
blockquote::before {
content: "> ";
}