Skip to content

Commit 8ad80a1

Browse files
committed
build: generate new HTML documentation
This revamped doc target converts and installs the remaining bits of documentation mentioned in the sysusers manpages. Markdown documentation is converted using cmark-gfm if available, falling back to cmark or the original markdown. When cmark-gfm is not found, rendering of GitHub Flavoured Markdown features like tables is broken, but everything else is rendered fine. The generated HTML pages don't look like the ones seen on systemd.io, but I don't think it matters much; the important information is in the text, not the graphics. Addresses my previous comment, #1 (comment)
1 parent c9a58e9 commit 8ad80a1

3 files changed

Lines changed: 509 additions & 4 deletions

File tree

man/Makefile

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
manfiles5 = sysusers.d.5
22
manfiles8 = systemd-sysusers.8 systemd-sysusers.service.8
3-
docfiles = sysusers.d.html systemd-sysusers.html
3+
docfiles = UIDS-GIDS.html USER_NAMES.html
44

55
xsltargs = --nonet \
66
--xinclude \
@@ -21,8 +21,15 @@ man:
2121
xsltproc $(xsltargs) custom-man.xsl sysusers.d.xml
2222

2323
doc:
24-
xsltproc $(xsltargs) -o systemd-sysusers.html custom-html.xsl systemd-sysusers.xml
25-
xsltproc $(xsltargs) -o sysusers.d.html custom-html.xsl sysusers.d.xml
24+
if command -v cmark-gfm; then \
25+
md='cmark-gfm --extension table'; \
26+
elif command -v cmark; then \
27+
md='cmark'; \
28+
else \
29+
md='markdown'; \
30+
fi; \
31+
$$md UIDS-GIDS.md > UIDS-GIDS.html; \
32+
$$md USER_NAMES.md > USER_NAMES.html
2633

2734
# Delete files because wget can't overwrite them
2835
download-docs:
@@ -39,7 +46,9 @@ download-docs:
3946
'https://github.com/systemd/systemd/raw/main/man/custom-man.xsl' \
4047
'https://github.com/systemd/systemd/raw/main/man/standard-options.xml' \
4148
'https://github.com/systemd/systemd/raw/main/man/systemd-sysusers.xml' \
42-
'https://github.com/systemd/systemd/raw/main/man/sysusers.d.xml'
49+
'https://github.com/systemd/systemd/raw/main/man/sysusers.d.xml' \
50+
'https://github.com/systemd/systemd/raw/main/docs/UIDS-GIDS.md' \
51+
'https://github.com/systemd/systemd/raw/main/docs/USER_NAMES.md'
4352

4453
clean:
4554
rm -f $(manfiles5)

0 commit comments

Comments
 (0)