|
19 | 19 | " url : https://github.com/yourusername/yourbookrepo # Online location of your book\n",
|
20 | 20 | " path_to_book : path/to/book # Optional path to your book, relative to the repository root\n",
|
21 | 21 | " branch : master # Which branch of the repository should be used when creating links (optional)\n",
|
22 |
| - "```" |
| 22 | + "```\n", |
| 23 | + "\n", |
| 24 | + "The `repository:` configuration line uses `url`, `path_to_book`, and `branch` to find your notebook\n", |
| 25 | + "files. \n", |
| 26 | + "\n", |
| 27 | + "- The `url` should be a GitHub repository that includes your source files used to build the\n", |
| 28 | + " Jupyter Book. Your repository should include:\n", |
| 29 | + " - `_config.yml`\n", |
| 30 | + " - `_toc.yml`\n", |
| 31 | + " - `requirements.txt`: packages for binder or general reproducibility\n", |
| 32 | + " - _the source files in *.ipynb and *.md_\n", |
| 33 | + "- The `path_to_book` should used if your book is in a sub-folder of your repository (e.g. `docs/` or\n", |
| 34 | + " `book/`)\n", |
| 35 | + "- The `branch` should be the branch where your book's source files are stored. It _should not be_\n", |
| 36 | + " the [`gh-pages` branch](https://jupyterbook.org/publish/gh-pages.html). \n" |
23 | 37 | ]
|
24 | 38 | },
|
25 | 39 | {
|
|
37 | 51 | "```\n",
|
38 | 52 | "\n",
|
39 | 53 | "One thing to take into account when choosing the interface is that notebooks written in the [MyST Markdown](../file-types/myst-notebooks.md) text-based format will not be opened as notebooks out-of-the-box.\n",
|
40 |
| - "If you wish for these files to be opened as notebooks then firstly you must ensure that [`jupytext>=0.16`](https://jupytext.readthedocs.io/en/latest/formats.html#myst-markdown) is installed in the Binder/JupyterHub environment for your book (no support for this feature exists in Google Colab). You then have two options:\n", |
| 54 | + " If you wish for these files to be opened as notebooks then firstly you must ensure that [`jupytext>=0.16`](https://jupytext.readthedocs.io/en/latest/formats.html#myst-markdown) is installed in the Binder/JupyterHub environment for your book (no support for this feature exists in Google Colab).\n", |
| 55 | + "You then have two options:\n", |
41 | 56 | "\n",
|
42 | 57 | "- Use the \"classic\" interface, which will then immediately open these files as notebooks.\n",
|
43 | 58 | "- The \"jupyterlab\" interface (at the time of writing) has not yet implemented this behaviour, and so you will need to instruct readers to right-click the Markdown file and click \"Open in notebook editor\"."
|
|
65 | 80 | "```\n",
|
66 | 81 | "\n",
|
67 | 82 | "By adding this configuration, along with the repository url configuration above, Jupyter Book\n",
|
68 |
| - "will insert Binder links to any pages that were built from notebook content." |
| 83 | + "will insert Binder links to any pages that were built from notebook content.\n", |
| 84 | + "\n" |
69 | 85 | ]
|
70 | 86 | },
|
71 | 87 | {
|
|
74 | 90 | "source": [
|
75 | 91 | "## JupyterHub buttons for your pages\n",
|
76 | 92 | "\n",
|
77 |
| - "JupyterHub lets you host an online service that gives users their own Jupyter servers\n", |
78 |
| - "with an environment that you specify for them. It allows you to give users access to\n", |
79 |
| - "resources and hardware that you provision in the cloud, and allows you to authenticate users\n", |
80 |
| - "in order to control who has access to your hardware.\n", |
| 93 | + "JupyterHub lets you host an online service that gives users their own Jupyter servers with an environment that you specify for them.\n", |
| 94 | + "It allows you to give users access to resources and hardware that you provision in the cloud, and allows you to authenticate users in order to control who has access to your hardware.\n", |
81 | 95 | "\n",
|
82 |
| - "Similar to Binder link buttons, you can also automatically include interact links that send\n", |
83 |
| - "your readers to a JupyterHub that is running a live, interactive version of your page. This\n", |
84 |
| - "is accomplished using the [nbgitpuller](https://github.com/jupyterhub/nbgitpuller) server\n", |
85 |
| - "extension.\n", |
| 96 | + "Similar to Binder link buttons, you can also automatically include interact links that send your readers to a JupyterHub that is running a live, interactive version of your page.\n", |
| 97 | + "This is accomplished using the [nbgitpuller](https://github.com/jupyterhub/nbgitpuller) server extension.\n", |
86 | 98 | "\n",
|
87 |
| - "You can configure the location of the JupyterHub (which you may set up on your own using a guide\n", |
88 |
| - "such as [zero to jupyterhub for kubernetes](https://z2jh.jupyter.org) or [the littlest jupyterhub](https://tljh.jupyter.org)) with the following configuration:\n", |
| 99 | + "You can configure the location of the JupyterHub (which you may set up on your own using a guide such as [zero to jupyterhub for kubernetes](https://z2jh.jupyter.org) or [the littlest jupyterhub](https://tljh.jupyter.org)) with the following configuration:\n", |
89 | 100 | "\n",
|
90 | 101 | "```yaml\n",
|
91 | 102 | "launch_buttons:\n",
|
92 | 103 | " jupyterhub_url: \"your-hub-url\" # The URL for your JupyterHub. (e.g., https://datahub.berkeley.edu)\n",
|
| 104 | + "```\n", |
| 105 | + "\n", |
| 106 | + "On your JupyterHub server, you need two dependencies installed:\n", |
| 107 | + "1. To clone the notebook with the launch link, the server needs\n", |
| 108 | + "[`nbgitpuller`](https://jupyterhub.github.io/nbgitpuller/). \n", |
| 109 | + "\n", |
| 110 | + "2. To open myst-markdown as notebooks, the server needs\n", |
| 111 | + "[`jupytext>=0.16`](https://jupytext.readthedocs.io/en/latest/formats.html#myst-markdown). \n", |
| 112 | + "\n", |
| 113 | + "You can add the following line to your `DockerFile`:\n", |
| 114 | + "```\n", |
| 115 | + "RUN pip install jupytext nbgitpuller\n", |
93 | 116 | "```"
|
94 | 117 | ]
|
95 | 118 | },
|
|
99 | 122 | "source": [
|
100 | 123 | "## {term}`Google Colab` buttons for your pages\n",
|
101 | 124 | "\n",
|
102 |
| - "If your Jupyter Book is hosted online on GitHub, you can automatically insert buttons that link to the Jupyter Notebook running on [Google Colab](https://colab.research.google.com/). When a user clicks the button, they'll be taken to a live version of the page.\n", |
| 125 | + "If your Jupyter Book is hosted online on GitHub, you can automatically insert buttons that link to the Jupyter Notebook running on [Google Colab](https://colab.research.google.com/).\n", |
| 126 | + "When a user clicks the button, they'll be taken to a live version of the page.\n", |
103 | 127 | "\n",
|
104 | 128 | "Similar to Binder link buttons, you can automatically include Google Colab link buttons with the following configuration in `_config.yml`:\n",
|
105 | 129 | "\n",
|
|
0 commit comments