import nixos_render_docs as nrd import pytest import textwrap from sample_md import sample1 class Renderer(nrd.html.HTMLRenderer): def _pull_image(self, src: str) -> str: return src class Converter(nrd.md.Converter[nrd.html.HTMLRenderer]): def __init__(self, manpage_urls: dict[str, str], xrefs: dict[str, nrd.manual_structure.XrefTarget]): super().__init__() self._renderer = Renderer(manpage_urls, xrefs) def unpretty(s: str) -> str: return "".join(map(str.strip, s.splitlines())).replace('␣', ' ').replace('↵', '\n') def test_lists_styles() -> None: # nested lists rotate through a number of list style c = Converter({}, {}) assert c._render("- - - - foo") == unpretty("""
foo
foo
| d | l | m | r |
|---|---|---|---|
| a | b | c | d |
foo
nested
man(1) reference
some nested anchors
emph␣
strong␣
nesting emph and strong␣
and code
wide bullet
list
wide ordered
list
narrow bullet
list
narrow ordered
list
quotes
with nesting
nested code block↵
and lists
containing code↵and more quote
list starting at 100
goes on
with a quote↵ and stuff
code block↵
fenced block↵
text
foo