5
0
mirror of git://git.proxmox.com/git/pve-docs.git synced 2025-02-02 09:47:07 +03:00

docbook: render 4th section level for manpages

In the manpage output the sections get rendered as refsections, but
those only go up to level 3:

> In DocBook, RefSect3 is the lowest-level section allowed in a
> RefEntry. There is no element analogous to a Sect4.
-- https://tdg.docbook.org/tdg/4.5/refsect3

While nesting refsect3 would work output wise, the DTD schema does not
allows this, and disabling schema validation can lead to graver
issues, so rather avoid that and use a formalpara [0], a paragraph
with a title, instead, but only for the title, as the inner content
will be a simpara (simple paragraph) that cannot be nested inside a
formalpara, but the resulting rendering works out well enough.

[0]: https://tdg.docbook.org/tdg/4.5/formalpara

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
This commit is contained in:
Thomas Lamprecht 2024-03-06 17:54:05 +01:00
parent 4a06054e39
commit c2eab5cc87

View File

@ -5,6 +5,7 @@
#
# modified for Proxmox VE docs
# - add thumbnail attribute
# - render sect4 sections in manpages as formalpara title
[miscellaneous]
outfilesuffix=.xml
@ -693,6 +694,16 @@ template::[docinfo]
|
</refsect3>
# Proxmox: add custom section 4 level for manpages, as there is no refsect4 and
# the XML DTD schema does not allows nesting refsect3 (even if it would render
# OK). Use a formalpara, which is a paragraph with a title. As docbook always
# outputs a simpara (simple paragraph, very limited) for the inner content, we
# cannot nest that either, but rather just create an empty formalpara which can
# then be followed by whatever the original inner content is.
[sect4]
<formalpara{id? id="{id}"}{role? role="{role}"}><title>{title}</title><para></para></formalpara>
|
endif::doctype-manpage[]
#-------------------------