-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
📚 DOCS: Add "Inline variable evaluation" page
- Loading branch information
1 parent
2ba8690
commit 10b6204
Showing
4 changed files
with
81 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,6 +7,7 @@ and build output formats. | |
:maxdepth: 1 | ||
format_code_cells | ||
hiding | ||
glue | ||
interactive | ||
inline | ||
glue | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
--- | ||
file_format: mystnb | ||
kernelspec: | ||
name: python3 | ||
mystnb: | ||
execution_mode: 'inline' | ||
--- | ||
|
||
(render/eval)= | ||
|
||
# Inline variable evaluation | ||
|
||
```{versionadded} 0.15.0 | ||
``` | ||
|
||
```{code-cell} ipython3 | ||
a = 1 | ||
``` | ||
|
||
```{code-cell} ipython3 | ||
import matplotlib.pyplot as plt | ||
myplot, ax = plt.subplots(figsize=(6, 2)) | ||
ax.plot([1,2,3]) | ||
ax.grid() | ||
plt.close() | ||
``` | ||
|
||
`````markdown | ||
````{note} | ||
```{eval:figure} myplot | ||
My figure caption, with an inline variable: {eval}`a`. | ||
``` | ||
```` | ||
````` | ||
|
||
````{note} | ||
```{eval:figure} myplot | ||
My figure caption, with an inline variable: {eval}`a`. | ||
``` | ||
```` | ||
|
||
```{code-cell} ipython3 | ||
a = 2 | ||
``` | ||
|
||
`````markdown | ||
Updated inline variable: {eval}`a`. | ||
````` | ||
|
||
Updated inline variable: {eval}`a`. |