diff options
author | pennae <github@quasiparticle.net> | 2023-02-10 07:49:25 +0100 |
---|---|---|
committer | pennae <82953136+pennae@users.noreply.github.com> | 2023-02-21 18:19:00 +0100 |
commit | 6c182075bb453792683369eca2bdc630cb551a91 (patch) | |
tree | d6c8652636c81fe9e3cbdb0500a62fcc989c42df /pkgs/tools/nix | |
parent | 82d066ffe3dc263672b8a3fb8178a5294aeb9fb8 (diff) |
nixos-render-docs: forbid attrspans and examples in options
inline anchors are not allowed in option docs per the manual, and the sole class we current have (.keycap) is never used anyway. disallow them for now to avoid future surprises. the same goes for examples, which aren't even documented in the manual yet.
Diffstat (limited to 'pkgs/tools/nix')
-rw-r--r-- | pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py index 908c98c8d7101..39ea8f8c627f9 100644 --- a/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py +++ b/pkgs/tools/nix/nixos-render-docs/src/nixos_render_docs/options.py @@ -178,6 +178,12 @@ class OptionDocsRestrictions: def heading_close(self, token: Token, tokens: Sequence[Token], i: int, options: OptionsDict, env: MutableMapping[str, Any]) -> str: raise RuntimeError("md token not supported in options doc", token) + def attr_span_begin(self, token: Token, tokens: Sequence[Token], i: int, options: OptionsDict, + env: MutableMapping[str, Any]) -> str: + raise RuntimeError("md token not supported in options doc", token) + def example_open(self, token: Token, tokens: Sequence[Token], i: int, options: OptionsDict, + env: MutableMapping[str, Any]) -> str: + raise RuntimeError("md token not supported in options doc", token) class OptionsDocBookRenderer(OptionDocsRestrictions, DocBookRenderer): # TODO keep optionsDocBook diff small. remove soon if rendering is still good. |