Skip to content

Conversation

@rossbar
Copy link
Owner

@rossbar rossbar commented Oct 26, 2020

Grabbed ma-tutorial proposal from numpy#29 and used it here as the basis for demonstrating a sphinx-based workflow.

The source file is in text-based notebook format (md) converted with jupytext (i.e. jupytext -k python3 --from notebook --to myst content/tutorial-ma.ipynb)

rossbar and others added 17 commits October 24, 2020 21:09
jupytext -k python3 --from notebook --to myst *.ipynb
Provides more options for buttons in theme.

Enable download and github interaction buttons.
Will need some tweaking to get this configured properly.
Build sphinx site.
A workflow geared towards review etc. on GitHub, relying
on CI services to do the execution and site building.

Not ideal, but a good starting point for discussion.
Mystify: sphinx+.md inputs workflow
jupytext -k python3 --from notebook --to myst tutorial-ma.ipynb
Modify tutorial and build workflow accordingly.
@rossbar
Copy link
Owner Author

rossbar commented Oct 26, 2020

The workflow I have set up here looks like this:

  1. The user submits the tutorial in text-based (md) notebook format. If the user submits something in .ipynb format instead, we can either:
    • Set up a CI service to auto jupytext it over to .md (overkill IMO, and not set up here), or
    • A reviewer can convert it for them: it's a one line jupytext command (see above)
  2. Any data needed by the tutorial can go in the data/ directory.
  3. CI services create the notebooks and subsequently the sphinx site. I've used CircleCI in this case just because I'm familiar with it, but GH actions or any other CI service would work.
  4. Reviewers can use the standard GH interface to comment, suggest changes etc.
  5. The run/rendered output is rebuilt on each push, and can be seen via the build artifact (see the checks).

By no means is this the only workflow. In fact I think it's best for the site to be independent of the notebooks, but I'm still experimenting with different approaches.

Re: download/launch links - this site uses the sphinx-book-theme which is based on the pydata-sphinx-theme used for the reference docs, so the feel should be similar, but has those nice widgets builtin on the top for downloading notebooks/launching them on binder. Note that I didn't bother properly configuring the "launch" links, so they don't actually work, but it should be straightforward to do.
Alternatively, if we want the theming to be exactly the same as the reference docs, we can use the pydata-sphinx-theme instead and modify the templates to include download/binder links.

@rossbar
Copy link
Owner Author

rossbar commented Jan 28, 2022

I didn't realize this was still open - we're well past this point :)

@rossbar rossbar closed this Jan 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants