Skip to content

Commit 58f805a

Browse files
authored
Merge pull request #3 from jupyter-book/sp/extended-examples
🧪 Extending test cases
2 parents 2cdb4f3 + 038015d commit 58f805a

15 files changed

+1877
-22
lines changed

content/bokeh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ output_notebook()
1717
```
1818

1919
```{code-cell} python3
20-
:name: fig-bokeh
20+
:name: out-bokeh
2121
2222
sigma = 10
2323
rho = 28

content/embeds.md

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,32 @@ MyST This supports embedding of notebook content and other files. The following
44

55
## A Matplotlib Output
66

7-
:::{embed} #fig-matplotlib
7+
:::{embed} #out-matplotlib
88
:::
99

10-
## A Plotly Figure
10+
## Embed a Plotly output
1111

12-
:::{embed} #fig-plotly-output
12+
:::{embed} #out-plotly-output
1313
:::
1414

15-
## A Bokeh Figure
15+
## Embed a Bokeh output
1616

17-
:::{embed} #fig-bokeh
17+
:::{embed} #out-bokeh
1818
:::
1919

20-
### A SymPy Output
20+
## Embed some sympy output
2121

22-
![](#fig-sympy-outputs)
23-
![](#fig-sympy-outputs-0)
22+
![](#eqn-sympy)
2423

25-
### A manual equation
24+
## Embed some maths
25+
26+
![](#eqn-mlp)
27+
28+
29+
## Embed a manual equation
2630

2731
![](#eqn-manual)
32+
33+
## Embed some markdown generated in an output
34+
35+
![](#out-jupyter-markdown)

content/figures-w-placeholders.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
title: Figures (With Placeholders)
3+
short_title: Figures (Placeholders)
4+
---
5+
6+
MyST supports using notebook outputs inside figures, This page contains some examples.
7+
8+
## A Matplotlib Figure with a Placeholder
9+
10+
:::{figure} #out-matplotlib
11+
:label: fig-matplotlib-pl
12+
:placeholder: ./placeholder.jpg
13+
A plotly figure
14+
:::
15+
16+
17+
## A Plotly Figure with Placeholder
18+
19+
:::{figure} #out-plotly
20+
:label: fig-plotly-pl
21+
:placeholder: ./placeholder.jpg
22+
A plotly figure
23+
:::
24+
25+
26+
## A Bokeh Figure with Placeholder
27+
28+
:::{figure} #out-bokeh
29+
:label: fig-bokeh-pl
30+
:placeholder: ./placeholder.jpg
31+
A bokeh figure with a plaeholder
32+
:::
33+
34+
## An ipyWidgets figure with Placeholder
35+
36+
:::{figure} #out-lorenz
37+
:label: fig-lorenz-pl
38+
:placeholder: ./placeholder.jpg
39+
An ipywidgets figure with a placeholder
40+
:::
41+
42+
## An ipyWidgets figure with Placeholder (procomputed, ipynb)
43+
44+
:::{figure} #out-lorenz-2
45+
:label: fig-lorenz-2-pl
46+
:placeholder: ./placeholder.jpg
47+
An ipywidgets figure with a placeholder
48+
:::

content/figures.md

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,40 @@
22

33
MyST supports using notebook outputs inside figures, This page contains some examples.
44

5+
56
## A Matplotlib Figure
67

7-
![](#fig-matplotlib)
8+
:::{figure} #out-matplotlib
9+
:label: fig-matplotlib-1
10+
A matplotlib figure
11+
:::
812

913
## A Plotly Figure
1014

11-
:::{figure} #fig-plotly-output
15+
:::{figure} #out-plotly
16+
:label: fig-plotly-1
1217
A plotly figure
1318
:::
1419

20+
1521
## A Bokeh Figure
1622

17-
![](#fig-bokeh)
23+
:::{figure} #out-bokeh
24+
:label: fig-bokeh-1
25+
A bokeh figure
26+
:::
27+
28+
## An ipyWidgets figure
1829

30+
:::{figure} #out-lorenz
31+
:label: fig-lorenz-1
32+
An ipywidgets figure
33+
:::
34+
35+
36+
## An ipyWidgets figure (procomputed, ipynb)
37+
38+
:::{figure} #out-lorenz-2
39+
:label: fig-lorenz-2
40+
An ipywidgets figure
41+
:::

content/index.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,18 @@
11
# Jupyter Outputs
22

3-
MyST supports embedding plots from other pages and site! Here are some such plots, such as [](#fig-plotly-output) and [](#fig-bokeh-output).
3+
MyST supports embedding plots from other pages and site!
4+
5+
Here are some such plots, such as [Notebook Output (plotly)](#out-plotly) and [Notebook Output (bokeh)](#out-bokeh) from notebooks,
6+
or the same plots as figures, [](#fig-plotly-1) and [](#fig-bokeh-1).
47

58
* [](./figures.md)
69
* [](./embeds.md)
710
* [](./external.md)
11+
* Plots
12+
* [](./bokeh.md)
13+
* [](./plotly.md)
14+
* [](./matplotlib.md)
15+
* Content
16+
* [](./latex.md)
17+
* [](./markdown.md)
18+

content/latex.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ kernelspec:
99
Here's a LaTeX equation:
1010

1111
```{code-cell} python3
12+
:label: eqn-manual
1213
1314
from IPython.display import Latex
1415
@@ -27,7 +28,7 @@ $$
2728
And here's a generated LaTeX equation:
2829

2930
```{code-cell} python3
30-
:name: eqn-sympy
31+
:label: eqn-sympy
3132
3233
from sympy import symbols
3334

content/markdown.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ E(F) = \sum*{f \in F,\,c \in C} T*{fc} D\_{fc}\,,
1515
Here's a generated figure that references an equation:
1616

1717
```{code-cell} python3
18-
:name: fig-jupyter
18+
:name: out-jupyter-markdown
1919
2020
from IPython.display import Markdown
2121

content/matplotlib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def koch_snowflake(order, scale=10):
4747
```
4848

4949
```{code-cell} python3
50-
:name: fig-matplotlib
50+
:label: out-matplotlib
5151
x, y = koch_snowflake(order=5)
5252
5353
plt.figure(figsize=(8, 8))

content/placeholder.jpg

11.3 KB
Loading

content/plotly.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ np.random.seed(1)
1414
```
1515

1616
```{code-cell} python3
17-
#| label: fig-plotly
17+
#| label: out-plotly
1818
1919
# Number of data points
2020
N = 10000

0 commit comments

Comments
 (0)