diff --git a/.gitignore b/.gitignore index 96e770f4..dc4ce707 100644 --- a/.gitignore +++ b/.gitignore @@ -54,6 +54,7 @@ coverage.xml # Translations *.mo *.pot +!tests/**/*.pot # Django stuff: *.log diff --git a/tests/test_sphinx/sourcedirs/gettext/fr/LC_MESSAGES/index.po b/tests/test_sphinx/sourcedirs/gettext/fr/LC_MESSAGES/index.po new file mode 100644 index 00000000..43e53202 --- /dev/null +++ b/tests/test_sphinx/sourcedirs/gettext/fr/LC_MESSAGES/index.po @@ -0,0 +1,127 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) XXXX, Executable Book Project +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2000-01-01 00:00+0000\n" +"PO-Revision-Date: 2000-01-01 00:00+0000\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +msgid "**bold** text 1" +msgstr "texte 1 en **gras**" + +msgid "**bold** text 2" +msgstr "texte 2 en **gras**" + +msgid "**bold** text 3" +msgstr "texte 3 en **gras**" + +msgid "**bold** text 4" +msgstr "texte 4 en **gras**" + +msgid "**bold** text 5" +msgstr "texte 5 en **gras**" + +msgid "**bold** text 6" +msgstr "texte 6 en **gras**" + +msgid "**bold** text 7" +msgstr "texte 7 en **gras**" + +msgid "**bold** text 8" +msgstr "texte 8 en **gras**" + +msgid "**bold** text 9" +msgstr "texte 9 en **gras**" + +msgid "**bold** text 10" +msgstr "texte 10 en **gras**" + +msgid "
\n" +"" +msgstr "\n" +"" + +msgid "**bold** text 11" +msgstr "texte 11 en **gras**" + +msgid "Extra ```backticks```" +msgstr "\"```Backtick```\" supplémentaire" + +msgid "
\n" +"" +msgstr "\n" +"" + +msgid "**additional** text 12\n" +"" +msgstr "texte 12 **supplémentaire**\n" +"" + +msgid "**additional** text 13\n" +"" +msgstr "texte 13 **supplémentaire**\n" +"" + +msgid "{\n" +" \"additional\": \"text 14\"\n" +"}\n" +"" +msgstr "{\n" +" \"supplémentaire\": \"texte 14\"\n" +"}\n" +"" + +msgid "

**additional** text 15

\n" +"" +msgstr "

texte 15 **supplémentaire**

\n" +"" + +msgid ">>> print('doctest block')\n" +"doctest block\n" +"" +msgstr ">>> print('bloque doctest')\n" +"'bloque doctest\n" +"" + +msgid "" +msgstr "" + +msgid "![Fun Fish 1](fun-fish.png)" +msgstr "![Poisson amusant 1](poisson-amusant.png)" + +msgid "Fun Fish 1" +msgstr "Poisson amusant 1" + +msgid ".. image:: fun-fish.png" +msgstr ".. image:: poisson-amusant.png" + +msgid "Fun Fish 2" +msgstr "Poisson amusant 2" + +msgid "Fun Fish 3" +msgstr "Poisson amusant 3" + +msgid ".. image:: fun-fish.png\n" +" :alt: Fun Fish 1" +msgstr ".. image:: poisson-amusant.png\n" +" :alt: Poisson amusant 1" + +msgid ".. image:: fun-fish.png\n" +" :alt: Fun Fish 2" +msgstr ".. image:: poisson-amusant.png\n" +" :alt: Poisson amusant 2" + +msgid ".. image:: fun-fish.png\n" +" :alt: Fun Fish 3" +msgstr ".. image:: poisson-amusant.png\n" +" :alt: Poisson amusant 3" diff --git a/tests/test_sphinx/sourcedirs/gettext/fun-fish.png b/tests/test_sphinx/sourcedirs/gettext/fun-fish.png new file mode 100644 index 00000000..c9a49971 Binary files /dev/null and b/tests/test_sphinx/sourcedirs/gettext/fun-fish.png differ diff --git a/tests/test_sphinx/sourcedirs/gettext/index.md b/tests/test_sphinx/sourcedirs/gettext/index.md index 861acf2c..a721944b 100644 --- a/tests/test_sphinx/sourcedirs/gettext/index.md +++ b/tests/test_sphinx/sourcedirs/gettext/index.md @@ -29,16 +29,35 @@ Extra ```backticks``` - **skip** text + **additional** text 12 ``` -**skip** text +**additional** text 13 ``` ```json { - "skip": "text" + "additional": "text 14" } ``` -

**skip** text

+

**additional** text 15

+ +```python +>>> print('doctest block') +doctest block +``` + +```{raw} html + +``` + +![Fun Fish 1](fun-fish.png) + +```{image} fun-fish.png +:alt: Fun Fish 2 +``` + +```{figure} fun-fish.png +:alt: Fun Fish 3 +``` diff --git a/tests/test_sphinx/sourcedirs/gettext/poisson-amusant.png b/tests/test_sphinx/sourcedirs/gettext/poisson-amusant.png new file mode 100644 index 00000000..c9a49971 Binary files /dev/null and b/tests/test_sphinx/sourcedirs/gettext/poisson-amusant.png differ diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py index 716772b7..08d17055 100644 --- a/tests/test_sphinx/test_sphinx_builds.py +++ b/tests/test_sphinx/test_sphinx_builds.py @@ -412,7 +412,85 @@ def test_gettext( output = re.sub(r"POT-Creation-Date: [0-9: +-]+", "POT-Creation-Date: ", output) output = re.sub(r"Copyright \(C\) [0-9]{4}", "Copyright (C) XXXX", output) - file_regression.check(output, extension=".pot") + file_regression.check(output, extension=f".sphinx{sphinx.version_info[0]}.pot") + + +@pytest.mark.sphinx( + buildername="html", + srcdir=os.path.join(SOURCE_DIR, "gettext"), + freshenv=True, + confoverrides={"language": "fr", "gettext_compact": False, "locale_dirs": ["."]}, +) +def test_gettext_html( + app, + status, + warning, + get_sphinx_app_doctree, + get_sphinx_app_output, + remove_sphinx_builds, +): + """Test gettext message extraction.""" + app.build() + assert "build succeeded" in status.getvalue() # Build succeeded + warnings = warning.getvalue().strip() + assert warnings == "" + + try: + get_sphinx_app_doctree( + app, + docname="index", + regress=True, + regress_ext=f".sphinx{sphinx.version_info[0]}.xml", + ) + finally: + get_sphinx_app_doctree( + app, + docname="index", + resolve=True, + regress=True, + regress_ext=f".sphinx{sphinx.version_info[0]}.xml", + ) + get_sphinx_app_output( + app, + filename="index.html", + regress_html=True, + regress_ext=f".sphinx{sphinx.version_info[0]}.html", + ) + + +@pytest.mark.sphinx( + buildername="gettext", + srcdir=os.path.join(SOURCE_DIR, "gettext"), + freshenv=True, + confoverrides={ + "gettext_additional_targets": [ + "index", + "literal-block", + "doctest-block", + "raw", + "image", + ], + }, +) +def test_gettext_additional_targets( + app, + status, + warning, + get_sphinx_app_output, + remove_sphinx_builds, + file_regression, +): + """Test gettext message extraction.""" + app.build() + assert "build succeeded" in status.getvalue() # Build succeeded + warnings = warning.getvalue().strip() + assert warnings == "" + + output = get_sphinx_app_output(app, filename="index.pot", buildername="gettext") + output = re.sub(r"POT-Creation-Date: [0-9: +-]+", "POT-Creation-Date: ", output) + output = re.sub(r"Copyright \(C\) [0-9]{4}", "Copyright (C) XXXX", output) + + file_regression.check(output, extension=f".sphinx{sphinx.version_info[0]}.pot") @pytest.mark.sphinx( diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext.pot b/tests/test_sphinx/test_sphinx_builds/test_gettext.sphinx3.pot similarity index 94% rename from tests/test_sphinx/test_sphinx_builds/test_gettext.pot rename to tests/test_sphinx/test_sphinx_builds/test_gettext.sphinx3.pot index 912c90cc..5f767603 100644 --- a/tests/test_sphinx/test_sphinx_builds/test_gettext.pot +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext.sphinx3.pot @@ -63,3 +63,7 @@ msgstr "" #: ../../index.md:28 msgid "Extra ```backticks```" msgstr "" + +#: ../../index.md:55 +msgid "![Fun Fish 1](fun-fish.png)" +msgstr "" diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext.sphinx4.pot b/tests/test_sphinx/test_sphinx_builds/test_gettext.sphinx4.pot new file mode 100644 index 00000000..933b8b6a --- /dev/null +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext.sphinx4.pot @@ -0,0 +1,81 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) XXXX, Executable Book Project +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../index.md:1 +msgid "**bold** text 1" +msgstr "" + +#: ../../index.md:3 +msgid "**bold** text 2" +msgstr "" + +#: ../../index.md:5 +msgid "**bold** text 3" +msgstr "" + +#: ../../index.md:10 +msgid "**bold** text 4" +msgstr "" + +#: ../../index.md:13 +msgid "**bold** text 5" +msgstr "" + +#: ../../index.md:15 +msgid "**bold** text 6" +msgstr "" + +#: ../../index.md:17 +msgid "**bold** text 7" +msgstr "" + +#: ../../index.md:18 +msgid "**bold** text 8" +msgstr "" + +#: ../../index.md:0 +msgid "**bold** text 9" +msgstr "" + +#: ../../index.md:0 +msgid "**bold** text 10" +msgstr "" + +#: ../../index.md:26 +msgid "**bold** text 11" +msgstr "" + +#: ../../index.md:28 +msgid "Extra ```backticks```" +msgstr "" + +#: ../../index.md:55 +msgid "![Fun Fish 1](fun-fish.png)" +msgstr "" + +#: ../../index.md:55 +msgid "Fun Fish 1" +msgstr "" + +#: ../../index.md:57 +msgid "Fun Fish 2" +msgstr "" + +#: ../../index.md:61 +msgid "Fun Fish 3" +msgstr "" diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.sphinx3.pot b/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.sphinx3.pot new file mode 100644 index 00000000..839d877b --- /dev/null +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.sphinx3.pot @@ -0,0 +1,126 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) XXXX, Executable Book Project +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../index.md:1 +msgid "**bold** text 1" +msgstr "" + +#: ../../index.md:3 +msgid "**bold** text 2" +msgstr "" + +#: ../../index.md:5 +msgid "**bold** text 3" +msgstr "" + +#: ../../index.md:10 +msgid "**bold** text 4" +msgstr "" + +#: ../../index.md:13 +msgid "**bold** text 5" +msgstr "" + +#: ../../index.md:15 +msgid "**bold** text 6" +msgstr "" + +#: ../../index.md:17 +msgid "**bold** text 7" +msgstr "" + +#: ../../index.md:18 +msgid "**bold** text 8" +msgstr "" + +#: ../../index.md:0 +msgid "**bold** text 9" +msgstr "" + +#: ../../index.md:0 +msgid "**bold** text 10" +msgstr "" + +#: ../../index.md:24 +msgid "
\n" +"" +msgstr "" + +#: ../../index.md:26 +msgid "**bold** text 11" +msgstr "" + +#: ../../index.md:28 +msgid "Extra ```backticks```" +msgstr "" + +#: ../../index.md:30 +msgid "
\n" +"" +msgstr "" + +#: ../../index.md:32 +msgid "**additional** text 12\n" +"" +msgstr "" + +#: ../../index.md:34 +msgid "**additional** text 13\n" +"" +msgstr "" + +#: ../../index.md:38 +msgid "{\n" +" \"additional\": \"text 14\"\n" +"}\n" +"" +msgstr "" + +#: ../../index.md:44 +msgid "

**additional** text 15

\n" +"" +msgstr "" + +#: ../../index.md:46 +msgid ">>> print('doctest block')\n" +"doctest block\n" +"" +msgstr "" + +#: ../../index.md:51 +msgid "" +msgstr "" + +#: ../../index.md:55 +msgid "![Fun Fish 1](fun-fish.png)" +msgstr "" + +#: ../../index.md:55 +msgid ".. image:: fun-fish.png\n" +" :alt: Fun Fish 1" +msgstr "" + +#: ../../index.md:57 +msgid ".. image:: fun-fish.png\n" +" :alt: Fun Fish 2" +msgstr "" + +#: ../../index.md:61 +msgid ".. image:: fun-fish.png\n" +" :alt: Fun Fish 3" +msgstr "" diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.sphinx4.pot b/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.sphinx4.pot new file mode 100644 index 00000000..11c51d4e --- /dev/null +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_additional_targets.sphinx4.pot @@ -0,0 +1,129 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) XXXX, Executable Book Project +# This file is distributed under the same license as the Python package. +# FIRST AUTHOR , YEAR. +# +#, fuzzy +msgid "" +msgstr "" +"Project-Id-Version: Python \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" +"Last-Translator: FULL NAME \n" +"Language-Team: LANGUAGE \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" + +#: ../../index.md:1 +msgid "**bold** text 1" +msgstr "" + +#: ../../index.md:3 +msgid "**bold** text 2" +msgstr "" + +#: ../../index.md:5 +msgid "**bold** text 3" +msgstr "" + +#: ../../index.md:10 +msgid "**bold** text 4" +msgstr "" + +#: ../../index.md:13 +msgid "**bold** text 5" +msgstr "" + +#: ../../index.md:15 +msgid "**bold** text 6" +msgstr "" + +#: ../../index.md:17 +msgid "**bold** text 7" +msgstr "" + +#: ../../index.md:18 +msgid "**bold** text 8" +msgstr "" + +#: ../../index.md:0 +msgid "**bold** text 9" +msgstr "" + +#: ../../index.md:0 +msgid "**bold** text 10" +msgstr "" + +#: ../../index.md:24 +msgid "
\n" +"" +msgstr "" + +#: ../../index.md:26 +msgid "**bold** text 11" +msgstr "" + +#: ../../index.md:28 +msgid "Extra ```backticks```" +msgstr "" + +#: ../../index.md:30 +msgid "
\n" +"" +msgstr "" + +#: ../../index.md:32 +msgid "**additional** text 12\n" +"" +msgstr "" + +#: ../../index.md:34 +msgid "**additional** text 13\n" +"" +msgstr "" + +#: ../../index.md:38 +msgid "{\n" +" \"additional\": \"text 14\"\n" +"}\n" +"" +msgstr "" + +#: ../../index.md:44 +msgid "

**additional** text 15

\n" +"" +msgstr "" + +#: ../../index.md:46 +msgid ">>> print('doctest block')\n" +"doctest block\n" +"" +msgstr "" + +#: ../../index.md:51 +msgid "" +msgstr "" + +#: ../../index.md:55 +msgid "![Fun Fish 1](fun-fish.png)" +msgstr "" + +#: ../../index.md:55 +msgid "Fun Fish 1" +msgstr "" + +#: ../../index.md:55 +#: ../../index.md:57 +#: ../../index.md:61 +msgid ".. image:: fun-fish.png" +msgstr "" + +#: ../../index.md:57 +msgid "Fun Fish 2" +msgstr "" + +#: ../../index.md:61 +msgid "Fun Fish 3" +msgstr "" diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx3.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx3.xml new file mode 100644 index 00000000..c20ca187 --- /dev/null +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx3.xml @@ -0,0 +1,93 @@ + +
+ + texte 1 en + <strong> + gras + <paragraph> + texte 2 en + <strong> + gras + <block_quote> + <paragraph> + texte 3 en + <strong> + gras + <note> + <paragraph> + texte 4 en + <strong> + gras + <bullet_list> + <list_item> + <paragraph> + texte 5 en + <strong> + gras + <enumerated_list enumtype="arabic" suffix="."> + <list_item> + <paragraph> + texte 6 en + <strong> + gras + <definition_list classes="simple myst"> + <definition_list_item> + <term> + texte 7 en + <strong> + gras + <definition> + <paragraph> + texte 8 en + <strong> + gras + <table align="default" classes="colwidths-auto"> + <tgroup cols="1"> + <colspec colwidth="100.0"> + <thead> + <row> + <entry> + <paragraph> + texte 9 en + <strong> + gras + <tbody> + <row> + <entry> + <paragraph> + texte 10 en + <strong> + gras + <raw format="html" xml:space="preserve"> + <div markdown=1> + <paragraph> + texte 11 en + <strong> + gras + <paragraph> + «  + <literal> + Backtick +  » supplémentaire + <raw format="html" xml:space="preserve"> + </div> + <literal_block language="none" linenos="False" xml:space="preserve"> + **additional** text 12 + <literal_block language="default" linenos="False" xml:space="preserve"> + **additional** text 13 + <literal_block language="json" linenos="False" xml:space="preserve"> + { + "additional": "text 14" + } + <raw format="html" xml:space="preserve"> + <h3>**additional** text 15</h3> + <literal_block language="python" linenos="False" xml:space="preserve"> + >>> print('doctest block') + doctest block + <raw format="html" xml:space="preserve"> + <iframe src="http://sphinx-doc.org"></iframe> + <paragraph> + <image alt="Poisson amusant 1" candidates="{'*': 'poisson-amusant.png'}" uri="poisson-amusant.png"> + <image alt="Fun Fish 2" candidates="{'*': 'fun-fish.png'}" uri="fun-fish.png"> + <figure align="default"> + <image alt="Fun Fish 3" candidates="{'*': 'fun-fish.png'}" uri="fun-fish.png"> diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml new file mode 100644 index 00000000..4fd99c82 --- /dev/null +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml @@ -0,0 +1,93 @@ +<document source="index.md"> + <section classes="tex2jax_ignore mathjax_ignore" ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras"> + <title> + texte 1 en + <strong> + gras + <paragraph> + texte 2 en + <strong> + gras + <block_quote> + <paragraph> + texte 3 en + <strong> + gras + <note> + <paragraph> + texte 4 en + <strong> + gras + <bullet_list> + <list_item> + <paragraph> + texte 5 en + <strong> + gras + <enumerated_list enumtype="arabic" suffix="."> + <list_item> + <paragraph> + texte 6 en + <strong> + gras + <definition_list classes="simple myst"> + <definition_list_item> + <term> + texte 7 en + <strong> + gras + <definition> + <paragraph> + texte 8 en + <strong> + gras + <table classes="colwidths-auto"> + <tgroup cols="1"> + <colspec colwidth="100.0"> + <thead> + <row> + <entry> + <paragraph> + texte 9 en + <strong> + gras + <tbody> + <row> + <entry> + <paragraph> + texte 10 en + <strong> + gras + <raw format="html" xml:space="preserve"> + <div markdown=1> + <paragraph> + texte 11 en + <strong> + gras + <paragraph> + «  + <literal> + Backtick +  » supplémentaire + <raw format="html" xml:space="preserve"> + </div> + <literal_block language="none" linenos="False" xml:space="preserve"> + **additional** text 12 + <literal_block language="default" linenos="False" xml:space="preserve"> + **additional** text 13 + <literal_block language="json" linenos="False" xml:space="preserve"> + { + "additional": "text 14" + } + <raw format="html" xml:space="preserve"> + <h3>**additional** text 15</h3> + <literal_block language="python" linenos="False" xml:space="preserve"> + >>> print('doctest block') + doctest block + <raw format="html" xml:space="preserve"> + <iframe src="http://sphinx-doc.org"></iframe> + <paragraph> + <image alt="Poisson amusant 1" candidates="{'*': 'poisson-amusant.png'}" uri="poisson-amusant.png"> + <image alt="Poisson amusant 2" candidates="{'*': 'fun-fish.png'}" uri="fun-fish.png"> + <figure> + <image alt="Poisson amusant 3" candidates="{'*': 'fun-fish.png'}" uri="fun-fish.png"> diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.html b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.html new file mode 100644 index 00000000..26425e99 --- /dev/null +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.html @@ -0,0 +1,162 @@ +<div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body" role="main"> + <div class="tex2jax_ignore mathjax_ignore section" id="bold-text-1"> + <h1> + texte 1 en + <strong> + gras + </strong> + <a class="headerlink" href="#bold-text-1" title="Lien permanent vers ce titre"> + ¶ + </a> + </h1> + <p> + texte 2 en + <strong> + gras + </strong> + </p> + <blockquote> + <div> + <p> + texte 3 en + <strong> + gras + </strong> + </p> + </div> + </blockquote> + <div class="admonition note"> + <p class="admonition-title"> + Note + </p> + <p> + texte 4 en + <strong> + gras + </strong> + </p> + </div> + <ul class="simple"> + <li> + <p> + texte 5 en + <strong> + gras + </strong> + </p> + </li> + </ul> + <ol class="arabic simple"> + <li> + <p> + texte 6 en + <strong> + gras + </strong> + </p> + </li> + </ol> + <dl class="simple myst"> + <dt> + texte 7 en + <strong> + gras + </strong> + </dt> + <dd> + <p> + texte 8 en + <strong> + gras + </strong> + </p> + </dd> + </dl> + <table class="colwidths-auto docutils align-default"> + <thead> + <tr class="row-odd"> + <th class="head"> + <p> + texte 9 en + <strong> + gras + </strong> + </p> + </th> + </tr> + </thead> + <tbody> + <tr class="row-even"> + <td> + <p> + texte 10 en + <strong> + gras + </strong> + </p> + </td> + </tr> + </tbody> + </table> + <div markdown="1"> + <p> + texte 11 en + <strong> + gras + </strong> + </p> + <p> + « + <code class="docutils literal notranslate"> + <span class="pre"> + Backtick + </span> + </code> + » supplémentaire + </p> + </div> + <div class="highlight-none notranslate"> + <div class="highlight"> + <pre><span></span>**additional** text 12 +</pre> + </div> + </div> + <div class="highlight-default notranslate"> + <div class="highlight"> + <pre><span></span><span class="o">**</span><span class="n">additional</span><span class="o">**</span> <span class="n">text</span> <span class="mi">13</span> +</pre> + </div> + </div> + <div class="highlight-json notranslate"> + <div class="highlight"> + <pre><span></span><span class="p">{</span> + <span class="nt">"additional"</span><span class="p">:</span> <span class="s2">"text 14"</span> +<span class="p">}</span> +</pre> + </div> + </div> + <h3> + **additional** text 15 + </h3> + <div class="highlight-python notranslate"> + <div class="highlight"> + <pre><span></span><span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="s1">'doctest block'</span><span class="p">)</span> +<span class="go">doctest block</span> +</pre> + </div> + </div> + <iframe src="http://sphinx-doc.org"> + </iframe> + <p> + <img alt="Poisson amusant 1" src="_images/poisson-amusant.png"/> + </p> + <img alt="Fun Fish 2" src="_images/fun-fish.png"/> + <div class="figure align-default"> + <img alt="Fun Fish 3" src="_images/fun-fish.png"/> + </div> + </div> + </div> + </div> +</div> diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.xml new file mode 100644 index 00000000..3e12b40e --- /dev/null +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.xml @@ -0,0 +1,93 @@ +<document source="index.md"> + <section classes="tex2jax_ignore mathjax_ignore" ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras"> + <title> + texte 1 en + <strong> + gras + <paragraph> + texte 2 en + <strong> + gras + <block_quote> + <paragraph> + texte 3 en + <strong> + gras + <note> + <paragraph> + texte 4 en + <strong> + gras + <bullet_list> + <list_item> + <paragraph> + texte 5 en + <strong> + gras + <enumerated_list enumtype="arabic" suffix="."> + <list_item> + <paragraph> + texte 6 en + <strong> + gras + <definition_list classes="simple myst"> + <definition_list_item> + <term> + texte 7 en + <strong> + gras + <definition> + <paragraph> + texte 8 en + <strong> + gras + <table align="default" classes="colwidths-auto"> + <tgroup cols="1"> + <colspec colwidth="100.0"> + <thead> + <row> + <entry> + <paragraph> + texte 9 en + <strong> + gras + <tbody> + <row> + <entry> + <paragraph> + texte 10 en + <strong> + gras + <raw format="html" xml:space="preserve"> + <div markdown=1> + <paragraph> + texte 11 en + <strong> + gras + <paragraph> + «  + <literal> + Backtick +  » supplémentaire + <raw format="html" xml:space="preserve"> + </div> + <literal_block language="none" xml:space="preserve"> + **additional** text 12 + <literal_block language="default" xml:space="preserve"> + **additional** text 13 + <literal_block language="json" xml:space="preserve"> + { + "additional": "text 14" + } + <raw format="html" xml:space="preserve"> + <h3>**additional** text 15</h3> + <literal_block language="python" xml:space="preserve"> + >>> print('doctest block') + doctest block + <raw format="html" xml:space="preserve"> + <iframe src="http://sphinx-doc.org"></iframe> + <paragraph> + <image alt="Poisson amusant 1" candidates="{'*': 'poisson-amusant.png'}" uri="poisson-amusant.png"> + <image alt="Fun Fish 2" candidates="{'*': 'fun-fish.png'}" uri="fun-fish.png"> + <figure align="default"> + <image alt="Fun Fish 3" candidates="{'*': 'fun-fish.png'}" uri="fun-fish.png"> diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.html b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.html new file mode 100644 index 00000000..adad986e --- /dev/null +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.html @@ -0,0 +1,162 @@ +<div class="documentwrapper"> + <div class="bodywrapper"> + <div class="body" role="main"> + <section class="tex2jax_ignore mathjax_ignore" id="bold-text-1"> + <h1> + texte 1 en + <strong> + gras + </strong> + <a class="headerlink" href="#bold-text-1" title="Lien permanent vers ce titre"> + ¶ + </a> + </h1> + <p> + texte 2 en + <strong> + gras + </strong> + </p> + <blockquote> + <div> + <p> + texte 3 en + <strong> + gras + </strong> + </p> + </div> + </blockquote> + <div class="admonition note"> + <p class="admonition-title"> + Note + </p> + <p> + texte 4 en + <strong> + gras + </strong> + </p> + </div> + <ul class="simple"> + <li> + <p> + texte 5 en + <strong> + gras + </strong> + </p> + </li> + </ul> + <ol class="arabic simple"> + <li> + <p> + texte 6 en + <strong> + gras + </strong> + </p> + </li> + </ol> + <dl class="simple myst"> + <dt> + texte 7 en + <strong> + gras + </strong> + </dt> + <dd> + <p> + texte 8 en + <strong> + gras + </strong> + </p> + </dd> + </dl> + <table class="colwidths-auto docutils align-default"> + <thead> + <tr class="row-odd"> + <th class="head"> + <p> + texte 9 en + <strong> + gras + </strong> + </p> + </th> + </tr> + </thead> + <tbody> + <tr class="row-even"> + <td> + <p> + texte 10 en + <strong> + gras + </strong> + </p> + </td> + </tr> + </tbody> + </table> + <div markdown="1"> + <p> + texte 11 en + <strong> + gras + </strong> + </p> + <p> + « + <code class="docutils literal notranslate"> + <span class="pre"> + Backtick + </span> + </code> + » supplémentaire + </p> + </div> + <div class="highlight-none notranslate"> + <div class="highlight"> + <pre><span></span>**additional** text 12 +</pre> + </div> + </div> + <div class="highlight-default notranslate"> + <div class="highlight"> + <pre><span></span><span class="o">**</span><span class="n">additional</span><span class="o">**</span> <span class="n">text</span> <span class="mi">13</span> +</pre> + </div> + </div> + <div class="highlight-json notranslate"> + <div class="highlight"> + <pre><span></span><span class="p">{</span> + <span class="nt">"additional"</span><span class="p">:</span> <span class="s2">"text 14"</span> +<span class="p">}</span> +</pre> + </div> + </div> + <h3> + **additional** text 15 + </h3> + <div class="highlight-python notranslate"> + <div class="highlight"> + <pre><span></span><span class="gp">>>> </span><span class="nb">print</span><span class="p">(</span><span class="s1">'doctest block'</span><span class="p">)</span> +<span class="go">doctest block</span> +</pre> + </div> + </div> + <iframe src="http://sphinx-doc.org"> + </iframe> + <p> + <img alt="Poisson amusant 1" src="_images/poisson-amusant.png"/> + </p> + <img alt="Poisson amusant 2" src="_images/fun-fish.png"/> + <figure class="align-default"> + <img alt="Poisson amusant 3" src="_images/fun-fish.png"/> + </figure> + </section> + </div> + </div> +</div> diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml new file mode 100644 index 00000000..5b6f5573 --- /dev/null +++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml @@ -0,0 +1,93 @@ +<document source="index.md"> + <section classes="tex2jax_ignore mathjax_ignore" ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras"> + <title> + texte 1 en + <strong> + gras + <paragraph> + texte 2 en + <strong> + gras + <block_quote> + <paragraph> + texte 3 en + <strong> + gras + <note> + <paragraph> + texte 4 en + <strong> + gras + <bullet_list> + <list_item> + <paragraph> + texte 5 en + <strong> + gras + <enumerated_list enumtype="arabic" suffix="."> + <list_item> + <paragraph> + texte 6 en + <strong> + gras + <definition_list classes="simple myst"> + <definition_list_item> + <term> + texte 7 en + <strong> + gras + <definition> + <paragraph> + texte 8 en + <strong> + gras + <table classes="colwidths-auto"> + <tgroup cols="1"> + <colspec colwidth="100.0"> + <thead> + <row> + <entry> + <paragraph> + texte 9 en + <strong> + gras + <tbody> + <row> + <entry> + <paragraph> + texte 10 en + <strong> + gras + <raw format="html" xml:space="preserve"> + <div markdown=1> + <paragraph> + texte 11 en + <strong> + gras + <paragraph> + «  + <literal> + Backtick +  » supplémentaire + <raw format="html" xml:space="preserve"> + </div> + <literal_block language="none" xml:space="preserve"> + **additional** text 12 + <literal_block language="default" xml:space="preserve"> + **additional** text 13 + <literal_block language="json" xml:space="preserve"> + { + "additional": "text 14" + } + <raw format="html" xml:space="preserve"> + <h3>**additional** text 15</h3> + <literal_block language="python" xml:space="preserve"> + >>> print('doctest block') + doctest block + <raw format="html" xml:space="preserve"> + <iframe src="http://sphinx-doc.org"></iframe> + <paragraph> + <image alt="Poisson amusant 1" candidates="{'*': 'poisson-amusant.png'}" uri="poisson-amusant.png"> + <image alt="Poisson amusant 2" candidates="{'*': 'fun-fish.png'}" uri="fun-fish.png"> + <figure> + <image alt="Poisson amusant 3" candidates="{'*': 'fun-fish.png'}" uri="fun-fish.png">