summaryrefslogtreecommitdiffstats
path: root/tests/test_sphinx/sourcedirs/substitutions
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_sphinx/sourcedirs/substitutions')
-rw-r--r--tests/test_sphinx/sourcedirs/substitutions/conf.py4
-rw-r--r--tests/test_sphinx/sourcedirs/substitutions/fun-fish.pngbin0 -> 92086 bytes
-rw-r--r--tests/test_sphinx/sourcedirs/substitutions/index.md56
-rw-r--r--tests/test_sphinx/sourcedirs/substitutions/other.md3
4 files changed, 63 insertions, 0 deletions
diff --git a/tests/test_sphinx/sourcedirs/substitutions/conf.py b/tests/test_sphinx/sourcedirs/substitutions/conf.py
new file mode 100644
index 0000000..57c5d68
--- /dev/null
+++ b/tests/test_sphinx/sourcedirs/substitutions/conf.py
@@ -0,0 +1,4 @@
+extensions = ["myst_parser"]
+exclude_patterns = ["_build"]
+myst_enable_extensions = ["substitution"]
+myst_substitutions = {"conf": "This was from the conf", "override": "From conf"}
diff --git a/tests/test_sphinx/sourcedirs/substitutions/fun-fish.png b/tests/test_sphinx/sourcedirs/substitutions/fun-fish.png
new file mode 100644
index 0000000..c9a4997
--- /dev/null
+++ b/tests/test_sphinx/sourcedirs/substitutions/fun-fish.png
Binary files differ
diff --git a/tests/test_sphinx/sourcedirs/substitutions/index.md b/tests/test_sphinx/sourcedirs/substitutions/index.md
new file mode 100644
index 0000000..e1dd672
--- /dev/null
+++ b/tests/test_sphinx/sourcedirs/substitutions/index.md
@@ -0,0 +1,56 @@
+---
+myst:
+ substitutions:
+ text: "- text"
+ text_with_nest: >
+ output
+ with *Markdown*
+ {{ nested }}
+ nested: nested substitution
+ admonition: |
+ prefix
+
+ ```{note}
+ A note {{ nested }}
+ ```
+ inline_admonition: |
+ ```{note}
+ Inline note
+ ```
+ override: Overridden by front matter
+
+---
+
+{{ text_with_nest }}
+
+{{ admonition }}
+
+a {{ text }} b
+
+c {{ text_with_nest }} d
+
+e {{ inline_admonition }} f
+
+{{ conf }}
+
+{{ override }}
+
+This will process the substitution
+
+```{parsed-literal}
+{{ text_with_nest }}
+```
+
+This will not process the substitution
+
+```python
+{{ text_with_nest }}
+```
+
+Using env and filters:
+
+{{ env.docname | upper }}
+
+```{toctree}
+other.md
+```
diff --git a/tests/test_sphinx/sourcedirs/substitutions/other.md b/tests/test_sphinx/sourcedirs/substitutions/other.md
new file mode 100644
index 0000000..8681af4
--- /dev/null
+++ b/tests/test_sphinx/sourcedirs/substitutions/other.md
@@ -0,0 +1,3 @@
+# Other
+
+{{ override }}