markdown-exec 1.13.0__tar.gz → 1.14.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/CHANGELOG.md +8 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/PKG-INFO +1 -1
- markdown_exec-1.14.0/docs/usage/octave.md +10 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/pyproject.toml +1 -1
- markdown_exec-1.14.0/src/markdown_exec/_internal/formatters/octave.py +52 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/main.py +2 -0
- markdown_exec-1.14.0/tests/test_octave.py +130 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/zensical.toml +1 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/AI_POLICY.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/CODE_OF_CONDUCT.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/CONTRIBUTING.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/LICENSE +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/README.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/coverage.ini +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/git-changelog.toml +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/pytest.ini +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/ruff.toml +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/ty.toml +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/vscode/launch.json +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/vscode/settings.json +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/vscode/tasks.json +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/zed/debug.json +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/zed/settings.json +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/config/zed/tasks.json +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/.overrides/main.html +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/.overrides/partials/comments.html +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/changelog.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/code_of_conduct.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/contributing.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/credits.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/css/apidocs.css +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/gallery.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/index.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/js/feedback.js +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/license.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/reference/api.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/schema.json +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/ansi.sh +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/argparse.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/argparse_format.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/chalk.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/d2.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/diagrams.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/drawsvg.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/expandable_filetree.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/highcharts.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/hyperbolic.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/matplotlib.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/plotly.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/pydeps.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/qrcode.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/rich.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/rich_terminal.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/runpy.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/textual.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/gallery/vega.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/usage/boolean_matrix.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/usage/hide.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/usage/interactive.pycon +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/usage/multiple.pycon +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/usage/platform_html.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/usage/platform_md.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/usage/source.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/snippets/usage/source.pycon +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/usage/index.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/usage/pyodide.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/usage/python.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/usage/shell.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/docs/usage/tree.md +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/duties.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/scripts/gen_credits.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/scripts/get_version.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/scripts/make +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/scripts/make.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/__init__.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/__init__.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/debug.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/__init__.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/_exec_python.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/base.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/bash.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/console.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/markdown.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/pycon.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/pyodide.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/python.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/sh.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/tree.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/logger.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/mkdocs_plugin.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/processors.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/rendering.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/assets/ansi.css +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/assets/pyodide.css +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/assets/pyodide.js +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/__init__.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/base.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/bash.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/console.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/markdown.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/pycon.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/pyodide.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/python.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/sh.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/formatters/tree.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/logger.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/mkdocs_plugin.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/processors.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/py.typed +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/rendering.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/__init__.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/conftest.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/test_api.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/test_base_formatter.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/test_converter.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/test_headings.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/test_python.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/test_shell.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/test_toc.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/test_tree.py +0 -0
- {markdown_exec-1.13.0 → markdown_exec-1.14.0}/tests/test_validator.py +0 -0
|
@@ -5,6 +5,14 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
|
|
|
5
5
|
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
|
|
6
6
|
|
|
7
7
|
<!-- insertion marker -->
|
|
8
|
+
## [1.14.0](https://github.com/pawamoy/markdown-exec/releases/tag/1.14.0) - 2026-11-19
|
|
9
|
+
|
|
10
|
+
<small>[Compare with 1.13.0](https://github.com/pawamoy/markdown-exec/compare/1.13.0...1.14.0)</small>
|
|
11
|
+
|
|
12
|
+
### Features
|
|
13
|
+
|
|
14
|
+
- Support GNU Octave code blocks ([0007cd4](https://github.com/pawamoy/markdown-exec/commit/0007cd434a5efc9ccd786e5ea20ee9822e093a45) by MattG-K). [Issue-111](https://github.com/pawamoy/markdown-exec/issues/111), [PR-112](https://github.com/pawamoy/markdown-exec/pull/112), Co-authored-by: Matthieu Guerquin-Kern <matthieu.guerquin-kern@grenoble-inp.fr>
|
|
15
|
+
|
|
8
16
|
## [1.13.0](https://github.com/pawamoy/markdown-exec/releases/tag/1.13.0) - 2026-11-10
|
|
9
17
|
|
|
10
18
|
<small>[Compare with 1.12.6](https://github.com/pawamoy/markdown-exec/compare/1.12.6...1.13.0)</small>
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ISC
|
|
2
|
+
#
|
|
3
|
+
# ISC License
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2022, Timothée Mazzucotelli and contributors
|
|
6
|
+
#
|
|
7
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
+
# purpose with or without fee is hereby granted, provided that the above
|
|
9
|
+
# copyright notice and this permission notice appear in all copies.
|
|
10
|
+
#
|
|
11
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
|
|
19
|
+
# Formatter for executing Octave/Matlab code.
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
import subprocess
|
|
24
|
+
from typing import Any
|
|
25
|
+
|
|
26
|
+
from markdown_exec._internal.formatters.base import ExecutionError, base_format
|
|
27
|
+
from markdown_exec._internal.rendering import code_block
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def _run_octave(
|
|
31
|
+
code: str,
|
|
32
|
+
returncode: int | None = None,
|
|
33
|
+
session: str | None = None, # noqa: ARG001
|
|
34
|
+
id: str | None = None, # noqa: A002,ARG001
|
|
35
|
+
**extra: str,
|
|
36
|
+
) -> str:
|
|
37
|
+
# Disable history to prevent history-file errors from appearing in the output at exit.
|
|
38
|
+
process = subprocess.run( # noqa: S603
|
|
39
|
+
["octave-cli", "--no-gui", "--quiet", "--no-history", "-e", code], # noqa: S607
|
|
40
|
+
stdout=subprocess.PIPE,
|
|
41
|
+
stderr=subprocess.STDOUT,
|
|
42
|
+
text=True,
|
|
43
|
+
check=False,
|
|
44
|
+
encoding="utf8",
|
|
45
|
+
)
|
|
46
|
+
if process.returncode != returncode:
|
|
47
|
+
raise ExecutionError(code_block("octave", process.stdout, **extra), process.returncode)
|
|
48
|
+
return process.stdout
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
def _format_octave(**kwargs: Any) -> str:
|
|
52
|
+
return base_format(language="octave", run=_run_octave, **kwargs)
|
|
@@ -26,6 +26,7 @@ from markdown_exec._internal.formatters.base import default_tabs
|
|
|
26
26
|
from markdown_exec._internal.formatters.bash import _format_bash
|
|
27
27
|
from markdown_exec._internal.formatters.console import _format_console
|
|
28
28
|
from markdown_exec._internal.formatters.markdown import _format_markdown
|
|
29
|
+
from markdown_exec._internal.formatters.octave import _format_octave
|
|
29
30
|
from markdown_exec._internal.formatters.pycon import _format_pycon
|
|
30
31
|
from markdown_exec._internal.formatters.pyodide import _format_pyodide
|
|
31
32
|
from markdown_exec._internal.formatters.python import _format_python
|
|
@@ -47,6 +48,7 @@ formatters = {
|
|
|
47
48
|
"console": _format_console,
|
|
48
49
|
"md": _format_markdown,
|
|
49
50
|
"markdown": _format_markdown,
|
|
51
|
+
"octave": _format_octave,
|
|
50
52
|
"py": _format_python,
|
|
51
53
|
"python": _format_python,
|
|
52
54
|
"pycon": _format_pycon,
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
# SPDX-License-Identifier: ISC
|
|
2
|
+
#
|
|
3
|
+
# ISC License
|
|
4
|
+
#
|
|
5
|
+
# Copyright (c) 2022, Timothée Mazzucotelli and contributors
|
|
6
|
+
#
|
|
7
|
+
# Permission to use, copy, modify, and/or distribute this software for any
|
|
8
|
+
# purpose with or without fee is hereby granted, provided that the above
|
|
9
|
+
# copyright notice and this permission notice appear in all copies.
|
|
10
|
+
#
|
|
11
|
+
# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
|
|
12
|
+
# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
|
|
13
|
+
# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
|
|
14
|
+
# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
|
|
15
|
+
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
|
|
16
|
+
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
|
|
17
|
+
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
|
18
|
+
|
|
19
|
+
"""Tests for the octave formatter."""
|
|
20
|
+
|
|
21
|
+
from __future__ import annotations
|
|
22
|
+
|
|
23
|
+
from shutil import which
|
|
24
|
+
from textwrap import dedent
|
|
25
|
+
from typing import TYPE_CHECKING
|
|
26
|
+
|
|
27
|
+
import pytest
|
|
28
|
+
|
|
29
|
+
if TYPE_CHECKING:
|
|
30
|
+
from pathlib import Path
|
|
31
|
+
|
|
32
|
+
from markdown import Markdown
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
pytestmark = pytest.mark.skipif(which("octave-cli") is None, reason="octave-cli is not installed")
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
def test_output_markdown(md: Markdown) -> None:
|
|
39
|
+
"""Assert Markdown is converted to HTML.
|
|
40
|
+
|
|
41
|
+
Parameters:
|
|
42
|
+
md: A Markdown instance (fixture).
|
|
43
|
+
"""
|
|
44
|
+
html = md.convert(
|
|
45
|
+
dedent(
|
|
46
|
+
"""
|
|
47
|
+
```octave exec="yes"
|
|
48
|
+
disp("**Bold!**")
|
|
49
|
+
```
|
|
50
|
+
""",
|
|
51
|
+
),
|
|
52
|
+
)
|
|
53
|
+
assert html == "<p><strong>Bold!</strong></p>"
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
def test_output_html(md: Markdown) -> None:
|
|
57
|
+
"""Assert HTML is injected as is.
|
|
58
|
+
|
|
59
|
+
Parameters:
|
|
60
|
+
md: A Markdown instance (fixture).
|
|
61
|
+
"""
|
|
62
|
+
html = md.convert(
|
|
63
|
+
dedent(
|
|
64
|
+
"""
|
|
65
|
+
```octave exec="yes" html="yes"
|
|
66
|
+
disp("**Bold!**")
|
|
67
|
+
```
|
|
68
|
+
""",
|
|
69
|
+
),
|
|
70
|
+
)
|
|
71
|
+
assert html == "<p>**Bold!**\n</p>"
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
def test_output_with_invalid_history_file(md: Markdown, monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> None:
|
|
75
|
+
"""Assert history-file errors do not appear in rendered output."""
|
|
76
|
+
# A directory cannot be used as a history file.
|
|
77
|
+
monkeypatch.setenv("OCTAVE_HISTFILE", str(tmp_path))
|
|
78
|
+
|
|
79
|
+
html = md.convert(
|
|
80
|
+
dedent(
|
|
81
|
+
"""
|
|
82
|
+
```octave exec="yes" html="yes"
|
|
83
|
+
disp("**Bold!**")
|
|
84
|
+
```
|
|
85
|
+
""",
|
|
86
|
+
),
|
|
87
|
+
)
|
|
88
|
+
|
|
89
|
+
assert html == "<p>**Bold!**\n</p>"
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def test_error_raised(md: Markdown, caplog: pytest.LogCaptureFixture) -> None:
|
|
93
|
+
"""Assert errors properly log a warning and return a formatted traceback.
|
|
94
|
+
|
|
95
|
+
Parameters:
|
|
96
|
+
md: A Markdown instance (fixture).
|
|
97
|
+
caplog: Pytest fixture to capture logs.
|
|
98
|
+
"""
|
|
99
|
+
html = md.convert(
|
|
100
|
+
dedent(
|
|
101
|
+
"""
|
|
102
|
+
```octave exec="yes"
|
|
103
|
+
print("wrong syntax")
|
|
104
|
+
```
|
|
105
|
+
""",
|
|
106
|
+
),
|
|
107
|
+
)
|
|
108
|
+
assert "error" in html
|
|
109
|
+
assert "Execution of octave code block exited with unexpected code 1" in caplog.text
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def test_return_code(md: Markdown, caplog: pytest.LogCaptureFixture) -> None:
|
|
113
|
+
"""Assert return code is used correctly.
|
|
114
|
+
|
|
115
|
+
Parameters:
|
|
116
|
+
md: A Markdown instance (fixture).
|
|
117
|
+
caplog: Pytest fixture to capture logs.
|
|
118
|
+
"""
|
|
119
|
+
html = md.convert(
|
|
120
|
+
dedent(
|
|
121
|
+
"""
|
|
122
|
+
```octave exec="yes" returncode="2"
|
|
123
|
+
disp('Not in the mood')
|
|
124
|
+
exit(2)
|
|
125
|
+
```
|
|
126
|
+
""",
|
|
127
|
+
),
|
|
128
|
+
)
|
|
129
|
+
assert "Not in the mood" in html
|
|
130
|
+
assert "exited with" not in caplog.text
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/__init__.py
RENAMED
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/_exec_python.py
RENAMED
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/base.py
RENAMED
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/bash.py
RENAMED
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/console.py
RENAMED
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/markdown.py
RENAMED
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/pycon.py
RENAMED
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/pyodide.py
RENAMED
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/python.py
RENAMED
|
File without changes
|
|
File without changes
|
{markdown_exec-1.13.0 → markdown_exec-1.14.0}/src/markdown_exec/_internal/formatters/tree.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|