mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-16 23:20:56 +03:00
nixos-render-docs: add image support
currently only supported for html. docbook could also support images, but it's on the way out for manual generation anyway so we won't add image support there. options docs can't use images because they also target manpages, which leaves no viable users.
This commit is contained in:
parent
b962ff92ff
commit
8c2d14a6b8
6 changed files with 70 additions and 8 deletions
|
@ -184,3 +184,7 @@ class CommonMarkRenderer(Renderer):
|
|||
def ordered_list_close(self, token: Token, tokens: Sequence[Token], i: int) -> str:
|
||||
self._list_stack.pop()
|
||||
return ""
|
||||
def image(self, token: Token, tokens: Sequence[Token], i: int) -> str:
|
||||
if title := cast(str, token.attrs.get('title', '')):
|
||||
title = ' "' + title.replace('"', '\\"') + '"'
|
||||
return f''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue