diff --git a/book/workflows/edit_book.md b/book/workflows/edit_book.md index 3d9bf59..99b78ea 100644 --- a/book/workflows/edit_book.md +++ b/book/workflows/edit_book.md @@ -360,6 +360,7 @@ The steps above are demonstrated in the figure below, all steps are elaborated o name: user5_demo --- Demonstration, video available [here](https://youtu.be/2ttjBevkEP8) +``` 1. Make some changes to a file in for example VS Code and save them. @@ -367,7 +368,7 @@ Demonstration, video available [here](https://youtu.be/2ttjBevkEP8) Navigate to the terminal in VS code, located at the bottom of the window or by clicking on `Terminal` in the top bar. -You will firstly need to actiavte the right environment. Type the following command: +You will firstly need to activate the right environment. Type the following command: `conda activate jupyter-book-env` @@ -378,7 +379,9 @@ Then we can build the book locally. Make sure you are in the right repository in ``` teachbooks build ``` + Alternatively: + ``` jupyter-book build --all ``` @@ -440,21 +443,32 @@ After committing, click the 🔄 button to push our changes to the remote reposi 2. Once all the changes are made, it can be useful to check the changes locally on your device in order to see how it will look on the website. If all the required environments and packages are downloaded, checking changes locally is fairly easy! Navigate to the terminal in VS code, located at the bottom of the window or by clicking on `Terminal` in the top bar. -You will firstly need to actiavte the right environment. Type the following command: + +You will firstly need to activate the right environment. Type the following command: `conda activate jupyter-book-env` (or the environment in which you have installed the TeachBooks package) -Then we can build the book locally. Make sure you are in the right repository in VS code and type the folloing command: +Then we can build the book locally. Make sure you are in the right repository in VS code and type the following command: -`jupyter-book build book` +``` +teachbooks build +``` -Where book is the name of the folder containing all the files that make up your book. After `jupyter-book` is done running you will get the following: +Alternatively: + +``` +jupyter-book build --all +``` + +Note: use `--all` for the jupyter-book whenever building a book to make sure the table of contents fully updates. Or alternatively, delete the old `_build` folder before building the new book. + +Where book is the name of the folder containing all the files that make up your book. After `teachbooks` is done running you will get the following: ```{figure} ../figures/buildbook.PNG -Output. +Output ``` Paste the last line into your browser to see the updated changes. @@ -465,6 +479,9 @@ Sometimes there are problems building the book. It could be that the building re `pip install -r requirements.txt --upgrade` ``` + +If your book includes interactive element a webserver is required to host the book. If you want to do this locally, you can make use of (the teachbooks package to start up a local webserver)[setup-local-server] + 3. If you are satisfied with your changes, you can select the files ready to be added to Git-timeline (staging) The staging GitHub Desktop assumes you want to stage all files. These files will show up on the left side bar when you open GitHub Desktop. You can unselect some of them (unstaging them) by clicking on the *check*. @@ -487,12 +504,6 @@ Alternatively, you can also click on `Push origin` in the top bar. Example Image -```{Note} - -Missing from this chapter: startup python server. - -You can read more about it [here](/book/installation-and-setup/jupyter-book-setup.html#view-the-book-using-a-local-webserver) -``` ```` ````` `````` @@ -537,21 +548,32 @@ Choose one of the options to resolve the merge conflict. You now have updated yo 4. Once all the changes are made, it can be useful to check the changes locally on your device in order to see how it will look on the website. If all the required environments and packages are downloaded, checking changes locally is fairly easy! Navigate to the terminal in VS code, located at the bottom of the window or by clicking on `Terminal` in the top bar. -You will firstly need to actiavte the right environment. Type the following command: + +You will firstly need to activate the right environment. Type the following command: `conda activate jupyter-book-env` (or the environment in which you have installed the TeachBooks package) -Then we can build the book locally. Make sure you are in the right repository in VS code and type the folloing command: +Then we can build the book locally. Make sure you are in the right repository in VS code and type the following command: -`jupyter-book build book` +``` +teachbooks build +``` -Where book is the name of the folder containing all the files that make up your book. After `jupyter-book` is done running you will get the following: +Alternatively: + +``` +jupyter-book build --all +``` + +Note: use `--all` for the jupyter-book whenever building a book to make sure the table of contents fully updates. Or alternatively, delete the old `_build` folder before building the new book. + +Where book is the name of the folder containing all the files that make up your book. After `teachbooks` is done running you will get the following: ```{figure} ../figures/buildbook.PNG -Output. +Output ``` Paste the last line into your browser to see the updated changes. @@ -562,6 +584,9 @@ Sometimes there are problems building the book. It could be that the building re `pip install -r requirements.txt --upgrade` ``` + +If your book includes interactive element a webserver is required to host the book. If you want to do this locally, you can make use of (the teachbooks package to start up a local webserver)[setup-local-server] + 5. Select the files ready to be added to Git-timeline (staging) For demonstration purposes, we have created a new Markdown file called `new-chapter.md`, which we want to add to the book. Since this is a new file, Git has no knowledge about its existence yet. I.e., the file is *untracked*. To add new files to our repository, we need to *stage* and *commit* them. To do this, open the Source Control menu in the left side bar. Our new file should appear in this menu: @@ -611,21 +636,32 @@ Choose one of the options to resolve the merge conflict. You now have updated yo 4. Once all the changes are made, it can be useful to check the changes locally on your device in order to see how it will look on the website. If all the required environments and packages are downloaded, checking changes locally is fairly easy! Navigate to the terminal in VS code, located at the bottom of the window or by clicking on `Terminal` in the top bar. -You will firstly need to actiavte the right environment. Type the following command: + +You will firstly need to activate the right environment. Type the following command: `conda activate jupyter-book-env` (or the environment in which you have installed the TeachBooks package) -Then we can build the book locally. Make sure you are in the right repository in VS code and type the folloing command: +Then we can build the book locally. Make sure you are in the right repository in VS code and type the following command: -`jupyter-book build book` +``` +teachbooks build +``` -Where book is the name of the folder containing all the files that make up your book. After `jupyter-book` is done running you will get the following: +Alternatively: + +``` +jupyter-book build --all +``` + +Note: use `--all` for the jupyter-book whenever building a book to make sure the table of contents fully updates. Or alternatively, delete the old `_build` folder before building the new book. + +Where book is the name of the folder containing all the files that make up your book. After `teachbooks` is done running you will get the following: ```{figure} ../figures/buildbook.PNG -Output. +Output ``` Paste the last line into your browser to see the updated changes. @@ -637,6 +673,8 @@ Sometimes there are problems building the book. It could be that the building re ``` +If your book includes interactive element a webserver is required to host the book. If you want to do this locally, you can make use of (the teachbooks package to start up a local webserver)[setup-local-server] + 5. The staging GitHub Desktop assumes you want to stage all files. These files will show up on the left side bar when you open GitHub Desktop. You can unselect some of them (unstaging them) by clicking on the *check*.