(no title)
wcrichton | 3 years ago
* YAML for the page metadata (title: ...)
* Markdown (```{python}...```)
* Custom in-text notations (@fig-polar)
* Custom markdown notations (#| label: fig-polar)
Whereas in Nota, this would look like:
%(export let metadata = {
title: "matplotlib demo",
format: {html: {codeFold: true}},
jupyter: "python3"
})
For a demonstration of a line plot on a polar axis, see @Ref{fig-polar}.
@Code[language=Python][label="fig-polar"][figCap="A line plot on a polar axis"]{
import numpy as np
import matplotlib.pyplot as plt
r = np.arange(0, 2, 0.01)
theta = 2 * np.pi * r
fig, ax = plt.subplots(
subplot_kw = {'projection': 'polar'}
)
ax.plot(theta, r)
ax.set_rticks([0.5, 1, 1.5, 2])
ax.grid(True)
plt.show()
}
When code or structured data is involved, Nota is "just Javascript" (e.g. exporting metadata, specifying code literals). When text is involved, Nota provides a small core set of sigils like @Component[attr=value]{content}.Note that Quarto's "#| fig-cap" annotation probably doesn't allow for rich text captions, since it only allows strings. But Nota allows deep composition, so you could do:
@Code[figCap=@{A @strong{line plot} on a @em{polar axis}}]{
...
}
sm1ch|3 years ago
jjallr|3 years ago