Jupyter Book plugin #17789
Replies: 6 comments 11 replies
-
I've just hit a case where I am likely going to need to be including C++ within my package. As a result I suspect I am going to need to go the Bazel route. Sorry about getting everyone's hopes up regarding me helping out on this front, but I suspect I'll need to go with Bazel. |
Beta Was this translation helpful? Give feedback.
-
Regarding approach, there are two decision points so far that I've come up with in reviewing the Jupyter Book (JB) API docs. First is whether to create individual targets for each document and second is whether to support publishing sources, and if so, which ones. My short answers to those questions are: support individual targets, support publishing initially to github pages. As background, when you run JB it will cache the results and only re-run notebooks/documents that have changed since the last run, similar to pants. So it would be possible to just use that API to manage the cache, rather than building individual doc targets. However, the downside to that is that you miss out on having hermetic builds for each doc. A use case where this could be a problem is in a large book or blog, where you might be bringing lots of different packages for different topics. With only a single book target, all packages need to be installed for every run, which sort of defeats the purpose of pants. The JB API allows for single target builds, so I would lean towards using that. Re publishing, given that pants supports it, I think there should also be a publishing target. I suggest GH Pages first mostly because that's what I use, although it should also be the easiest. Just need to create a rule that checks out some other branch and runs the JB build commands there, so that the HTML gets put into the gh-pages branch (or wherever you define). JB also supports Netlify and ReadTheDocs, which likely wouldn't be too hard to add. |
Beta Was this translation helpful? Give feedback.
-
See related issue: #17822 |
Beta Was this translation helpful? Give feedback.
-
I've been working on the plugin and it looks like A couple other updates:
|
Beta Was this translation helpful? Give feedback.
-
Update on MVP 1.0 implementationThe jupyter-book implementation mvp uses a single target, which points to the directory holding the jupyter-book docs. It passes the directory to a Digest, which jupyter-book runs on. As described above, I haven't been able to make individual sources build well and so decided to let jupyter-book handle most of the work, including caching. Points to consider for improvement:
That's all I can think about for now re improvements Debugging
TestingI setup the plugin in my projects repo. If anyone feels brave, please fork it and test out the plugin. Looking for thoughts/suggestions before moving to the pants repo and adding tests, etc. |
Beta Was this translation helpful? Give feedback.
-
Two updates. First, with @jsirois help I resolved the jupyter kernel issue that had been plaguing this plugin by switching from a Second, I realized that there is a better way to build the targets for the plugin. Rather than have one target that points at a single docs folder, the plugin should use individual source targets, which would bring all the targetted docs into a single digest for jupyter-book to run. So the docs are still being built by a single jupyter book process, but the individual targets allow for more flexibility in spreading documentation around a repo. So for now I'm going to work on refactoring the plugin to use this approach. A few things I've thought about:
A future version of this plugin should also parse |
Beta Was this translation helpful? Give feedback.
-
This is a more permanent discussion location for the building of the Jupyter Book plugin. Original slack thread:
https://pantsbuild.slack.com/archives/C01CQHVDMMW/p1670151030213789
Beta Was this translation helpful? Give feedback.
All reactions