|
1 |
| -# Your first TeachBook using the GitHub template |
| 1 | +# QuantEcon WASM project |
2 | 2 |
|
3 |
| -[](https://github.com/TeachBooks/template/actions/workflows/call-deploy-book.yml) |
| 3 | +This repository contains a subset of the [lecture-python-intro](https://intro.quantecon.org/intro.html). |
4 | 4 |
|
5 |
| -The template allows you to start your own TeachBook and hosting that TeachBook online without knowledge on Git, the Jupyter book package, python or anaconda. It doesn't elaborate on the collaborative functionalities of Git or how to edit the book. Please look at our manual (https://teachbooks.io/manual) to find more about that! |
| 5 | +This project is powered by Pyodide kernel which allows us to run the lectures in the browser without |
| 6 | +any installaion. |
6 | 7 |
|
7 |
| -## How to get started |
| 8 | +## Development |
8 | 9 |
|
9 |
| -How to use the template is demonstrated in the figure below, all steps are elaborated on in the following step-by-step tutorial. |
| 10 | +The script `update_lectures.py` is used to fetch the latest version of lectures from the |
| 11 | +[wasm branch of lecture-python-intro series](https://github.com/QuantEcon/lecture-python-intro/tree/wasm). |
10 | 12 |
|
11 |
| - |
12 |
| -Video available [here](https://youtu.be/nN3Oi_MVvF0) |
13 |
| - |
14 |
| - |
15 |
| -1. To get started making your TeachBook with our functionalities, use the [template TeachBook](https://github.com/TeachBooks/template) as template: |
16 |
| - |
17 |
| - |
18 |
| - |
19 |
| -2. Fill in a repository name, this name will be used in the future url of your book: |
20 |
| - |
21 |
| - |
22 |
| - |
23 |
| -3. You can choose for `Private` only if you've GitHub Pro, GitHub Team, GitHub Enterprise Cloud, or GitHub Enterprise Server. Otherwise, you won't be able to publish your TeachBook online. Furthermore, it prevents people from contributing to your book, making your book essentially 'closed' instead of 'open. |
24 |
| - |
25 |
| -4. (Only required for private repositories:) Create a Personal Access Token (classic) with at least the scopes `repo`, `read:org` and `gist` as described in the [github documentation](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens), and add this token with the name `GH_PAT` as a `Repository secret` or `Organization secret` (`Settings` > `Secrets and variables` > `Actions` > `Repository secrets` or `Organization secrets`). |
26 |
| - |
27 |
| -5. You need to activate GitHub pages so that your website is published to the internet. As long as you don't do this your TeachBook is not published online. Actually, now that you've taken this template our workflow tries to publish it to GitHub pages, which you didn't have the chance to activate yet. That's why you probably received an email with 'call-deploy-book: Some jobs were not successful' and you see the failed job under `Initial commit`. You can activate GitHub pages by setting the source for GitHub pages to GitHub Actions under `Settings` - `Pages` - `Build and deployment` - `Source` - `GitHub Actions`: |
28 |
| - |
29 |
| - |
30 |
| - |
31 |
| -6. Make an edit to the TeachBook by editing and committing changes to one of the files in the `book/` subdirectory (available under `Code`). Now checkout the progress of the publishing workflow under `Actions` - `All workflows` - `call-deploy-book` -`<the most recent workflow run>`. Remember, the first commit which is there has failed because GitHub Pages wasn't activated at the time of `Initial commit`, you could also re-run that job if you don't want to make an edit. You can do so by running the workflow from `Actions` - `All workflows` - `call-deploy-book` - `Initial commit` - `Re-run all jobs` - `Re-run jobs`: |
32 |
| - |
33 |
| - |
34 |
| - |
35 |
| -7. When the workflow has finished, visit your build TeachBook at `https://<username or organiszation_name>.github.io/<repository_name>` (case sensitive). For our example it is [https://dummydocent.github.io/test_book_from_template/](https://dummydocent.github.io/test_book_from_template/) for the shown repository. These links are visible in the action's summary as well, as shown in the figure of step 4. |
36 |
| - |
37 |
| -Additional tip: |
38 |
| -Set the repository website as your GitHub Pages website under `Code`- `About` - `Settings icon` - `Website` - `Use your GitHub Pages Website` |
| 13 | +In order to build and test the project locally, please install the required libraries using |
| 14 | +``` |
| 15 | +pip install -r requirements.txt |
| 16 | +``` |
39 | 17 |
|
40 |
| - |
| 18 | +And run a local server using |
| 19 | +``` |
| 20 | +teachbooks serve |
| 21 | +``` |
41 | 22 |
|
42 |
| -## Features |
43 |
| -- A github repository structure for making a [Jupyter Book](https://github.com/executablebooks/jupyter-book) (`/book`) |
44 |
| -- An empty TeachBook containing an intro page on root, an example markdown page, an example jupyter notebook page, an example references page. and an example credits page. (`/book/_toc.yml`, `/book/_config.yml`, `/book/credits.md`, `/book/intro.md`, `/book/references.md`, `/book/some_content/overview.md`, `/book/some_content/text_and_code.ipynb`) |
45 |
| -- A file ready for adding references (`references.bib`, `/book/references.md`) |
46 |
| -- An example favicon (web browser icon) (`/book/figures/favicon.ico`, `book/_config.yml`.) |
47 |
| -- An example logo (`/book/figures/TUDelft_logo_rgb.png`, `/book/config.yml`) |
48 |
| -- The configuration files set ready to make your Jupyter Notebooks pages work with [live code using our sphinx-thebe extension](https://teachbooks.io/manual/features/live_code.html) and our recommended settings (`/book/config.yml`) |
49 |
| -- An example of setting up preprocessing your table of contents to hide certain draft chapters for eg. students (`_toc.yml`) |
50 |
| -- A file containing all the recommended software packages (`requirements.txt`) |
51 |
| -- A file containing the recommended license CC BY 4.0 (`LICENSE.md`) |
52 |
| -- Our [GitHub workflow for publishing your TeachBook to GitHub Pages](https://github.com/TeachBooks/deploy-book-workflow) (`.github/workflow/call-deploy-book.yml`) |
53 |
| -- A gitignore file containing standard python filetype to ignore (`.gitignore`) |
54 |
| -- A readme containing information how to use the template, which can adjusted after using the template (`README.md`) |
| 23 | +To stop the server use: |
| 24 | +``` |
| 25 | +teachbooks serve stop |
| 26 | +``` |
55 | 27 |
|
56 |
| -## Contribute |
57 |
| -This tool's repository is stored on [GitHub](https://github.com/TeachBooks/template). The `README.md` of the branch `manual_description` is also part of the [TeachBooks manual](https://teachbooks.io/manual/external/template/README.html) as a submodule. If you'd like to contribute, you can create a fork and open a pull request on the [GitHub repository](https://github.com/TeachBooks/template). To update the `README.md` shown in the TeachBooks manual, create a fork and open a merge request for the [GitHub repository of the manual](https://github.com/TeachBooks/manual). If you intent to clone the manual including its submodules, clone using: `git clone --recurse-submodulesgit@github.com:TeachBooks/manual.git`. |
| 28 | +### Update a lecture? |
58 | 29 |
|
| 30 | +In order to update any lecture, it's recommended to update the same lecture in the |
| 31 | +[wasm branch of lecture-python-intro series](https://github.com/QuantEcon/lecture-python-intro/tree/wasm) and |
| 32 | +run the script |
59 | 33 | ```
|
60 |
| -teachbooks build book |
61 |
| -teachbooks serve |
62 |
| -``` |
| 34 | +python update_lectures.py |
| 35 | +``` |
| 36 | + |
| 37 | +This allows us the keep all the lectures up-to-date in a single place and keep this repository a mirror of the |
| 38 | +main repository. |
0 commit comments