Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: executablebooks/MyST-Parser
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.18.1
Choose a base ref
...
head repository: executablebooks/MyST-Parser
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.19.0
Choose a head ref

Commits on Dec 5, 2022

  1. Copy the full SHA
    11756a1 View commit details
  2. [pre-commit.ci] pre-commit autoupdate (#625)

    Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
    pre-commit-ci[bot] and chrisjsewell authored Dec 5, 2022
    Copy the full SHA
    e5c844d View commit details
  3. Copy the full SHA
    c2f0416 View commit details

Commits on Jan 4, 2023

  1. ✨ NEW: Add inventory reader and CLI (#656)

    Extracted from sphinx for use independently.
    chrisjsewell authored Jan 4, 2023
    Copy the full SHA
    386fe2d View commit details
  2. Copy the full SHA
    8ea5398 View commit details
  3. 🐛 FIX: Remove unnecessary assert (#659)

    Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
    Fixes #657
    n-peugnet authored Jan 4, 2023
    Copy the full SHA
    9a4de68 View commit details
  4. ✨ NEW: suppress warnings in docutils (#655)

    with `myst_suppress_warnings` option, which works the same as sphinx `suppress_warnings`.
    chrisjsewell authored Jan 4, 2023
    Copy the full SHA
    1b84a5b View commit details

Commits on Jan 5, 2023

  1. ✨ NEW: Add attrs_inline extension (#654)

    By adding `"attrs_inline"` to `myst_enable_extensions` (in the sphinx `conf.py`),
    you can enable parsing of inline attributes after certain inline syntaxes.
    This is adapted from [djot inline attributes](https://htmlpreview.github.io/?https://github.com/jgm/djot/blob/master/doc/syntax.html#inline-attributes),
    and also related to [pandoc bracketed spans](https://pandoc.org/MANUAL.html#extension-bracketed_spans).
    
    This extension replaces `"attrs_image"`, which is still present, but deprecated.
    chrisjsewell authored Jan 5, 2023
    Copy the full SHA
    bf56662 View commit details
  2. 1
    Copy the full SHA
    2a206a8 View commit details
  3. Copy the full SHA
    23ae135 View commit details

Commits on Jan 6, 2023

  1. Copy the full SHA
    936cba7 View commit details
  2. Copy the full SHA
    2a5bd61 View commit details
  3. Copy the full SHA
    74b21f7 View commit details
  4. Copy the full SHA
    ebb5b9f View commit details

Commits on Jan 8, 2023

  1. 👌‼️ Allow meta_html/substitutions in docutils (#672)

    Refactors `myst_parser/parsers/docutils_.py` slightly,
    by removing `DOCUTILS_EXCLUDED_ARGS`,
    and removing the `excluded` argument from `create_myst_settings_spec` and `create_myst_config`.
    chrisjsewell authored Jan 8, 2023
    Copy the full SHA
    66881ef View commit details

Commits on Jan 10, 2023

  1. Copy the full SHA
    38559cb View commit details
  2. Copy the full SHA
    4904a4f View commit details
  3. 🔧 ci(deps): setup dependabot (#669)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
    3 people authored Jan 10, 2023
    Copy the full SHA
    797af5f View commit details

Commits on Jan 11, 2023

  1. 👌 IMPROVE: Allow for heading anchor links in docutils (#678)

    This aligns the treatment of `[](#target)` style links for docutils with sphinx, such that they are linked to a heading slug.
    
    The core behaviour for sphinx is not changed,
    except that failed reference resolution
    now emits a `myst.xref_missing` warning (as opposed to a `std.ref` one), with a clearer warning message. Also on failure, the reference is still created,
    for people who wish to suppress the warning (see e.g. #677)
    chrisjsewell authored Jan 11, 2023
    Copy the full SHA
    8daa00b View commit details
  2. Copy the full SHA
    01ca355 View commit details
  3. Copy the full SHA
    505ac77 View commit details

Commits on Jan 12, 2023

  1. ⬆️ Update pytest requirement from <7,>=6 to >=7,<8 (#674)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
    dependabot[bot] and chrisjsewell authored Jan 12, 2023
    Copy the full SHA
    3a7563f View commit details
  2. ⬆️ Update sphinxext-opengraph requirement from ~=0.6.3 to ~=0.7.5 (#676)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    dependabot[bot] authored Jan 12, 2023
    Copy the full SHA
    dff96c4 View commit details
  3. Copy the full SHA
    aa3f04d View commit details
  4. 👌 Change non-fatal directive parsing errors to warnings (#682)

    For non-fatal errors, such as;
    faulty options syntax, unknown option keys, and invalid option values,
    a warning is raised, but the directive is still run (without the erroneous options).
    The warning is given the `myst.directive_parse` type, which can be suppressed.
    chrisjsewell authored Jan 12, 2023
    Copy the full SHA
    ee4c29d View commit details

Commits on Jan 14, 2023

  1. Copy the full SHA
    7c9eec1 View commit details

Commits on Jan 15, 2023

  1. Copy the full SHA
    9d1869d View commit details
  2. Copy the full SHA
    2764cd2 View commit details

Commits on Jan 17, 2023

  1. Copy the full SHA
    c31ea80 View commit details
  2. 👌 Change missing directive/role errors to warnings (#687)

    If an unknown directive/role name is encountered,
    then a warning is emitted with the `myst.directive_unknown` or `myst.role_unknown` type,
    which can be suppressed.
    chrisjsewell authored Jan 17, 2023
    Copy the full SHA
    84c320b View commit details

Commits on Feb 11, 2023

  1. ✨ NEW: extended URL link customisation (#695)

    The `myst_url_schemes` configuration has been extended, in a back-compatible manner,
    to also allow writing as a dictionary, with customisations of the link URL/text, via templates, such as:
    
    ```python
    myst_url_schemes = {
        "http": None,
    	"https": None,
        "wiki": "https://en.wikipedia.org/wiki/{{path}}#{{fragment}}",
        "gh-issue": {
            "url": "https://github.com/executablebooks/MyST-Parser/issue/{{path}}#{{fragment}}",
            "title": "Issue #{{path}}",
            "classes": ["github"],
        },
    }
    ```
    
    Allowing for `<gh-issue:639>` and `[URI](wiki:Uniform_Resource_Identifier#URI_references)`.
    
    The `inline_attrs` extension also allows for specific links to be marked as external, using `[](my-link){.external}`.
    chrisjsewell authored Feb 11, 2023
    Copy the full SHA
    879cfca View commit details
  2. 👌 IMPROVE: Allow heading_slug_func to be a string (#696)

    `myst_heading_slug_func` can now also be set to a string,
    which will be interpreted as an import path to a function,
    e.g. `myst_heading_slug_func = "mypackage.mymodule.slugify"`.
    chrisjsewell authored Feb 11, 2023
    Copy the full SHA
    d743992 View commit details
  3. ⬆️ Update pre-commit requirement from ~=2.12 to ~=3.0 (#693)

    Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
    Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
    dependabot[bot] and chrisjsewell authored Feb 11, 2023
    Copy the full SHA
    6e32143 View commit details

Commits on Feb 19, 2023

  1. ✨ NEW: Add attrs_block extension (#703)

    By adding `"attrs_block"` to `myst_enable_extensions` (in the sphinx `conf.py`), you can enable parsing of inline attributes after certain inline syntaxes. This is adapted from [djot block attributes](https://htmlpreview.github.io/?https://github.com/jgm/djot/blob/master/doc/syntax.html#block-attributes)
    chrisjsewell authored Feb 19, 2023
    Copy the full SHA
    cce4684 View commit details
  2. 📚 DOCS: Use sphinx-autodoc2 for API (#704)

    This will allow moving source docstrings to use MyST instead of rST 🎉
    chrisjsewell authored Feb 19, 2023
    Copy the full SHA
    fc59f3b View commit details
  3. Copy the full SHA
    41a5061 View commit details

Commits on Feb 20, 2023

  1. 👌 IMPROVE: Allow setting {#id} on headings (#706)

    For use with the `attrs_block` extension.
    This just moves around the logic for implicit heading anchors a bit (without changing anything user facing), to allow distinguishing between explicit and implicit heading ids.
    chrisjsewell authored Feb 20, 2023
    Copy the full SHA
    c8b6fc3 View commit details
  2. 📚 DOCS: fix tip CSS (#708)

    Minor fix to stop the hover tips getting heading numbers
    chrisjsewell authored Feb 20, 2023
    Copy the full SHA
    f02d40f View commit details

Commits on Feb 21, 2023

  1. 👌 Enhance [](#id) references (#707)

    This PR moves myst-parser in the direction of jupyter-book/myst-enhancement-proposals#10, in a relatively back compatible manner, and in a way that supports both docutils and sphinx.
    
    It expands the capability of `[](#id)` to more than just linking to heading slugs, with the order of specificity being:
    
    1. If it matches a local (to that document) "explicit" `std:ref` target, then link to that and stop
       - Note, currently only `std:ref` domain/type are supported, e.g. not `math` etc. That's more difficult and can come later
    2. If it matches a local (to that document) "implicit" heading slug, then link to that and stop
    3. If using docutils (i.e. single-page) build, then stop here and emit a `myst.xref_missing` warning
    4. If using sphinx then create a `pending_xref` node, and hand-off to sphinx's "any" resolver, which takes effect once all documents have been read:
        - This first tries to resolve against a local (to the project) reference and, if matching, stops
        - Otherwise also try to match against any intersphinx reference
        - Otherwise emit a ~~`myst.ref`~~ `myst.xref_missing`  warning
     
    If the text is explicit, e.g. `[text](#id)`, that text is used, otherwise a determination of implicit text is attempted, e.g. based on the section title or figure caption.
    chrisjsewell authored Feb 21, 2023
    Copy the full SHA
    1096e52 View commit details
  2. 👌 Handling of nested headers (#711)

    For the longest time, nested headers in myst-parser have been a pain, particularly in things like admonitions
    
    In Markdown (and HTML) headings are allowed "anywhere", for example:
    
    ```markdown
    > # Heading 1
    ## Heading 2
    
    Paragraph
    ```
    
    Is rendered as:
    
    ```html
    <blockquote>
        <h1>Heading 1</h1>
    </blockquote>
    <h2>Heading 2</h2>
    <p>Paragraph</p>
    ```
    
    However, because docutils/sphinx treats headers as nested sections, this becomes problematic
    
    ```xml
    <blockquote>
       <section>
    		<title>
                Heading 1
    <section>
       <title>
          Heading 2
       <paragraph>
          Paragraph
    ```
    
    Which sphinx cannot resolve the ToC tree from etc
    
    This PR fixes this, by identifying if a heading is inside another component and instead outputting it as a "non-structural" rubric node
    
    ```xml
    <blockquote>
       <rubric level=1>
    		Heading 1
    <section>
        <title>
          Heading 2
       <paragraph>
          Paragraph
    ```
    
    Natively, docutils/sphinx does not deal with the "level" key in the rubric,
    so here we also override the rubric HTML renderer to correctly output a `<h>` element, if "level" is present, to retrieve the desired:
    
    ```html
    <blockquote>
        <h1>Heading 1</h1>
    </blockquote>
    <h2>Heading 2</h2>
    <p>Paragraph</p>
    ```
    
    There is no longer any warning of nested headers, since this is the intended behaviour
    
    To clarify, the logic is now:
    
    - A section can only be a child of the root document, or another section
    - If a header token is encountered, with a child that is not one of these, then it is added as a rubric
    - Otherwise a new section is created, and the heading is added as a title, which is a child of the section
    chrisjsewell authored Feb 21, 2023
    Copy the full SHA
    ac111ea View commit details
  3. 👌 Improve: Non-directive colon-fences (#713)

    At present, colon fences without a directive specified (e.g. `:::{note}`) are treated as code bocks 
    
    ```
    :::name
    Some text
    :::
    ```
    
    ```xml
    <code language=name>
        Some text
    ```
    
    In keeping with the purpose of these block, as containers for nested MyST content, they are now converted to:
    
    ```xml
    <div class=name>
       <paragraph>
          Some text
    ```
    
    This is also in keeping with the original pandoc/djot inspiration <https://htmlpreview.github.io/?https://github.com/jgm/djot/blob/master/doc/syntax.html#div>
    chrisjsewell authored Feb 21, 2023
    Copy the full SHA
    6b3fc19 View commit details
  4. 🐛 FIX: colon_fence wrapping (#714)

    Minor fix to the last commit 😅
    chrisjsewell authored Feb 21, 2023
    Copy the full SHA
    4cac732 View commit details

Commits on Feb 22, 2023

  1. 🐛 FIX encoded URL ID references (#715)

    For example `<#name with spaces>` will be encoded as `#name%20with%20spaces`, so we need to decode before resolving the reference.
    chrisjsewell authored Feb 22, 2023
    Copy the full SHA
    2902e07 View commit details
  2. 👌 Improve [](#target) resolution warnings (#716)

    Previously, if `[](#target)` matched nothing locally, but multiple items in intersphinx inventories, then no warning would be logged, and the first match silently used.
    Resolution of intersphinx now proceeds (if no local matches found) the same as for `[](inv:#target)`, such that a `myst.iref_ambiguous` warning is emitted in this case (the first match is then still used).
    
    Warnings coming from resolution of `[](#target)` can also now be "individually" turned off using https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-nitpick_ignore, e.g. `nitpick_ignore = [("myst", "target")]`
    chrisjsewell authored Feb 22, 2023
    Copy the full SHA
    7ecf1bb View commit details

Commits on Feb 23, 2023

  1. 👌 Improve: Apply implicit targets to nested headings (#718)

    This commit builds on ac111ea,
    to allow for implicit heading slugs to be applied also to nested headings,
    i.e. so they can be referenced in Markdown links
    chrisjsewell authored Feb 23, 2023
    Copy the full SHA
    7fe6411 View commit details
  2. ✨ New: add .glossary for attrs_block (#719)

    MyST follows Pandoc definition-lists, to denote lists of term -> definition.
    
    ```markdown
    Term 1
    : Definition
    
    Term 2
    : Definition
    ```
    
    It should be easy for users to turn one of these lists into a glossary,
    where each term is uniquely referenceable across the entire project.
    
    This commit, allows this, via adding a `.glossary` class to the list:
    
    ````
    {.glossary}
    Term 1
    : Definition
    
    Term 2
    : Definition
    ````
    chrisjsewell authored Feb 23, 2023
    Copy the full SHA
    7692f87 View commit details

Commits on Mar 1, 2023

  1. Copy the full SHA
    1bd0def View commit details
  2. 🔧 Minor update

    chrisjsewell committed Mar 1, 2023
    Copy the full SHA
    f791cea View commit details
  3. Copy the full SHA
    de00c89 View commit details
  4. Copy the full SHA
    37a830d View commit details
Showing with 7,809 additions and 3,299 deletions.
  1. +19 −0 .github/dependabot.yml
  2. +76 −0 .github/workflows/test-formats.yml
  3. +20 −22 .github/workflows/tests.yml
  4. +10 −13 .pre-commit-config.yaml
  5. +1 −1 .readthedocs.yml
  6. +161 −55 CHANGELOG.md
  7. +2 −2 codecov.yml
  8. +0 −24 docs/_static/custom.css
  9. +80 −0 docs/_static/local.css
  10. +0 −96 docs/api/reference.rst
  11. +142 −66 docs/conf.py
  12. +112 −3 docs/configuration.md
  13. +8 −1 docs/docutils.md
  14. +12 −87 docs/faq/index.md
  15. +1 −1 docs/faq/snippets/include-md.md
  16. +33 −8 docs/index.md
  17. +130 −146 docs/intro.md
  18. +129 −0 docs/live-preview.md
  19. +96 −0 docs/live_preview.py
  20. +132 −0 docs/syntax/admonitions.md
  21. +251 −0 docs/syntax/code_and_apis.md
  22. +440 −0 docs/syntax/cross-referencing.md
  23. +3 −1 docs/syntax/example.txt
  24. +7 −0 docs/syntax/examples/content_child1.md
  25. +5 −0 docs/syntax/examples/content_child2.md
  26. +15 −0 docs/syntax/examples/example.py
  27. +4 −0 docs/syntax/examples/example_relative_include.txt
  28. +38 −0 docs/syntax/glossary.md
  29. +156 −0 docs/syntax/images_and_figures.md
  30. +93 −0 docs/syntax/math.md
  31. +331 −387 docs/syntax/optional.md
  32. +199 −0 docs/syntax/organising_content.md
  33. +1 −1 docs/syntax/reference.md
  34. +53 −192 docs/syntax/roles-and-directives.md
  35. +0 −491 docs/syntax/syntax.md
  36. +200 −0 docs/syntax/tables.md
  37. +294 −0 docs/syntax/typography.md
  38. +6 −3 myst_parser/__init__.py
  39. +12 −0 myst_parser/_compat.py
  40. +261 −14 myst_parser/_docs.py
  41. +5 −2 myst_parser/cli.py
  42. +6 −6 myst_parser/config/dc_validators.py
  43. +204 −41 myst_parser/config/main.py
  44. +3 −1 myst_parser/docutils_.py
  45. +504 −0 myst_parser/inventory.py
  46. +8 −1 myst_parser/mdit_to_docutils/__init__.py
  47. +720 −234 myst_parser/mdit_to_docutils/base.py
  48. +7 −7 myst_parser/mdit_to_docutils/html_to_nodes.py
  49. +137 −142 myst_parser/mdit_to_docutils/sphinx_.py
  50. +145 −0 myst_parser/mdit_to_docutils/transforms.py
  51. +0 −36 myst_parser/mdit_to_docutils/utils.py
  52. +32 −30 myst_parser/mocking.py
  53. +69 −38 myst_parser/parsers/directives.py
  54. +280 −40 myst_parser/parsers/docutils_.py
  55. +13 −10 myst_parser/parsers/mdit.py
  56. +5 −4 myst_parser/parsers/parse_html.py
  57. +7 −2 myst_parser/parsers/sphinx_.py
  58. +3 −1 myst_parser/sphinx_.py
  59. +2 −4 myst_parser/sphinx_ext/directives.py
  60. +40 −4 myst_parser/sphinx_ext/main.py
  61. +232 −116 myst_parser/sphinx_ext/myst_refs.py
  62. +119 −0 myst_parser/warnings_.py
  63. +33 −11 pyproject.toml
  64. +5 −0 tests/static/objects_v1.inv
  65. BIN tests/static/objects_v2.inv
  66. +3 −5 tests/{test_cli.py → test_anchors.py}
  67. +16 −2 tests/test_docutils.py
  68. +65 −0 tests/test_inventory.py
  69. +13 −0 tests/test_inventory/test_inv_cli_v1.yaml
  70. +25 −0 tests/test_inventory/test_inv_cli_v2_options0_.yaml
  71. +25 −0 tests/test_inventory/test_inv_cli_v2_options1_.yaml
  72. +9 −0 tests/test_inventory/test_inv_cli_v2_options2_.yaml
  73. +9 −0 tests/test_inventory/test_inv_cli_v2_options3_.yaml
  74. +13 −0 tests/test_inventory/test_inv_cli_v2_options4_.yaml
  75. +9 −0 tests/test_inventory/test_inv_filter.yml
  76. +36 −0 tests/test_inventory/test_inv_filter_wildcard.yml
  77. +77 −0 tests/test_renderers/fixtures/attributes.md
  78. +28 −0 tests/test_renderers/fixtures/containers.md
  79. +7 −9 tests/test_renderers/fixtures/directive_options.md
  80. +77 −0 tests/test_renderers/fixtures/directive_parsing.txt
  81. +205 −0 tests/test_renderers/fixtures/docutil_link_resolution.md
  82. +12 −35 tests/test_renderers/fixtures/docutil_syntax_elements.md
  83. +7 −0 tests/test_renderers/fixtures/docutil_syntax_extensions.txt
  84. +2 −3 tests/test_renderers/fixtures/mock_include_errors.md
  85. +305 −11 tests/test_renderers/fixtures/myst-config.txt
  86. +8 −10 tests/test_renderers/fixtures/reporter_warnings.md
  87. +231 −0 tests/test_renderers/fixtures/sphinx_link_resolution.md
  88. +15 −41 tests/test_renderers/fixtures/sphinx_syntax_elements.md
  89. +39 −10 tests/test_renderers/test_fixtures_docutils.py
  90. +46 −0 tests/test_renderers/test_fixtures_sphinx.py
  91. +7 −2 tests/test_renderers/test_include_directive.py
  92. +14 −4 tests/test_renderers/test_myst_config.py
  93. +6 −1 tests/test_renderers/test_myst_refs.py
  94. +1 −1 tests/test_renderers/test_myst_refs/doc_with_extension.xml
  95. +3 −0 tests/test_renderers/test_myst_refs/duplicate.xml
  96. +6 −1 tests/test_renderers/test_myst_refs/missing.xml
  97. +19 −14 tests/test_renderers/test_parse_directives.py
  98. +3 −0 tests/test_sphinx/conftest.py
  99. +2 −0 tests/test_sphinx/sourcedirs/extended_syntaxes/conf.py
  100. +13 −0 tests/test_sphinx/sourcedirs/extended_syntaxes/index.md
  101. +7 −1 tests/test_sphinx/sourcedirs/references/conf.py
  102. +16 −1 tests/test_sphinx/sourcedirs/references/index.md
  103. +6 −0 tests/test_sphinx/sourcedirs/references/objects.inv
  104. +24 −10 tests/test_sphinx/test_sphinx_builds.py
  105. +1 −1 tests/test_sphinx/test_sphinx_builds/{test_basic.sphinx5.html → test_basic.html}
  106. +1 −1 tests/test_sphinx/test_sphinx_builds/test_basic.resolved.xml
  107. +0 −252 tests/test_sphinx/test_sphinx_builds/test_basic.sphinx4.html
  108. +2 −2 tests/test_sphinx/test_sphinx_builds/test_basic.xml
  109. +30 −0 tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.html
  110. +22 −0 tests/test_sphinx/test_sphinx_builds/test_extended_syntaxes.xml
  111. 0 ...sphinx/test_sphinx_builds/{test_fieldlist_extension.sphinx5.html → test_fieldlist_extension.html}
  112. +0 −131 tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.html
  113. +2 −2 tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.xml
  114. 0 tests/test_sphinx/test_sphinx_builds/{test_footnotes.sphinx5.html → test_footnotes.html}
  115. +0 −147 tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx4.html
  116. 0 tests/test_sphinx/test_sphinx_builds/{test_gettext_html.sphinx5.html → test_gettext_html.html}
  117. +0 −162 tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.html
  118. +2 −2 tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.resolved.xml
  119. +2 −2 tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.xml
  120. +1 −1 tests/test_sphinx/test_sphinx_builds/test_includes.html
  121. +16 −16 tests/test_sphinx/test_sphinx_builds/test_includes.xml
  122. +84 −11 tests/test_sphinx/test_sphinx_builds/test_references.html
  123. +52 −15 tests/test_sphinx/test_sphinx_builds/test_references.resolved.xml
  124. +54 −19 tests/test_sphinx/test_sphinx_builds/test_references.xml
  125. +5 −5 tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.html
  126. +3 −3 tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.resolved.xml
  127. +3 −3 tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.xml
  128. +8 −19 tox.ini
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: github-actions
directory: /
commit-message:
prefix: ⬆️
schedule:
interval: weekly
- package-ecosystem: pip
directory: /
commit-message:
prefix: ⬆️
schedule:
interval: weekly
76 changes: 76 additions & 0 deletions .github/workflows/test-formats.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
name: build-doc-formats

on:
push:
branches: [master]
pull_request:

jobs:

doc-builds:

name: Documentation builds
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
format: ["man", "text"]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[linkify,rtd]
- name: Build docs
run: |
sphinx-build -nW --keep-going -b ${{ matrix.format }} docs/ docs/_build/${{ matrix.format }}
doc-builds-pdf:

name: Documentation builds
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
format: ["latex"]

steps:
- uses: actions/checkout@v3
- name: Set up Python 3.9
uses: actions/setup-python@v4
with:
python-version: 3.9
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[linkify,rtd]
- name: Build docs
run: |
sphinx-build -nW --keep-going -b ${{ matrix.format }} docs/ docs/_build/${{ matrix.format }}
- name: Make PDF
uses: xu-cheng/latex-action@v2
with:
working_directory: docs/_build/latex
root_file: "mystparser.tex"
# https://github.com/marketplace/actions/github-action-for-latex#it-fails-due-to-xindy-cannot-be-found
pre_compile: |
ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/xindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/xindy
ln -sf /opt/texlive/texdir/texmf-dist/scripts/xindy/texindy.pl /opt/texlive/texdir/bin/x86_64-linuxmusl/texindy
wget https://sourceforge.net/projects/xindy/files/xindy-source-components/2.4/xindy-kernel-3.0.tar.gz
tar xf xindy-kernel-3.0.tar.gz
cd xindy-kernel-3.0/src
apk add make
apk add clisp --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community
make
cp -f xindy.mem /opt/texlive/texdir/bin/x86_64-linuxmusl/
cd ../../
env:
XINDYOPTS: -L english -C utf8 -M sphinx.xdy
42 changes: 20 additions & 22 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -13,49 +13,48 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: "3.8"
- uses: pre-commit/action@v2.0.0
- uses: pre-commit/action@v3.0.0

tests:

strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
sphinx: [">=5,<6"]
python-version: ["3.8", "3.9", "3.10", "3.11"]
sphinx: [">=6,<7"]
os: [ubuntu-latest]
include:
- os: ubuntu-latest
python-version: "3.8"
sphinx: ">=4,<5"
sphinx: ">=5,<6"
- os: windows-latest
python-version: "3.8"
sphinx: ">=4,<5"
sphinx: ">=5,<6"

runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[linkify,testing]
pip install --upgrade-strategy "only-if-needed" "sphinx${{ matrix.sphinx }}"
pip install -e ".[linkify,testing]" "sphinx${{ matrix.sphinx }}"
- name: Run pytest
run: |
pytest --cov=myst_parser --cov-report=xml --cov-report=term-missing
coverage xml
- name: Upload to Codecov
if: github.repository == 'executablebooks/MyST-Parser' && matrix.python-version == 3.8
uses: codecov/codecov-action@v1
if: github.repository == 'executablebooks/MyST-Parser' && matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest'
uses: codecov/codecov-action@v3
with:
name: myst-parser-pytests
flags: pytests
@@ -74,9 +73,9 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: Install setup
@@ -87,8 +86,7 @@ jobs:
run: python .github/workflows/docutils_setup.py pyproject.toml README.md
- name: Install dependencies
run: |
pip install .
pip install pytest~=6.2 pytest-param-files~=0.3.3 pygments docutils==${{ matrix.docutils-version }}
pip install .[linkify,testing-docutils] docutils==${{ matrix.docutils-version }}
- name: ensure sphinx is not installed
run: |
python -c "\
@@ -99,7 +97,7 @@ jobs:
else:
raise AssertionError()"
- name: Run pytest for docutils-only tests
run: pytest tests/test_docutils.py tests/test_renderers/test_fixtures_docutils.py tests/test_renderers/test_include_directive.py
run: pytest tests/test_docutils.py tests/test_renderers/test_fixtures_docutils.py tests/test_renderers/test_include_directive.py tests/test_renderers/test_myst_config.py
- name: Run docutils CLI
run: echo "test" | myst-docutils-html

@@ -111,9 +109,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: install flit
@@ -134,9 +132,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: "3.8"
- name: install flit and tomlkit
23 changes: 10 additions & 13 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -12,47 +12,44 @@ exclude: >
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.3.0
rev: v4.4.0
hooks:
- id: check-json
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace

- repo: https://github.com/asottile/pyupgrade
rev: v2.38.2
rev: v3.3.1
hooks:
- id: pyupgrade
args: [--py37-plus]

- repo: https://github.com/PyCQA/isort
rev: 5.10.1
rev: 5.12.0
hooks:
- id: isort

- repo: https://github.com/psf/black
rev: 22.8.0
rev: 22.12.0
hooks:
- id: black

- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.218
hooks:
- id: flake8
additional_dependencies:
- flake8-comprehensions
- flake8-bugbear
# - flake8-self~=0.2.2
- id: ruff
args: ["--force-exclude"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.971
rev: v0.991
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
additional_dependencies:
- sphinx~=5.0
- markdown-it-py>=1.0.0,<3.0.0
- mdit-py-plugins~=0.3.1
- mdit-py-plugins~=0.3.4
files: >
(?x)^(
myst_parser/.*py|
2 changes: 1 addition & 1 deletion .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
version: 2

python:
version: "3"
version: "3.8"
install:
- method: pip
path: .
Loading