nixos-render-docs: support compact lists in manpages

most of the lists in option docs are actually compact, but docbook to
manpage processing always rendered them as non-compact. compactifying
these lists improves readability somewhat since most lists and their
contents are pretty short.
This commit is contained in:
pennae
2023-02-08 15:23:34 +01:00
committed by pennae
parent 10a4f0daca
commit 5c5dadd382
@@ -165,7 +165,7 @@ class ManpageRenderer(Renderer):
env: MutableMapping[str, Any]) -> str:
self._enter_block()
lst = self._list_stack[-1]
maybe_space = '' if not lst.first_item_seen else '.sp\n'
maybe_space = '' if lst.compact or not lst.first_item_seen else '.sp\n'
lst.first_item_seen = True
head = ""
if lst.next_idx is not None:
@@ -182,7 +182,7 @@ class ManpageRenderer(Renderer):
return ".RE"
def bullet_list_open(self, token: Token, tokens: Sequence[Token], i: int, options: OptionsDict,
env: MutableMapping[str, Any]) -> str:
self._list_stack.append(List(width=4, compact=False))
self._list_stack.append(List(width=4, compact=bool(token.meta['compact'])))
return self._maybe_parbreak()
def bullet_list_close(self, token: Token, tokens: Sequence[Token], i: int, options: OptionsDict,
env: MutableMapping[str, Any]) -> str: