Mechanism for executing code before running notebook? #172
Unanswered
matthew-brett
asked this question in
Q&A
Replies: 1 comment 7 replies
-
Right now it's not possible, though something that has been discussed. I think we're tracking the idea here: jupyter-book/jupyter-book#777 The main reason this hasn't been implemented yet is because thus far we've had a fairly strong 1-to-1 mapping of "content file" and "page in the book" to make the contents more self-contained and reproducible. Though this is a feature many have requested. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
In Bookdown, you can specify a before_chapter_script to run code before the notebook (chapter) runs. The typical use-case is setting random number seeds, so the rendered output us predictable, but the notebook itself does not get polluted with seeding code.
I was doing this via some scripting in my own hacked up version of the previous iteration of the Jupyter Book - but is there a way to do this in the current version?
Beta Was this translation helpful? Give feedback.
All reactions