diff options
author | pennae <github@quasiparticle.net> | 2023-02-02 02:57:28 +0100 |
---|---|---|
committer | pennae <82953136+pennae@users.noreply.github.com> | 2023-02-08 15:23:34 +0100 |
commit | 5c5dadd382c983cc626c930fc14df798f957d72c (patch) | |
tree | b0997ada1e41f3b818b686543a8cc9bbce7e8f7a | |
parent | 10a4f0daca909e580df687426ced8e0d39056297 (diff) |
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.
-rw-r--r-- | pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/manpage.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/manpage.py b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/manpage.py index 8188cfb9871b2..b64e06a97df36 100644 --- a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/manpage.py +++ b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/manpage.py @@ -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: |