Closed mauro3 closed 2 years ago
You can use the regex
keyword for this — it lets you either add a comment tag to the cells that you want to include, for example.
It might be useful to support a complementary regex for cells that you want to exclude, since negative regexes are a pain to construct.
You could also do
using PyPlot
PyPlot.isjulia_display[] = false
plt."switch_backend"("Agg")
plt."ioff"()
maybe, to prevent PyPlot from displaying anything.
Here's an example to filter-out cells that contain # nbinclude:ignore
:
@nbinclude("a.ipynb"; regex=r"^(?!.*#\s*nbinclude:ignore\b)")
I've encountered it a few times now that I wanted to include a notebook which produces plots (with PyPlot), but the include is not for the plots it produces but for the functions it contains. Is there a way to suppress the plot output in the included location without having to comment them out in the source notebook?