Commit 6c182075 authored by pennae's avatar pennae Committed by pennae
Browse files

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.
parent 82d066ff
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -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.