-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Render and display tutorials #3
Conversation
I have pushed a few changes to this over the past week. I think it's generally good to go, but needs a few minor things:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me. I think the only outstanding thing is ensuring that the "questions" in our tutorials are masked somehow. Once online, I will take a careful look at what we have, and further update, but I think getting this in as a starting point is a good move.
This requires the notebooks are run using nbconvert and placed in the docs/tutorials/ directory. At the moment, it also requires a fork of mkdocs-jupyter that allows specifying the TOC depth, otherwise it's a bit too cluttered.
a876fc8
to
fd69570
Compare
5d647d1
to
3579a77
Compare
I think I'm going to push this as-is, but I'll need to work on the workflow for later so our webpage deployments don't take ages. |
This branch will render and display tutorials from the https://github.com/g-adopt/tutorials repository. For development, I've set up the
build.yml
action to pull from the branch behind this pull request, which is where the changes to the tutorials should probably end up: g-adopt/tutorials#3.Deployment
The pull model of incorporating the tutorials definitely isn't how things should be done for the actual deployment! I think I'll set up a time-based (weekly, or similar) Action on the tutorials repository that will run the notebooks and upload the versions with populated plots/outputs as an artifact. Then the build step of the website can just grab the latest build artifact and include that, without requiring a separate build step (which takes ages when the geodynamics notebooks are included...)
Development
For local development/testing of the notebooks' functionality and formatting, there are a couple of steps.
angus-g/tutorials
python3 -m pip install -r requirements.txt
docs/tutorials/
directoryTo actually render the notebooks, you can install the
nbconvert
package, and runTo start with, I've included the first 5 tutorials (up to PDE Constrained Optimisation). To include further tutorials, you'll need to add them into
mkdocs.yml
in thenav
section (the file should be a pretty good guide for the required format).Note
As always, don't forget to clear the outputs of the notebooks before committing them to the tutorials repository!