Skip to content

Commit 1d78249

Browse files
committed
Start conversion to markdown
Converts a few selected pages to markdown, and adds requirements and configuration needed for the conversion.
1 parent 0ffc235 commit 1d78249

File tree

4 files changed

+442
-474
lines changed

4 files changed

+442
-474
lines changed

conf.py

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99
# General configuration
1010
# ---------------------
1111

12-
exclude_patterns = ["README.rst"]
12+
exclude_patterns = [
13+
"README.rst",
14+
".jupyter_cache",
15+
"jupyter_execute",
16+
"pyximages/README.md",
17+
]
1318

1419
# Add any Sphinx extension module names here, as strings. They can be extensions
1520
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
@@ -23,6 +28,7 @@
2328
"sphinx.ext.extlinks",
2429
"sphinx_gallery.gen_gallery",
2530
"sphinx_copybutton",
31+
"myst_nb",
2632
]
2733

2834
# See https://sphinx-copybutton.readthedocs.io/en/latest/use.html#automatic-exclusion-of-prompts-from-the-copies
@@ -72,7 +78,7 @@
7278
templates_path = ["_templates"]
7379

7480
# The suffix of source filenames.
75-
source_suffix = ".rst"
81+
source_suffix = [".rst", ".md"]
7682

7783
# General information about the project.
7884
project = "Scientific Python Lectures"
@@ -91,6 +97,18 @@
9197
# The name of the Pygments (syntax highlighting) style to use.
9298
pygments_style = "sphinx"
9399

100+
# Enable executable .md files support
101+
myst_enable_extensions = [
102+
'colon_fence',
103+
'dollarmath',
104+
'substitution',
105+
'tasklist',
106+
'attrs_inline',
107+
'linkify',
108+
]
109+
110+
nb_output_stderr = 'show'
111+
94112
# Monkey-patch sphinx to set the lineseparator option of pygment, to
95113
# have indented line wrapping
96114

@@ -288,6 +306,8 @@ def add_per_page_js(app, pagename, templatename, context, doctree):
288306

289307

290308
def setup(app):
309+
# Do not execute .ipynb files generated by the gallery
310+
app.registry.source_suffix.pop(".ipynb", None)
291311
app.add_js_file("https://code.jquery.com/jquery-3.7.0.min.js")
292312
app.add_js_file("scroll_highlight_toc.js")
293313

0 commit comments

Comments
 (0)