diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:23:02 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-29 04:23:02 +0000 |
commit | 943e3dc057eca53e68ddec51529bd6a1279ebd8e (patch) | |
tree | 61fb7bac619a56dfbcdcbdb7b0d4d6535fc36fe9 /tests/test_renderers/fixtures/sphinx_syntax_elements.md | |
parent | Initial commit. (diff) | |
download | myst-parser-943e3dc057eca53e68ddec51529bd6a1279ebd8e.tar.xz myst-parser-943e3dc057eca53e68ddec51529bd6a1279ebd8e.zip |
Adding upstream version 0.18.1.upstream/0.18.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_renderers/fixtures/sphinx_syntax_elements.md')
-rw-r--r-- | tests/test_renderers/fixtures/sphinx_syntax_elements.md | 800 |
1 files changed, 800 insertions, 0 deletions
diff --git a/tests/test_renderers/fixtures/sphinx_syntax_elements.md b/tests/test_renderers/fixtures/sphinx_syntax_elements.md new file mode 100644 index 0000000..1ac085c --- /dev/null +++ b/tests/test_renderers/fixtures/sphinx_syntax_elements.md @@ -0,0 +1,800 @@ +Raw +. +foo +. +<document source="<src>/index.md"> + <paragraph> + foo +. + +Hard-break +. +foo\ +bar +. +<document source="<src>/index.md"> + <paragraph> + foo + <raw format="html" xml:space="preserve"> + <br /> + <raw format="latex" xml:space="preserve"> + \\ + bar +. + +Strong: +. +**foo** +. +<document source="<src>/index.md"> + <paragraph> + <strong> + foo +. + +Emphasis +. +*foo* +. +<document source="<src>/index.md"> + <paragraph> + <emphasis> + foo +. + +Escaped Emphasis: +. +\*foo* +. +<document source="<src>/index.md"> + <paragraph> + *foo* +. + +Mixed Inline +. +a *b* **c** `abc` \\* +. +<document source="<src>/index.md"> + <paragraph> + a + <emphasis> + b + + <strong> + c + + <literal> + abc + \* +. + +Inline Code: +. +`foo` +. +<document source="<src>/index.md"> + <paragraph> + <literal> + foo +. + +Heading: +. +# foo +. +<document source="<src>/index.md"> + <section ids="foo" names="foo"> + <title> + foo +. + +Heading Levels: +. +# a +## b +### c +# d +. +<document source="<src>/index.md"> + <section ids="a" names="a"> + <title> + a + <section ids="b" names="b"> + <title> + b + <section ids="c" names="c"> + <title> + c + <section ids="d" names="d"> + <title> + d +. + +Block Code: +. + foo +. +<document source="<src>/index.md"> + <literal_block language="none" xml:space="preserve"> + foo +. + +Fenced Code: +. +```sh +foo +``` +. +<document source="<src>/index.md"> + <literal_block language="sh" xml:space="preserve"> + foo +. + +Fenced Code no language: +. +``` +foo +``` +. +<document source="<src>/index.md"> + <literal_block language="default" xml:space="preserve"> + foo +. + +Fenced Code no language with trailing whitespace: +. +``` +foo +``` +. +<document source="<src>/index.md"> + <literal_block language="default" xml:space="preserve"> + foo +. + +Image empty: +. +![]() +. +<document source="<src>/index.md"> + <paragraph> + <image alt="" uri=""> +. + +Image with alt and title: +. +![alt](src "title") +. +<document source="<src>/index.md"> + <paragraph> + <image alt="alt" title="title" uri="src"> +. + +Image with escapable html: +. +![alt](http://www.google<>.com) +. +<document source="<src>/index.md"> + <paragraph> + <image alt="alt" uri="http://www.google%3C%3E.com"> +. + +Block Quote: +. +> *foo* +. +<document source="<src>/index.md"> + <block_quote> + <paragraph> + <emphasis> + foo +. + +Bullet List: +. +- *foo* +* bar +. +<document source="<src>/index.md"> + <bullet_list bullet="-"> + <list_item> + <paragraph> + <emphasis> + foo + <bullet_list bullet="*"> + <list_item> + <paragraph> + bar +. + +Nested Bullets +. +- a + - b + - c + - d +. +<document source="<src>/index.md"> + <bullet_list bullet="-"> + <list_item> + <paragraph> + a + <bullet_list bullet="-"> + <list_item> + <paragraph> + b + <bullet_list bullet="-"> + <list_item> + <paragraph> + c + <list_item> + <paragraph> + d +. + +Enumerated List: +. +1. *foo* + +1) bar + +para + +10. starting +11. enumerator +. +<document source="<src>/index.md"> + <enumerated_list enumtype="arabic" prefix="" suffix="."> + <list_item> + <paragraph> + <emphasis> + foo + <enumerated_list enumtype="arabic" prefix="" suffix=")"> + <list_item> + <paragraph> + bar + <paragraph> + para + <enumerated_list enumtype="arabic" prefix="" start="10" suffix="."> + <list_item> + <paragraph> + starting + <list_item> + <paragraph> + enumerator +. + +Nested Enumrated List: +. +1. a +2. b + 1. c +. +<document source="<src>/index.md"> + <enumerated_list enumtype="arabic" prefix="" suffix="."> + <list_item> + <paragraph> + a + <list_item> + <paragraph> + b + <enumerated_list enumtype="arabic" prefix="" suffix="."> + <list_item> + <paragraph> + c +. + +Sphinx Role containing backtick: +. +{code}``a=1{`}`` +. +<document source="<src>/index.md"> + <paragraph> + <literal classes="code"> + a=1{`} +. + +Target: +. +(target)= +. +<document source="<src>/index.md"> + <target ids="target" names="target"> +. + +Target with whitespace: +. +(target with space)= +. +<document source="<src>/index.md"> + <target ids="target-with-space" names="target\ with\ space"> +. + +Referencing: +. +(target)= + +Title +===== + +[alt1](target) + +[](target2) + +[alt2](https://www.google.com) + +[alt3](#target3) +. +<document source="<src>/index.md"> + <target ids="target" names="target"> + <section ids="title" names="title"> + <title> + Title + <paragraph> + <pending_xref refdoc="index" refdomain="True" refexplicit="True" reftarget="target" reftype="myst" refwarn="True"> + <inline classes="xref myst"> + alt1 + <paragraph> + <pending_xref refdoc="index" refdomain="True" refexplicit="False" reftarget="target2" reftype="myst" refwarn="True"> + <inline classes="xref myst"> + <paragraph> + <reference refuri="https://www.google.com"> + alt2 + <paragraph> + <pending_xref refdoc="index" refdomain="True" refexplicit="True" reftarget="#target3" reftype="myst" refwarn="True"> + <inline classes="xref myst"> + alt3 +. + +Comments: +. +line 1 +% a comment +line 2 +. +<document source="<src>/index.md"> + <paragraph> + line 1 + <comment xml:space="preserve"> + a comment + <paragraph> + line 2 +. + +Block Break: +. ++++ string +. +<document source="<src>/index.md"> + <comment classes="block_break" xml:space="preserve"> + string +. + +Link Reference: +. +[name][key] + +[key]: https://www.google.com "a title" +. +<document source="<src>/index.md"> + <paragraph> + <reference refuri="https://www.google.com" title="a title"> + name +. + +Link Reference short version: +. +[name] + +[name]: https://www.google.com "a title" +. +<document source="<src>/index.md"> + <paragraph> + <reference refuri="https://www.google.com" title="a title"> + name +. + +Block Quotes: +. +```{epigraph} +a b*c* + +-- a**b** +``` +. +<document source="<src>/index.md"> + <block_quote classes="epigraph"> + <paragraph> + a b + <emphasis> + c + <attribution> + a + <strong> + b +. + +Link Definition in directive: +. +```{note} +[a] +``` + +[a]: link +. +<document source="<src>/index.md"> + <note> + <paragraph> + <pending_xref refdoc="index" refdomain="True" refexplicit="True" reftarget="link" reftype="myst" refwarn="True"> + <inline classes="xref myst"> + a +. + +Link Definition in nested directives: +. +```{note} +[ref1]: link +``` + +```{note} +[ref1] +[ref2] +``` + +```{note} +[ref2]: link +``` +. +<document source="<src>/index.md"> + <note> + <note> + <paragraph> + <pending_xref refdoc="index" refdomain="True" refexplicit="True" reftarget="link" reftype="myst" refwarn="True"> + <inline classes="xref myst"> + ref1 + + [ref2] + <note> +. + +Footnotes: +. +[^a] + +[^a]: footnote*text* +. +<document source="<src>/index.md"> + <paragraph> + <footnote_reference auto="1" ids="id1" refname="a"> + <transition classes="footnotes"> + <footnote auto="1" ids="a" names="a"> + <paragraph> + footnote + <emphasis> + text +. + +Footnotes nested blocks: +. +[^a] + +[^a]: footnote*text* + + abc +xyz + + > a + + - b + + c + +finish +. +<document source="<src>/index.md"> + <paragraph> + <footnote_reference auto="1" ids="id1" refname="a"> + <paragraph> + finish + <transition classes="footnotes"> + <footnote auto="1" ids="a" names="a"> + <paragraph> + footnote + <emphasis> + text + <paragraph> + abc + + xyz + <block_quote> + <paragraph> + a + <bullet_list bullet="-"> + <list_item> + <paragraph> + b + <paragraph> + c +. + +Front Matter: +. +--- +a: 1 +b: foo +c: + d: 2 +--- +. +<document source="<src>/index.md"> + <field_list> + <field> + <field_name> + a + <field_body> + <paragraph> + <literal> + 1 + <field> + <field_name> + b + <field_body> + <paragraph> + <literal> + foo + <field> + <field_name> + c + <field_body> + <paragraph> + <literal> + {"d": 2} +. + +Front Matter Biblio: +. +--- +author: Chris Sewell +authors: Chris Sewell, Chris Hodgraf +organization: EPFL +address: | + 1 Cedar Park Close + Thundersley + Essex +contact: <https://example.com> +version: 1.0 +revision: 1.1 +status: good +date: 2/12/1985 +copyright: MIT +dedication: | + To my *homies* +abstract: + Something something **dark** side +other: Something else +--- +. +<document source="<src>/index.md"> + <field_list> + <field> + <field_name> + author + <field_body> + <paragraph> + Chris Sewell + <field> + <field_name> + authors + <field_body> + <paragraph> + Chris Sewell, Chris Hodgraf + <field> + <field_name> + organization + <field_body> + <paragraph> + EPFL + <field> + <field_name> + address + <field_body> + <paragraph> + 1 Cedar Park Close + + Thundersley + + Essex + + <field> + <field_name> + contact + <field_body> + <paragraph> + <reference refuri="https://example.com"> + https://example.com + <field> + <field_name> + version + <field_body> + <paragraph> + 1.0 + <field> + <field_name> + revision + <field_body> + <paragraph> + 1.1 + <field> + <field_name> + status + <field_body> + <paragraph> + good + <field> + <field_name> + date + <field_body> + <paragraph> + 2/12/1985 + <field> + <field_name> + copyright + <field_body> + <paragraph> + MIT + <field> + <field_name> + dedication + <field_body> + <paragraph> + To my + <emphasis> + homies + + <field> + <field_name> + abstract + <field_body> + <paragraph> + Something something + <strong> + dark + side + <field> + <field_name> + other + <field_body> + <paragraph> + <literal> + Something else +. + +Front Matter Bad Yaml: +. +--- +a: { +--- +. +<document source="<src>/index.md"> + <system_message level="2" line="1" source="<src>/index.md" type="WARNING"> + <paragraph> + Malformed YAML [myst.topmatter] +. + +Front Matter HTML Meta +. +--- +myst: + html_meta: + keywords: Sphinx, documentation, builder + description lang=en: An amusing story + description lang=fr: Un histoire amusant + http-equiv=Content-Type: text/html; charset=ISO-8859-1 +--- +. +<document source="<src>/index.md"> + <pending> + .. internal attributes: + .transform: docutils.transforms.components.Filter + .details: + component: 'writer' + format: 'html' + nodes: + <meta content="Sphinx, documentation, builder" name="keywords"> + <pending> + .. internal attributes: + .transform: docutils.transforms.components.Filter + .details: + component: 'writer' + format: 'html' + nodes: + <meta content="An amusing story" lang="en" name="description"> + <pending> + .. internal attributes: + .transform: docutils.transforms.components.Filter + .details: + component: 'writer' + format: 'html' + nodes: + <meta content="Un histoire amusant" lang="fr" name="description"> + <pending> + .. internal attributes: + .transform: docutils.transforms.components.Filter + .details: + component: 'writer' + format: 'html' + nodes: + <meta content="text/html; charset=ISO-8859-1" http-equiv="Content-Type"> +. + +Full Test: +. +--- +a: 1 +--- + +(target)= +# header 1 +## sub header 1 + +a *b* **c** `abc` + +## sub header 2 + +x y [a](http://www.xyz.com) z + +--- + +# header 2 + +```::python {a=1} +a = 1 +``` + +[](target) +. +<document source="<src>/index.md"> + <field_list> + <field> + <field_name> + a + <field_body> + <paragraph> + <literal> + 1 + <target ids="target" names="target"> + <section ids="header-1" names="header\ 1"> + <title> + header 1 + <section ids="sub-header-1" names="sub\ header\ 1"> + <title> + sub header 1 + <paragraph> + a + <emphasis> + b + + <strong> + c + + <literal> + abc + <section ids="sub-header-2" names="sub\ header\ 2"> + <title> + sub header 2 + <paragraph> + x y + <reference refuri="http://www.xyz.com"> + a + z + <transition> + <section ids="header-2" names="header\ 2"> + <title> + header 2 + <literal_block language="::python" xml:space="preserve"> + a = 1 + <paragraph> + <pending_xref refdoc="index" refdomain="True" refexplicit="False" reftarget="target" reftype="myst" refwarn="True"> + <inline classes="xref myst"> +. |