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.
This commit is contained in:
parent
82d066ffe3
commit
6c182075bb
|
@ -178,6 +178,12 @@ class OptionDocsRestrictions:
|
||||||
def heading_close(self, token: Token, tokens: Sequence[Token], i: int, options: OptionsDict,
|
def heading_close(self, token: Token, tokens: Sequence[Token], i: int, options: OptionsDict,
|
||||||
env: MutableMapping[str, Any]) -> str:
|
env: MutableMapping[str, Any]) -> str:
|
||||||
raise RuntimeError("md token not supported in options doc", token)
|
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):
|
class OptionsDocBookRenderer(OptionDocsRestrictions, DocBookRenderer):
|
||||||
# TODO keep optionsDocBook diff small. remove soon if rendering is still good.
|
# TODO keep optionsDocBook diff small. remove soon if rendering is still good.
|
||||||
|
|
Loading…
Reference in a new issue