-
Notifications
You must be signed in to change notification settings - Fork 66
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
Use the latest thebe.js
in our documentation
#285
Comments
Agreed, the versions of thebe used in the various docs versions should match. For example, if you want to write some explanation and demonstration about "Restart and Run All" you can't because it doesn't show up! |
All of this seems sound to me-- I don't know about the Sphinx side of things, but we could write a custom git hook to run a script which would generate a Does this sound like a viable solution, @choldgraf? |
I'm not sure a git hook solves the issue. If you build the docs locally you'd like the version of thebe at that commit to be used to build the docs. |
A git hook would merely run the script which would generate the build. It's a bonus, but not needed. The script could be an npm script living in package.json or something custom, but to your earlier point (a good one!), the script could generate versioned |
I don't know enough about modern JS tech, but from the python side most sphinx conf.py file simply append the parent directory to sys.path. This ensures your docs are built with local version of the python lib. Python libs don't have to be built though. If thebe has to be built before it can be used, then I guess adding that build step to the sphinx make file would be needed. Sorry if you already know all this... |
I feel like there are two options (both of which are fine with me):
|
@moorepants I didn't, thank you! I think you're right, we'll need that build step/make command.
@choldgraf I think this is a great idea, and would be good to have this exposed in an npm script too, just for ease of use. (i.e. @choldgraf , If you do want to check the build in (I know you said you didnt), I would lean towards using a pre-commit. With a pre-commit, we will always create a latest build with each commit, which would be convenient when checking for errors/bugs in PRs. With the conf.py, we'd need to run this each time we want to view changes. If we don't want to check the build in, either way seems great to me :) Regardless of what we do, it's probably good to build again when we build the docs, just for the sake of being explicit (so a +1 for conf.py here). Thoughts? |
Perhaps a good way to get started is to write the |
mmmm I have no idea :-) I assume the non-numbered |
Based on the CDN url: |
my strategy with javascript is "try it and see if it breaks, if nothing obviously breaks then roll it to production |
ha! That's mine too :) |
I think all the *.js files are needed. The I would copy the whole lib folder so you don't need to worry about how webpack breaks up the bundle. It should use relative URLs to load multiple stages as appropriate, so you only need to have a script tag for index.js, but the rest maybe loaded asynchronously. |
I was looking for any mentions of a What am I missing here? |
I took a pass at trying to implement this here: I got it working fine locally, but can't figure out how to get readthedocs to build the JS properly (it has |
Is the readthedocs Node version coming from docs/environment.yml? Can we give that a version number? |
so when I used conda for the |
Shoot. I'm lost here, unfortunately. Anyone? Also @minrk, still curious about if you have any insight:
|
I think that it would be best for us to use the latest
thebe.js
package in our documentation, so that we can both test it locally in a more "realistic" setup, "version" our documentation in the same way that Python is versioned, and so that our docs can use features that may be available only in the "latest" release.I think that the simplest way to do this would be:
Generate a single
thebe.js
file that can be linked locally, move it todocs/_static/thebe.js
Add
docs/_static
to the list of static paths for SphinxAdd the linked JS file via
The only challenge is that I have no idea how to build
thebe.js
locally in a way that could be linked in a local SSG. Does anyone have guidance on how / the best way to do this?perhaps @minrk or @joelachance or @rowanc1 know how?
The text was updated successfully, but these errors were encountered: