|
14 | 14 | "metadata": {}, |
15 | 15 | "source": [ |
16 | 16 | "# Table of Contents\n", |
17 | | - " - [Manage Python project](#Manage-Python-project)\n", |
18 | 17 | " - [References](#References)\n", |
19 | 18 | " - [Introduction](#Introduction)\n", |
20 | 19 | " - [Preparatory exercise](#Preparatory-exercise)\n", |
|
41 | 40 | " - [Exercise on testing](#Exercise-on-testing)\n", |
42 | 41 | " - [Documentation](#Documentation)\n", |
43 | 42 | " - [Why document?](#Why-document?)\n", |
44 | | - " - [How document?](#How-document?)\n", |
| 43 | + " - [How to document?](#How-to-document?)\n", |
45 | 44 | " - [Comments](#Comments)\n", |
46 | 45 | " - [Docstrings](#Docstrings)\n", |
47 | 46 | " - [Type hints](#Type-hints)\n", |
|
137 | 136 | "1. Decide which package you want to use for the following exercises, yours or the [mypackage](https://github.com/empa-scientific-it/mypackage).\n", |
138 | 137 | "1. If you use the `mypackage` fork it to your own GitHub account by clicking on the `Fork` button in the top right corner.\n", |
139 | 138 | "1. Clone the fork to your local machine: `git clone <url-to-your-repository>`.\n", |
140 | | - " The URL can be found by clicking on the `<Code>` dropdown and selecting __HTTPS__ tab.\n", |
141 | | - "1. [Create an access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token#creating-a-personal-access-token-classic) for your account that will be used instead of your password.\n", |
142 | | - " You should enable `workflow`, `write:packages`, `delete:packages`.\n", |
143 | | - " Make sure to store the token in some secure location.\n", |
| 139 | + " The URL can be found by clicking on the `<Code>` dropdown and selecting the __SSH__ tab.\n", |
| 140 | + "\n", |
| 141 | + "<details>\n", |
| 142 | + "<summary>How to set up SSH keys (click to expand)</summary>\n", |
| 143 | + "\n", |
| 144 | + "An SSH key pair is a pair of cryptographic keys (a private key that stays on your machine and a public key that you share with GitHub) that lets you authenticate securely without typing a password every time. [Learn more](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/about-ssh).\n", |
| 145 | + "\n", |
| 146 | + "1. Open the Jupyter Terminal (`File` -> `New Launcher`, then select `Terminal`), and generate an SSH key pair:\n", |
| 147 | + " ```bash\n", |
| 148 | + " ssh-keygen -t rsa\n", |
| 149 | + " ```\n", |
| 150 | + " Hit `Enter` three times to accept the default values.\n", |
| 151 | + "\n", |
| 152 | + "2. In the File Browser, enter the `.ssh` and copy the content of the file named `id_rsa.pub`.\n", |
| 153 | + " ```bash\n", |
| 154 | + " cat ~/.ssh/id_rsa.pub\n", |
| 155 | + " ```\n", |
| 156 | + " Copy the output of this command.\n", |
| 157 | + "\n", |
| 158 | + "3. Go to [github.com](https://github.com), click on your icon (top right corner) and select `Settings`.\n", |
| 159 | + " In the newly opened window, select \"SSH and GPG keys\" and click on \"New SSH key\".\n", |
| 160 | + " Provide a key title (e.g. `python-intro-tutorial`) and paste the key content in the \"Key\" field.\n", |
| 161 | + " Click on \"Add SSH key\".\n", |
| 162 | + "\n", |
| 163 | + "</details>\n", |
144 | 164 | "\n", |
145 | 165 | "<div class=\"alert alert-block alert-info\">\n", |
146 | 166 | "In the following, we will always assume that <code>mypackage</code> is the package you are working on (either yours or the one you have forked).\n", |
|
726 | 746 | "id": "28", |
727 | 747 | "metadata": {}, |
728 | 748 | "source": [ |
729 | | - "## How document?\n", |
| 749 | + "## How to document?\n", |
730 | 750 | "\n", |
731 | 751 | "Usually, the documentation of a package is written in [reStructuredText](https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html) or [Markdown](https://www.sphinx-doc.org/en/master/usage/markdown.html).\n", |
732 | 752 | "However, it is also possible to write the documentation in [Jupyter notebooks](https://jupyter.org/) (as we do in this tutorial).\n", |
|
0 commit comments