Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .binder/postBuild

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we maybe put this file in a .binder directory, just to stay a bit more organized?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsipocz @rossbar I've looked into it. Once .binder/ exists, repo2docker only reads config from there, so environment.yml would have to move to the folder as well. Would that work for you?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I have elsewhere is that the requirements file in .binder is referencing the one in the top level directory. Now, I believe that may not work with conda env files, but then maybe it's a good time that we ditch the otherwise duplicate environment.yml?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bsipocz I'd prefer to have a single source of truth for dependencies as well. I'll check if we can drop environment.yml without affecting existing workflows.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 for dropping environment.yml - now that folks have so many other environment management options that wrap conda (and are flexible enough to handle all the different env specification patterns), I think we're in a much better position to drop tooling-specific specs.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/bash
# Binder: open the .md tutorials as notebooks, not text files.
set -euo pipefail

jupytext-config set-default-viewer markdown myst
2 changes: 2 additions & 0 deletions .binder/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r ../requirements.txt
jupyterlab_myst
5 changes: 5 additions & 0 deletions _static/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,8 @@
table-layout: fixed;
width: 100%;
}

/* Show the launch (rocket) button only on pages with executable cells. */
main:not(:has(.myst-jp-nb-toolbar)) .myst-fm-launch-button {
display: none;
}
19 changes: 13 additions & 6 deletions content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,19 @@ teaching classes with. If you're interested in adding your own content, check
the [Contributing](contributing.md) section.

To open a live version of the content, click the **launch Binder** button above.
To open each of the `.md` files, right click and select "Open with -> Notebook".
You can also launch individual tutorials on Binder by clicking on the rocket
icon that appears in the upper-right corner of each tutorial. To download a
local copy of the `.ipynb` files, you can either
[clone this repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
or use the download icon in the upper-right corner of each tutorial.
The `.md` files open as notebooks. If one opens as plain text instead, right
click it and select "Open with -> Notebook".

Each tutorial also has its own buttons in the upper-right corner of the page:

- the rocket icon opens that tutorial on Binder, or on a JupyterHub of your
choice,
- the power icon starts a Binder-backed kernel so that you can edit and run the
code cells without leaving the page,
- the download icon saves a local copy of the tutorial.

You can also get all the tutorials at once by
[cloning this repository](https://docs.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository).

## Useful links and resources

Expand Down
18 changes: 0 additions & 18 deletions environment.yml

This file was deleted.

5 changes: 5 additions & 0 deletions myst.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ project:
# keywords: []
authors: Numpy Community
github: https://github.com/numpy/numpy-tutorials
# Adds launch (rocket) and live-code (power) buttons to each tutorial
jupyter:
binder:
repo: numpy/numpy-tutorials
ref: main
toc:
- file: content/index.md

Expand Down
Loading