def test_front_matter(renderer): output = renderer.render(text_to_tokens("---\na: 1\nb: 2\nc: 3\n---")) assert output.splitlines() == [ '<div class="myst-front-matter"><pre><code class="language-yaml">a: 1', "b: 2", "c: 3", "</code></pre></div>", ]
def test_text_to_tokens(): root = text_to_tokens("abc") document = render_tokens( root, SphinxRenderer, load_sphinx_env=True, sphinx_conf={"project": "MyST Parser"}, ) assert document.pformat() == ( '<document source="notset">\n <paragraph>\n abc\n' )
def test_block_break(renderer): output = renderer.render(text_to_tokens("+++ abc")) assert output.splitlines() == [ "<!-- myst-block-data abc -->", '<hr class="myst-block-break" />', ]
def test_render_tokens(): root = text_to_tokens("abc") assert render_tokens(root, HTMLRenderer) == "<p>abc</p>\n"
def test_render_tokens(): root = text_to_tokens("abc") assert isinstance(root, Document) assert root.children, root.children