Skip to content

Commit 63c4491

Browse files
authored
feature: add support for markdown-exec
Signed-off-by: squidfunk <martin.donath@squidfunk.com>
1 parent f0f506b commit 63c4491

15 files changed

Lines changed: 877 additions & 14 deletions

File tree

dist/assets/javascripts/bundle.0df4f2d0.min.js

Lines changed: 14 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assets/javascripts/bundle.f796296f.min.js

Lines changed: 0 additions & 7 deletions
This file was deleted.

dist/assets/stylesheets/classic/main.65161b11.min.css renamed to dist/assets/stylesheets/classic/main.6cf5c66f.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/assets/stylesheets/modern/main.e4774b23.min.css renamed to dist/assets/stylesheets/modern/main.5e19f6ca.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/base.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@
4747
{% endblock %}
4848
{% block styles %}
4949
{% if config.theme.variant == "modern" %}
50-
{% set href = 'assets/stylesheets/modern/main.e4774b23.min.css' | url %}
50+
{% set href = 'assets/stylesheets/modern/main.5e19f6ca.min.css' | url %}
5151
{% else %}
52-
{% set href = 'assets/stylesheets/classic/main.65161b11.min.css' | url %}
52+
{% set href = 'assets/stylesheets/classic/main.6cf5c66f.min.css' | url %}
5353
{% endif %}
5454
<link rel="stylesheet" href="{{ href }}">
5555
{% if config.theme.palette %}
@@ -273,7 +273,7 @@
273273
</script>
274274
{% endblock %}
275275
{% block scripts %}
276-
<script src="{{ 'assets/javascripts/bundle.f796296f.min.js' | url }}"></script>
276+
<script src="{{ 'assets/javascripts/bundle.0df4f2d0.min.js' | url }}"></script>
277277
{% for script in config.extra_javascript %}
278278
{{ script | script_tag }}
279279
{% endfor %}

src/assets/javascripts/components/content/_/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ import {
4848
Details,
4949
mountDetails
5050
} from "../details"
51+
import {
52+
Pyodide,
53+
mountPyodide
54+
} from "../exec"
5155
import {
5256
GLightbox,
5357
mountGLightbox
@@ -85,6 +89,7 @@ export type Content =
8589
| GLightbox
8690
| Link
8791
| Mermaid
92+
| Pyodide
8893
| Tooltip
8994

9095
/* ----------------------------------------------------------------------------
@@ -120,14 +125,20 @@ export function mountContent(
120125
el: HTMLElement, dependencies: Dependencies
121126
): Observable<Component<Content>> {
122127
const { viewport$, target$, print$ } = dependencies
128+
123129
return merge(
124130

125131
// Annotations
126132
...getElements(".annotate:not(.highlight)", el)
127133
.map(child => mountAnnotationBlock(child, { target$, print$ })),
128134

135+
// Pyodide blocks
136+
...getElements<HTMLElement>(".pyodide", el)
137+
.map(child => mountPyodide(child)),
138+
129139
// Code blocks
130140
...getElements("pre:not(.mermaid) > code", el)
141+
.filter(child => !child.closest(".pyodide"))
131142
.map(child => mountCodeBlock(child, { target$, print$ })),
132143

133144
// Links

0 commit comments

Comments
 (0)