mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-06-16 22:49:25 +03:00
nixos-render-docs: add inline anchor plugin
supports the […]{#id} inline anchor syntax. other features of bracketed spans are intentionally not supported.
This commit is contained in:
parent
41a5c3a93d
commit
6829c6c335
4 changed files with 226 additions and 0 deletions
|
@ -200,3 +200,6 @@ class DocBookRenderer(Renderer):
|
|||
else:
|
||||
return ref
|
||||
raise NotImplementedError("md node not supported yet", token)
|
||||
def inline_anchor(self, token: Token, tokens: Sequence[Token], i: int, options: OptionsDict,
|
||||
env: MutableMapping[str, Any]) -> str:
|
||||
return f'<anchor xml:id={quoteattr(cast(str, token.attrs["id"]))} />'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue