From e4bf98b5772b56849beee6eabb756654df7c5a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Mon, 17 Jul 2023 12:51:30 +0200 Subject: [PATCH] do not rely on rst parser only --- .github/workflows/ci.yml | 2 ++ test/unit/conf.py | 6 +++--- test/unit/{index.rst => index.md} | 2 ++ test/unit/{method.rst => method.md} | 2 ++ test/unit/{ns.rst => ns.md} | 2 ++ test/unit/requirements.txt | 2 ++ 6 files changed, 13 insertions(+), 3 deletions(-) rename test/unit/{index.rst => index.md} (80%) rename test/unit/{method.rst => method.md} (84%) rename test/unit/{ns.rst => ns.md} (98%) create mode 100644 test/unit/requirements.txt diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 255928e..933c36f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -33,6 +33,7 @@ jobs: run: | python -m pip install --upgrade pip pip install -r requirements.txt + pip install -r test/unit/requirements.txt pip install . - name: Build Test @@ -66,6 +67,7 @@ jobs: git add . -N && git diff --exit-code - name: Push Unit Changes + if: failure() uses: stefanzweifel/git-auto-commit-action@v4 with: branch: ${{ github.head_ref || github.ref_name }}.changes diff --git a/test/unit/conf.py b/test/unit/conf.py index d081966..2487b29 100644 --- a/test/unit/conf.py +++ b/test/unit/conf.py @@ -4,14 +4,14 @@ extensions = [ 'sphinxcontrib.phpdomain', + 'myst_parser', ] -source_suffix = '.rst' +myst_enable_extensions = ['colon_fence'] +source_suffix = '.rst' master_doc = 'index' exclude_patterns = ['_build'] -pygments_style = 'sphinx' - html_theme = 'default' diff --git a/test/unit/index.rst b/test/unit/index.md similarity index 80% rename from test/unit/index.rst rename to test/unit/index.md index 0a71fcf..e6b52b8 100644 --- a/test/unit/index.rst +++ b/test/unit/index.md @@ -1,3 +1,4 @@ +```{eval-rst} Test: Build all files ===================== @@ -5,3 +6,4 @@ Test: Build all files :glob: ** +``` diff --git a/test/unit/method.rst b/test/unit/method.md similarity index 84% rename from test/unit/method.rst rename to test/unit/method.md index 429cdf5..7436a61 100644 --- a/test/unit/method.rst +++ b/test/unit/method.md @@ -1,5 +1,7 @@ +```{eval-rst} .. php:method:: Foo::simplify() Simplify expression. :param array $args: Associative array +``` diff --git a/test/unit/ns.rst b/test/unit/ns.md similarity index 98% rename from test/unit/ns.rst rename to test/unit/ns.md index dfd267d..4ac3319 100644 --- a/test/unit/ns.rst +++ b/test/unit/ns.md @@ -1,3 +1,4 @@ +```{eval-rst} Simple NS ========= @@ -61,3 +62,4 @@ Cross linking:: - :php:meth:`X2::simplify` - :php:meth:`A2::simplify` +``` diff --git a/test/unit/requirements.txt b/test/unit/requirements.txt new file mode 100644 index 0000000..98a3c62 --- /dev/null +++ b/test/unit/requirements.txt @@ -0,0 +1,2 @@ +sphinx +myst-parser