Commit
Author: Manos Pitsidianakis [manos@pitsidianak.is]
Hash: 1232e16ad95143bb726e038a07f78366a53e7e83
Timestamp: Thu, 29 Aug 2024 14:11:00 +0000 (3 months ago)

+3 -3 +/-1 browse
scripts/make_html_manual_page.py: don't prettify
scripts/make_html_manual_page.py: don't prettify

Prettify in beautifulsoup4 messes up with newlines, which alters the
html content.

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
1diff --git a/scripts/make_html_manual_page.py b/scripts/make_html_manual_page.py
2index 41d76e5..89e8fa0 100644
3--- a/scripts/make_html_manual_page.py
4+++ b/scripts/make_html_manual_page.py
5 @@ -52,7 +52,6 @@ def clear_line(signum, frame):
6 signal.signal(signal.SIGWINCH, clear_line)
7
8 MIRRORS = [
9- "http://linux.die.net/man/%S/%N",
10 "http://man7.org/linux/man-pages/man%S/%N.%S.html",
11 "http://manpages.debian.org/stable/%N.%S.en.html",
12 "http://man.bsd.lv/%N.%S",
13 @@ -63,6 +62,7 @@ MIRRORS = [
14 "http://man.bsd.lv/POSIX-2013/%N.%S", # last resorts
15 "http://man.bsd.lv/UNIX-7/%N.%S",
16 "https://www.unix.com/man-page/mojave/%S/%N/",
17+ "http://linux.die.net/man/%S/%N",
18 ]
19
20
21 @@ -278,7 +278,7 @@ if __name__ == "__main__":
22
23 NO_TTY = args.no_tty
24 html_output = subprocess.run(
25- f'{args.mandoc} -I os="rendered by mandoc" -Kutf-8 -Ofragment,toc,includes="#%I"{refs_url} -Thtml "{args.page}" | sed \'s/\s*<\/pre/<\/pre/\'',
26+ f'{args.mandoc} -I os="rendered by mandoc" -Kutf-8 -Ofragment,toc,includes="#%I"{refs_url} -Thtml "{args.page}" | sed \'s/\\s*<\\/pre/<\\/pre/\'',
27 stdout=PIPE,
28 shell=True,
29 check=True,
30 @@ -406,5 +406,5 @@ if __name__ == "__main__":
31 </style>
32 """
33 )
34- f.write(soup.prettify())
35+ f.write(str(soup))
36 print("Written to ", args.output)