QuantEcon / sphinx-tojupyter

A Jupyter Notebook Writer for Sphinx
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Context for Code Blocks (Jupyter-book and sphinx) #36

Open mmcky opened 2 years ago

mmcky commented 2 years ago

The following code blocks are all setup in the notebook as executable blocks.

In jupyter-book context the code-cell should be the only one that is executable

In sphinx context the code-cell should bet he only one that is executable

```{code-cell} python3
jv = JVWorker(grid_size=25, mc_size=50)
plot_grid_max, plot_grid_size = 1.2, 100
plot_grid = np.linspace(0, plot_grid_max, plot_grid_size)
fig, ax = plt.subplots()
ax.set_xlim(0, plot_grid_max)
ax.set_ylim(0, plot_grid_max)
jv = JVWorker(grid_size=25, mc_size=50)
plot_grid_max, plot_grid_size = 1.2, 100
plot_grid = np.linspace(0, plot_grid_max, plot_grid_size)
fig, ax = plt.subplots()
ax.set_xlim(0, plot_grid_max)
ax.set_ylim(0, plot_grid_max)
jv = JVWorker(grid_size=25, mc_size=50)
plot_grid_max, plot_grid_size = 1.2, 100
plot_grid = np.linspace(0, plot_grid_max, plot_grid_size)
fig, ax = plt.subplots()
ax.set_xlim(0, plot_grid_max)
ax.set_ylim(0, plot_grid_max)