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.19.0
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.1
Choose a head ref
  • 5 commits
  • 19 files changed
  • 3 contributors

Commits on Mar 1, 2023

  1. Copy the full SHA
    bcfd1a7 View commit details
  2. [pre-commit.ci] pre-commit autoupdate (#653)

    Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
    Co-authored-by: Chris Sewell <chrisj_sewell@hotmail.com>
    pre-commit-ci[bot] and chrisjsewell authored Mar 1, 2023
    Copy the full SHA
    8bf2522 View commit details
  3. 📚 DOCS: Un-wrap announcement in <p> (#732)

    The announcement text at the top was having a base pydata theme color applied to it because it was wrapped in <p>,
    choldgraf authored Mar 1, 2023
    Copy the full SHA
    585ce9a View commit details

Commits on Mar 2, 2023

  1. Copy the full SHA
    322cb42 View commit details
  2. Copy the full SHA
    01c7565 View commit details
7 changes: 3 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -31,18 +31,17 @@ repos:
- id: isort

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

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.0.218
rev: v0.0.252
hooks:
- id: ruff
args: ["--force-exclude"]

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.991
rev: v1.0.1
hooks:
- id: mypy
args: [--config-file=pyproject.toml]
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## 0.19.1 - 2023-03-02

🐛 FIX `NoURI` error in doc reference resolution, for texinfo builds (<gh-pr:734>)

## 0.19.0 - 2023-03-01

This release brings a number of exciting new features, improvements, and upgrades 🎉
2 changes: 1 addition & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
@@ -159,7 +159,7 @@
"use_repository_button": True,
"use_edit_page_button": True,
"use_issues_button": True,
"announcement": "<p><b>v0.19</b> is now out! See the Changelog for details</p>",
"announcement": "<b>v0.19</b> is now out! See the Changelog for details",
}
# OpenGraph metadata
ogp_site_url = "https://myst-parser.readthedocs.io/en/latest"
5 changes: 4 additions & 1 deletion docs/live-preview.md
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@ py-config:
splashscreen:
autoclose: true
packages:
- myst-docutils==0.18
- myst-docutils==0.19
- docutils==0.19
- pygments
---
@@ -43,6 +43,8 @@ Hallo world!
An admonition note!
```
[Link to the heading](#heading-1)
## Math
```python
@@ -94,6 +96,7 @@ myst_enable_extensions:
- colon_fence
- deflist
- dollarmath
myst_heading_anchors: 2
myst_highlight_code_blocks: true
</textarea>
::::
1 change: 1 addition & 0 deletions docs/syntax/examples/example.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""An example Python file."""


# start example
class MyClass:
"""An example class."""
2 changes: 1 addition & 1 deletion myst_parser/__init__.py
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
with bridges to [docutils](https://docutils.sourceforge.io/)
and [Sphinx](https://github.com/sphinx-doc/sphinx).
"""
__version__ = "0.19.0"
__version__ = "0.19.1"


def setup(app):
1 change: 0 additions & 1 deletion myst_parser/config/main.py
Original file line number Diff line number Diff line change
@@ -513,7 +513,6 @@ def merge_file_level(
# validate each update
fields = {name: (value, field) for name, value, field in config.as_triple()}
for name, value in updates.items():

if name not in fields:
warning(MystWarnings.MD_TOPMATTER, f"Unknown field: {name}")
continue
2 changes: 0 additions & 2 deletions myst_parser/mdit_to_docutils/base.py
Original file line number Diff line number Diff line change
@@ -299,7 +299,6 @@ def _render_finalise(self) -> None:
# Add the wordcount, generated by the ``mdit_py_plugins.wordcount_plugin``.
wordcount_metadata = self.md_env.get("wordcount", {})
if wordcount_metadata:

# save the wordcount to the sphinx BuildEnvironment metadata
if self.sphinx_env is not None:
meta = self.sphinx_env.metadata.setdefault(self.sphinx_env.docname, {})
@@ -1334,7 +1333,6 @@ def dict_to_fm_field_list(
return field_list

def render_table(self, token: SyntaxTreeNode) -> None:

# markdown-it table always contains at least a header:
assert token.children
header = token.children[0]
1 change: 0 additions & 1 deletion myst_parser/mdit_to_docutils/html_to_nodes.py
Original file line number Diff line number Diff line change
@@ -82,7 +82,6 @@ def html_to_nodes(

nodes_list = []
for child in root:

if child.name == "img":
if "src" not in child.attrs:
return [
1 change: 0 additions & 1 deletion myst_parser/mocking.py
Original file line number Diff line number Diff line change
@@ -343,7 +343,6 @@ def __init__(
self.lineno = lineno

def run(self) -> list[nodes.Element]:

from docutils.parsers.rst.directives.body import CodeBlock, NumberLines

if not self.document.settings.file_insertion_enabled:
1 change: 0 additions & 1 deletion myst_parser/parsers/docutils_.py
Original file line number Diff line number Diff line change
@@ -329,7 +329,6 @@ def stylesheet_call(self, *args, **kwargs):


class SimpleWriter(Writer):

settings_spec = filter_settings_spec(
Writer.settings_spec,
"template",
9 changes: 6 additions & 3 deletions myst_parser/sphinx_ext/myst_refs.py
Original file line number Diff line number Diff line change
@@ -178,9 +178,12 @@ def resolve_myst_ref_doc(self, node: pending_xref):
)

assert self.app.builder
ref_node = make_refnode(
self.app.builder, from_docname, ref_docname, targetid, innernode
)
try:
ref_node = make_refnode(
self.app.builder, from_docname, ref_docname, targetid, innernode
)
except NoUri:
ref_node = innernode
node.replace_self(ref_node)

def resolve_myst_ref_any(
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -111,6 +111,7 @@ no_lines_before = "LOCALFOLDER"
[tool.ruff]
line-length = 100
extend-select = ["B0", "C4", "ICN", "ISC", "N", "RUF", "SIM"]
extend-ignore = ["RUF005"]

[tool.mypy]
show_error_codes = true
1 change: 0 additions & 1 deletion tests/test_sphinx/conftest.py
Original file line number Diff line number Diff line change
@@ -65,7 +65,6 @@ def read(
regress_ext=".html",
replace=None,
):

outpath = path(os.path.join(str(app.srcdir), "_build", buildername, filename))
if not outpath.exists():
raise OSError(f"no output file exists: {outpath}")
3 changes: 0 additions & 3 deletions tests/test_sphinx/sourcedirs/texi_table/index.md

This file was deleted.

3 changes: 3 additions & 0 deletions tests/test_sphinx/sourcedirs/texinfo/file.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
---
orphan: true
---
9 changes: 9 additions & 0 deletions tests/test_sphinx/sourcedirs/texinfo/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Check that NoURIError is handled correctly:

[](file.md)

Check that tables can be built:

| foo | bar |
| --- | --- |
| baz | bim |
10 changes: 3 additions & 7 deletions tests/test_sphinx/test_sphinx_builds.py
Original file line number Diff line number Diff line change
@@ -564,15 +564,11 @@ def test_fieldlist_extension(

@pytest.mark.sphinx(
buildername="texinfo",
srcdir=os.path.join(SOURCE_DIR, "texi_table"),
srcdir=os.path.join(SOURCE_DIR, "texinfo"),
freshenv=True,
)
def test_texinfo_table(
app,
status,
warning,
):
"""Test that tables can be built with the Texinfo builder."""
def test_texinfo(app, status, warning):
"""Test Texinfo builds."""
app.build()
assert "build succeeded" in status.getvalue() # Build succeeded
warnings = warning.getvalue().strip()