Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Integrate community-documentation with Jupyter Book

With PR 2i2c-org/infrastructure#5045, we now support the ability to connect community-documentation with a deployed Hub. From an infrastructure perspective, this is a thin integration in which we deliver the following features:

Create the community documentation repo

There is a template repository for the community docs at 2i2c-org/community-docs-template. The community representative should use this template to create their own repo, and provide us with temporary owner access.

We must then enable GitHub Pages deployment via GitHub Actions for the repo, which will then deploy to https://<ORG>.github.io/<REPO>/.

Use a custom subdomain for the book

We currently use Namecheap to manage the domains of our hubs. A CNAME record for the docs subdomain (e.g. docs.<COMMUNITY>.2i2c.cloud) should be added alongside the hub’s existing records, and point to the deployed Jupyter Book static site, e.g. <ORG>.github.io.

Once the CNAME record has been established, the repo must be configured to use a custom domain, e.g. docs.<COMMUNITY>.2i2c.cloud.

Add Binder/JupyterHub configuration to the book

Hubs that deploy a BinderHub

If the hub is deployed alongside a BinderHub, its URL can be added to the myst.yml’s project.binder property, e.g.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# See docs at: https://mystmd.org/guide/frontmatter
version: 1
project:
  id: df8b4a16-be6c-4b92-abcc-a95e23b9684a
  # title:
  # description:
  # keywords: []
  # authors: []
  github: https://github.com/2i2c-org/community-docs-template
  # To autogenerate a Table of Contents, run "jupyter-book init --write-toc"
  binder: https://binder.<COMMUNITY>.2i2c.cloud/
  toc:
    - file: content/index.md
    - file: content/kb/index.md
    - file: content/metrics.md

This will enable the per-page launch-button that allows users to jump into an execution context with a JupyterHub or BinderHub. Setting the binder field will also set the default BinderHub URL to the given URL.

Hubs without a BinderHub

For hubs that do not deploy a BinderHub, the launch-button UI can be enabled by setting the default myst.yml’s project.binder property to https://mybinder.org, e.g.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# See docs at: https://mystmd.org/guide/frontmatter
version: 1
project:
  id: df8b4a16-be6c-4b92-abcc-a95e23b9684a
  # title:
  # description:
  # keywords: []
  # authors: []
  github: https://github.com/2i2c-org/community-docs-template
  # To autogenerate a Table of Contents, run "jupyter-book init --write-toc"
  binder: https://mybinder.org/
  toc:
    - file: content/index.md
    - file: content/kb/index.md
    - file: content/metrics.md

As described above, this will enable the launch-button UI.