diff --git a/scripts/pdf/basic.css b/scripts/pdf/basic.css
index a81c5efce1..52d794209e 100644
--- a/scripts/pdf/basic.css
+++ b/scripts/pdf/basic.css
@@ -34,3 +34,13 @@ h1, h2, h4, ul {
margin-top: 8.2em;
font-size: 300%;
}
+
+/*
+The same is to have this look like a H1 tag, but we want the H2 tag so the
+bookmarks list makes sense.
+*/
+h2.title-page {
+ font-size: 2em;
+ margin-top: 0.67em;
+ margin-bottom: 0.67em;
+}
diff --git a/scripts/pdf/render.py b/scripts/pdf/render.py
index 23fa8556f4..53e00ebf67 100644
--- a/scripts/pdf/render.py
+++ b/scripts/pdf/render.py
@@ -10,7 +10,6 @@ through CSS, and finally rendering them as PDF. There is no LaTeX dependency for
import os
import sys
import glob
-import re
import markdown
import argparse
from datetime import datetime
@@ -34,10 +33,10 @@ def main(loc, colorscheme):
html = (
'
'
+ "tldr pages
"
- + "Simplified and community-driven man pages
"
- + "Generated on "
+ + "Simplified and community-driven man pages
"
+ + "Generated on "
+ datetime.now().strftime("%c")
- + ""
+ + "
"
+ ''
)
@@ -46,9 +45,9 @@ def main(loc, colorscheme):
# Required string to create directory title pages
html += (
- ""
+ ""
+ operating_sys.capitalize()
- + "
"
+ + ""
+ ''
)
@@ -58,9 +57,12 @@ def main(loc, colorscheme):
):
with open(md, "r") as inp:
text = inp.readlines()
+ # modify our page to have an H2 header, so that it is grouped under
+ # the H1 header for the directory
+ text[0] = "" + text[0][2:] + "
"
for line in text:
- if re.match(r"^>", line):
- line = line[:0] + "####" + line[1:]
+ if line.startswith(">"):
+ line = "####" + line[1:]
html += markdown.markdown(line)
html += ''
print(f"Rendered page {page_number} of the directory {operating_sys}")