diff --git a/.github/workflows/call-deploy-book.yml b/.github/workflows/call-deploy-book.yml new file mode 100644 index 0000000..bec1772 --- /dev/null +++ b/.github/workflows/call-deploy-book.yml @@ -0,0 +1,24 @@ +name: call-deploy-book + +on: + push: + branches: + - '**' + # If your git repository has the Jupyter Book within some-subfolder next to + # unrelated files, you can make this run only if a file within that specific + # folder (or the workflow file itself) has been modified. + # + paths: + - book/** + - .github/workflows/call-deploy-book.yml + workflow_dispatch: + +jobs: + call-workflow: + uses: TeachBooks/deploy-book-workflow/.github/workflows/deploy-book.yml@main + secrets: inherit + permissions: + contents: read + pages: write + id-token: write + diff --git a/README.md b/README.md index f7d9577..d3d93c6 100644 --- a/README.md +++ b/README.md @@ -4,4 +4,6 @@ A short introduction to Git, VSCode and Jupyter Books for teachers and TA's. Cur ## Contributing -Feedback is always welcome. If something doesn't work, or if you have suggestions, you can always make an issue on the Issue Board or make a Merge Request. +Feedback is always welcome. If something doesn't work, or if you have suggestions, you can always make an issue on the Issue Board or make a Merge Request. + +If you've questions, contact Tom van Woudenberg, Robert Lanzafame or our TAs Julie Kirsch at TeachBooks@tudelft.nl, also for non-TU Delft account holders. TU Delft account holder can also contact us in the [MS Teams Open Interactive Textbooks Community](https://teams.microsoft.com/l/team/19%3Ah9-uRcP_yYauh-VuoPFozJVUvHVOB4a0mz1ZWvh4q4Q1%40thread.tacv2/conversations?groupId=3e88c1f3-4a4f-483a-a366-7e617de9ba99&tenantId=096e524d-6929-4030-8cd3-8ab42de0887b) \ No newline at end of file diff --git a/book/_config.yml b/book/_config.yml index 4322295..3c7269e 100644 --- a/book/_config.yml +++ b/book/_config.yml @@ -1,5 +1,5 @@ title: TeachBooks Manual -author: TeachBooks Team, built with Jupyter Book, CC BY 4.0 +author: TeachBooks Team from Delft university of Technology, built with TeachBooks and Jupyter Book, CC BY 4.0 logo: images/Logo_without_background.png diff --git a/book/_toc.yml b/book/_toc.yml index 7589782..15f9117 100644 --- a/book/_toc.yml +++ b/book/_toc.yml @@ -6,7 +6,6 @@ parts: chapters: - file: installation-and-setup/user_types - file: installation-and-setup/git - - file: installation-and-setup/choose_platforms.md - file: installation-and-setup/overview sections: - file: installation-and-setup/vscode-setup @@ -22,7 +21,7 @@ parts: - file: workflows/edit_book - file: workflows/check_changes_online - file: workflows/merge_request - - file: workflows/publish + - file: installation-and-setup/organize-team - caption: Features chapters: - file: basic-features/overview diff --git a/book/examples/example_gumbel.ipynb b/book/examples/example_gumbel.ipynb index 9095c4c..e23cc7a 100644 --- a/book/examples/example_gumbel.ipynb +++ b/book/examples/example_gumbel.ipynb @@ -34,20 +34,6 @@ "To complete this assignment, you can use `numpy`, `matplotlib` and from the `math` library, `log` and `e` (these are imported for you when you inialize the notebook)." ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": { - "tags": [ - "thebe-remove-input-init" - ] - }, - "outputs": [], - "source": [ - "import micropip\n", - "await micropip.install(\"ipywidgets\")" - ] - }, { "cell_type": "code", "execution_count": 2, diff --git a/book/examples/grading.py b/book/examples/grading.py new file mode 100644 index 0000000..c282bf3 --- /dev/null +++ b/book/examples/grading.py @@ -0,0 +1,16 @@ +from IPython.display import display +import ipywidgets as widgets + +def check(f): + def wrapper(*args, **kwargs): + output = widgets.Output() + button = widgets.Button(description="Check Answer(s)") + @output.capture(clear_output=True,wait=True) + def _inner_check(button): + try: + f(*args, **kwargs) + except: + print("Something went wrong, have you filled all the functions and run the cells?") + button.on_click(_inner_check) + display(button, output) + return wrapper diff --git a/book/external/deploy-book-workflow b/book/external/deploy-book-workflow index 32e1eb8..d5eab25 160000 --- a/book/external/deploy-book-workflow +++ b/book/external/deploy-book-workflow @@ -1 +1 @@ -Subproject commit 32e1eb8725fe4c63612a13f7467491cc9765d95e +Subproject commit d5eab25a29e2cc558ec449577dab669c02758a11 diff --git a/book/external/template b/book/external/template index 1f74f5f..7165661 160000 --- a/book/external/template +++ b/book/external/template @@ -1 +1 @@ -Subproject commit 1f74f5f2cf71a282e29b9a96a61bb8a140b9c6ab +Subproject commit 71656612afa24342f345d9e113553b8ff3cdf4b1 diff --git a/book/features/creating_basic_HTML_elements.md b/book/features/creating_basic_HTML_elements.md index 3d44023..806395d 100644 --- a/book/features/creating_basic_HTML_elements.md +++ b/book/features/creating_basic_HTML_elements.md @@ -57,7 +57,7 @@ The first few lines of our JavaScript code are simple. To scale our element with Next, we may want to define some functions for our element. The first function `linspace` is simply creates `resolution` points between a `start` and `end` value, similar to `numpy.linspace` in Python. The second and third functions evaluate the pdf and cdf of a standard Gaussian distribution for a given `x` value. -```html +``` function linspace(start, end, resolution) { var spacing = []; // Go through a for-loop @@ -189,7 +189,7 @@ Now, let us add actual content. We start by creating 201 equally-spaced points o Next, we concatenate our `x` and `pdf` vectors into a list of dictionaries, which we then convert into pixel coordinates with a `valueline_pdf` function we create. Finally, we add it to the subplot as a `path` via the `svg.append("path")` function. In addition, we want to represent the fact that the cdf (which we will later plot on the right) represents the integral of all pdf values to the left of the current x-value. To this end, we want to create a filled shape that highlights this area. We can do so by creating another path that follows the pdf from the left border to the currently selected value (initially: `x=0`), then moves back to the subplot origin along the x-axis. The path-information `data_fill` is created the same way as before, but now we add it as a `svg.append("path")` that has the `fill` attribute, which - as the name implies - fills the region inside it with a solid color. -```html +``` // Evaluate the normal pdf var x = linspace(-3, 3, 201); var pdf = standard_Gaussian_pdf(x); @@ -252,7 +252,7 @@ Next, we concatenate our `x` and `pdf` vectors into a list of dictionaries, whic The next block essentially repeats the same procedure for the right subplot, but replaces the pdf evaluation with a cdf evaluation. We also add a dashed horizontal line that marks the integral value on the y-axis. Go through the code and see if you recognize parallels to the code above. -```html +``` // Define a subplot for the standard normal const y_limits_cdf = [0, 1]; const window_x_cdf = [width * 0.585, width * 0.985]; @@ -367,7 +367,7 @@ One of the nice things about these interactive JavaScript elements is that you c Finally, we close all open environments, and are done with this simple interactive element! -```html +``` // Shift the marker around on mouseover; restrict it to the contour var movex, movey, xpos diff --git a/book/features/live_code.ipynb b/book/features/live_code.ipynb index 0c356e7..1111605 100644 --- a/book/features/live_code.ipynb +++ b/book/features/live_code.ipynb @@ -85,7 +85,7 @@ "If you push to main, you can test the interactivity on the book-draft website as well.\n", "\n", "## Custom cell tags\n", - "With the extended functionality of live code, additional cell tags have been developed to be added to cells in any .ipynb file, next to the [existing tags] of the jupyter book (https://jupyterbook.org/en/stable/content/metadata.html):\n", + "With the extended functionality of live code, additional cell tags have been developed to be added to python cells (not markdown cells) in any .ipynb file, next to the [existing tags] of the jupyter book (https://jupyterbook.org/en/stable/content/metadata.html):\n", "- `disable-execution-cell` disables the ability to execute the cell when thebe is activated. This might be useful if you notebook file includes interactivity for only a part of the coding cells\n", "- `disable-execution-page` disables the ability to execute the entire page. This might be useful if you use python code for creating a page, but the code is not part of the actual content of the book.\n", "- `auto-execute-page` automatically starts the thebe live coding functionality whenever the page is opened. This is particularly useful if you're using widgets on a page.\n", diff --git a/book/installation-and-setup/choose_platforms.md b/book/installation-and-setup/choose_platforms.md index 0fe5589..2a4232a 100644 --- a/book/installation-and-setup/choose_platforms.md +++ b/book/installation-and-setup/choose_platforms.md @@ -9,7 +9,7 @@ Now that you can start, there's a first choice to be made, where to host your bo - Github allows you to host your book on the GitHub server using GitHub pages (to be recognized by the `.github.io/` url, for example the [template book](https://teachbooks.github.io/template/)), which takes all the steps of hosting out of your hands. You can also use a custom owned URL, although this requires some additional skills. On TU Delft's GitLab you need a webserver, which is offered by TeachBooks (to be recognized by the url `teachbooks.tudelft.nl/`, for example [this manual](https://teachbooks.tudelft.nl/jupyter-book-manual)) as the TU Delft OIT team (to be recognized by the url `interactivetextbooks.tudelft.nl/`, for example [the TU Delft OIT demo book](https://interactivetextbooks.tudelft.nl/open-textbooks-demonstration/)). For the TU Delft OIT webserver youโ€™re required to publish your book more officially, it cannot be used for viewing your book online in the editing-phase. - On GitHub you can start right away with a git environment and online book using our [template](../external/template/README.md). On GitLab you can set up your own git environment, but you need to be given access by [TeachBooks](mailto:teachbooks@tudelft.nl) or [TU Delft OIT](mailto:Interactive-textbooks@tudelft.nl) to view your build book online. -- On GitHub we developed a [automatic process which builds the book and publishes it online](../external/deploy-book-workflow/README.md) in a very flexible way (publication of multiple version of the book, insights in book building errors, parallel so fast build, custom urls in subdirectories). On GitLab both we and other people at TU Delft have a more simplistic workflow which can be used when you're set up on those Git environments and webservers. +- On GitHub we developed a [automatic process which builds the book and publishes it online](../external/deploy-book-workflow/README.md) in a very flexible way (publication of multiple version of the book, insights in book building errors, parallel so fast build, custom urls in subdirectories). On GitLab both we and other people at TU Delft have a more simplistic workflow which can be used when you're set up on those Git environments and webservers. If you want to use GitLab and make use of the GitHub workflow, you can [mirror your repository to GitHub](https://docs.gitlab.com/ee/user/project/repository/mirror/push.html#set-up-a-push-mirror-from-gitlab-to-github) - Because weโ€™re in control on the server connected to GitLab, we can set up SSO login for visitors of the website. This is not an option for GitHub because we donโ€™t own the server. - Both GitLab and GitHub allow for extensive options for visibility of the source code. If you're using GitHub pages, you need a free organization linked to a free eduational account. The TU Delft GitLab requires SSO login for editing the book. Although this is useful for TU Delft employees, it limits the collaboration with people outside of TU Delft. - GitHub has a nice integration with the [GitHub Desktop application](git-setup_local.md). For GitLab it works as well, but has less functionality. @@ -22,7 +22,7 @@ Here's a table summarizing the information: |--|----------|-------------| | Website to view book online | GitHub pages (`.github.io/`) or custom URL ๐ŸŒ | TeachBooks (`teachbooks.tudelft.nl/`) or TU Delft OIT (`interactivetextbooks.tudelft.nl/`) ๐ŸŽ“ | | Setting up book website | Immediate and automated with [template](../external/template/README.md) โšก๏ธ | Access required by TeachBooks or TU Delft OIT ๐Ÿšง | -| Updating book website | Automated and flexible (multiple version of the book, building error insights, fast, custom urls) ๐Ÿš€ | Automated but simplistic (one or two versions, command-line interface) ๐Ÿ›ต | +| Updating book website | Automated and flexible (multiple version of the book, building error insights, fast, custom urls) ๐Ÿš€ | Automated but simplistic (one or two versions, command-line interface) ๐Ÿ›ต | | Student book access with SSO | Not available for GitHub pages โŒ, optional with custom URL โœ… | Optional โœ… | | Teacher/TA access to Git repository | Private (if part of organization linked to educational account) /public ๐Ÿ‘€ | Private / public / internally TU Delft, editing requires requires SSO login ๐Ÿ‘ฅ | | GitHub Desktop | Well integrated ๐Ÿ˜Ž | Basic integration ๐Ÿ™‚ | diff --git a/book/installation-and-setup/git.md b/book/installation-and-setup/git.md index e99f1f7..6948a84 100644 --- a/book/installation-and-setup/git.md +++ b/book/installation-and-setup/git.md @@ -1,4 +1,4 @@ -# Essential for collaboration: Git +# Collaboration tool: Git ```{admonition} User types :class: tip @@ -19,5 +19,7 @@ GitLab is a cloud-based version control system built around Git. It provides a l GitHub is the same service as GitLab, but it's part of a commercial company (Microsoft). It's the most well-known cloud-based Git provider and provides a lot of functionalities for free for education. It also allows you to host websites on `github.io` eliminating the need for your own / TU Delft webserver, although you don't have full servercontrol. +For first users, we advise you to use GitHub. + ### Additional lessons Software carpentry offers git-lessons if you'd like to learn more than just it's specific use for TeachBooks. The lessons are available [online](https://swcarpentry.github.io/git-novice/) and TU Delft offers these as part of a [Software Carpentry workshop](https://www.tudelft.nl/library/research-data-management/r/training-evenementen/training-voor-onderzoekers/software-carpentry-workshops) \ No newline at end of file diff --git a/book/installation-and-setup/organize-team.md b/book/installation-and-setup/organize-team.md new file mode 100644 index 0000000..fee8b8d --- /dev/null +++ b/book/installation-and-setup/organize-team.md @@ -0,0 +1,55 @@ +# Organize your editing team and tools + +```{admonition} User types +:class: tip +This page is useful for user type 4-5. +``` + +If you want to create a collaborative book for students, there's a few agreements you should make to enhance collaboration and student experience. These are written from our own experience, feel free to deviate or provide your own advice! + +**This page is work in progress** + +## Team +- Define who's in charge of: + - Team organization (administrators), at least user type 4 + - Combining content (maintainers), at least user type 4 + - Editing and reviewing content (editors) +- Define how your review process is taking place. We advice at least a maintainer reviewing each bit o content. +- Make sure people identify themselves as one of the user types. You should have at least one user type 4 or 5. Although this can be a TA, it is advised one of the teachers is comfortable with this user type as well. + +## Tools +- Choose between GitHub and GitLab, as explained below +- If you've chosen for GitHub, start with our [template](../external/template/README.md) +- Define branches in GitHub/GitLab. We advise the following branches: + - A published branch which contains the students' version of this year. This could be called ie. `publish` or `main` or `` + - A development branch which contains all the new content combined but not yet published to students. This could be called `dev` or `main` (depending on whether you prefer having the most recent published version as main or the development branch). + - Branches which will be created during the editing process which contain edits ie. single chapters + - Branches for previous study years which contain each year's version of the book. These could be called `` +- Setup protected branches in GitHub/GitLab to prevent accidental changes +- Add people with GitHub/GitLab permission matching their role and the protected branches. +- Add a readme explaining the way you organized branches and permissions +- Provide explanation on how you'd like to receive feedback in both the readme as the published book. The use of issues (in the book with the issue button) is advised. +- Decide on whether or not to publish your book via Open Interactive Textbooks TU Delft. Publishing will give you a copyright check, ISBN and DOI number but heavily limits the amount of changes you can make to your book. We advise publishing an archived version of your book whenever the academic year is over. + +### GitHub vs GitLab + +- Github allows you to host your book on the GitHub server using GitHub pages (to be recognized by the `.github.io/` url, for example the [template book](https://teachbooks.github.io/template/)), which takes all the steps of hosting out of your hands. You can also use a custom owned URL, although this requires some additional skills. On TU Delft's GitLab you need a webserver, which is offered by TeachBooks (to be recognized by the url `teachbooks.tudelft.nl/`, for example [this manual](https://teachbooks.tudelft.nl/jupyter-book-manual)) as the TU Delft OIT team (to be recognized by the url `interactivetextbooks.tudelft.nl/`, for example [the TU Delft OIT demo book](https://interactivetextbooks.tudelft.nl/open-textbooks-demonstration/)). For the TU Delft OIT webserver youโ€™re required to publish your book more officially, it cannot be used for viewing your book online in the editing-phase. +- On GitHub you can start right away with a git environment and online book using our [template](../external/template/README.md). On GitLab you can set up your own git environment, but you need to be given access by [TeachBooks](mailto:teachbooks@tudelft.nl) or [TU Delft OIT](mailto:Interactive-textbooks@tudelft.nl) to view your build book online. +- On GitHub we developed a [automatic process which builds the book and publishes it online](../external/deploy-book-workflow/README.md) in a very flexible way (publication of multiple version of the book, insights in book building errors, parallel so fast build, custom urls in subdirectories). On GitLab both we and other people at TU Delft have a more simplistic workflow which can be used when you're set up on those Git environments and webservers. If you want to use GitLab and make use of the GitHub workflow, you can [mirror your repository to GitHub](https://docs.gitlab.com/ee/user/project/repository/mirror/push.html#set-up-a-push-mirror-from-gitlab-to-github) +- Because weโ€™re in control on the server connected to GitLab, we can set up SSO login for visitors of the website. This is not an option for GitHub because we donโ€™t own the server. +- Both GitLab and GitHub allow for extensive options for visibility of the source code. If you're using GitHub pages, you need a free organization linked to a free eduational account. The TU Delft GitLab requires SSO login for editing the book. Although this is useful for TU Delft employees, it limits the collaboration with people outside of TU Delft. +- GitHub has a nice integration with the [GitHub Desktop application](git-setup_local.md). For GitLab it works as well, but has less functionality. +- [Utteranc.es](../basic-features/utterances.md) requires a GitHub repository to host the discussions. If you're using a GitLab repository, you need a separate GitHub repository and the discussions and book content is not at the same place. + +If you have doubt about this choice, we advise you to start on GitHub. Moving/duplicating your content to GitLab or hosting to a custom URL is always possible at a later stage. + +Here's a table summarizing the information: +| | GitHub | GitLab | +|--|----------|-------------| +| Website to view book online | GitHub pages (`.github.io/`) or custom URL ๐ŸŒ | TeachBooks (`teachbooks.tudelft.nl/`) or TU Delft OIT (`interactivetextbooks.tudelft.nl/`) ๐ŸŽ“ | +| Setting up book website | Immediate and automated with [template](../external/template/README.md) โšก๏ธ | Access required by TeachBooks or TU Delft OIT ๐Ÿšง | +| Updating book website | Automated and flexible (multiple version of the book, building error insights, fast, custom urls) ๐Ÿš€ | Automated but simplistic (one or two versions, command-line interface) ๐Ÿ›ต | +| Student book access with SSO | Not available for GitHub pages โŒ, optional with custom URL โœ… | Optional โœ… | +| Teacher/TA access to Git repository | Private (if part of organization linked to educational account) /public ๐Ÿ‘€ | Private / public / internally TU Delft, editing requires requires SSO login ๐Ÿ‘ฅ | +| GitHub Desktop | Well integrated ๐Ÿ˜Ž | Basic integration ๐Ÿ™‚ | +| Utteranc.es | Can be linked to same repository ๐Ÿท๏ธ | Requires GitHub repository next to GitLab repository ๐Ÿท๏ธ๐Ÿท๏ธ| \ No newline at end of file diff --git a/book/installation-and-setup/overview.md b/book/installation-and-setup/overview.md index 3db5dcc..eb209c9 100644 --- a/book/installation-and-setup/overview.md +++ b/book/installation-and-setup/overview.md @@ -1,5 +1,10 @@ # Install & authenticate required software +```{admonition} User types +:class: tip +This page is useful for user type 4-5. +``` + Now that the types of users have been explained, you might have an idea which type corresponds to you! The following table will link the relevant installation and setup steps for you. diff --git a/book/installation-and-setup/user_types.md b/book/installation-and-setup/user_types.md index 742aa14..0a92d71 100644 --- a/book/installation-and-setup/user_types.md +++ b/book/installation-and-setup/user_types.md @@ -2,7 +2,7 @@ Different types of users will interact with the website or the Jupyter Books differently and will therefore need to know more or less about the composition of the book. For now we will differentiate 6 types of users. -1. **Students providing feedback on the published website**.
Example Image There are multiple tools of providing feedback in the built book: a) Using the [hypothesis](https://jupyterbook.org/en/stable/interactive/comments/hypothesis.html)-extension which allows public/private highlighting and annotating parts of the book. An example can be seen on the [MUDE website](https://mude.citg.tudelft.nl/book/intro.html). b) Using the [Utterances](https://jupyterbook.org/en/stable/interactive/comments/utterances.html)-extension which allows commenting on pages for books which are hosted on GitHub. Those comments are converted to issues on GitHub for the editors to handle. +1. **Students providing feedback on the published website**.
Example Image There are multiple tools of providing feedback in the built book: a) using the issue button in the top-right corner to directly create issues visible to the editor team. b) Using the [hypothesis](https://jupyterbook.org/en/stable/interactive/comments/hypothesis.html)-extension which allows public/private highlighting and annotating parts of the book. An example can be seen on the [MUDE website](https://mude.citg.tudelft.nl/book/intro.html). c) Using the [Utterances](https://jupyterbook.org/en/stable/interactive/comments/utterances.html)-extension which allows commenting on pages for books which are hosted on GitHub visible for everyone. Those comments are converted to issues on GitHub for the editors to handle. 2. **Colleague providing feedback on the draft website**.
In a similar manner as students, colleages and team members can leave content related comments on the website through extensions. In this way, multiple teachers can give input in the draft of the textbook and course material without requiring and exact understanding of Jupyter Books or GitLab/GitHub. The responsible teacher (or student assistants) can then make the adaptations to the book as recommended by their colleagues. diff --git a/book/intro.md b/book/intro.md index 1471cd6..290839f 100644 --- a/book/intro.md +++ b/book/intro.md @@ -3,4 +3,6 @@ This is an introduction to Git, VS Code and Jupyter Books for teachers and teaching assistants involved in TeachBooks, our platform easing the process of making a
Jupyter book. This book is still work in progress, so feel free to contribute https://gitlab.tudelft.nl/interactivetextbooks-citg/jupyter-book-manual! For more information about teachbooks, visit [https://teachbooks.tudelft.nl/](https://teachbooks.tudelft.nl/). ## Contact -If you encounter any issues, please contact Tom van Woudenberg, Robert Lanzafame or one of our TAs Julie Kirsch at TeachBooks@tudelft.nl. \ No newline at end of file +If you encounter any issues and you've a TU Delft account, report it by clicking --> {fa}`lightbulb` on the top right corner of this page. Or contribute directly by creating a merge request in the [repository](https://gitlab.tudelft.nl/interactivetextbooks-citg/jupyter-book-manual). + +If you've questions, contact Tom van Woudenberg, Robert Lanzafame or our TAs Julie Kirsch at TeachBooks@tudelft.nl, also for non-TU Delft account holders. TU Delft account holder can also contact us in the [MS Teams Open Interactive Textbooks Community](https://teams.microsoft.com/l/team/19%3Ah9-uRcP_yYauh-VuoPFozJVUvHVOB4a0mz1ZWvh4q4Q1%40thread.tacv2/conversations?groupId=3e88c1f3-4a4f-483a-a366-7e617de9ba99&tenantId=096e524d-6929-4030-8cd3-8ab42de0887b) \ No newline at end of file diff --git a/book/workflows/branches.md b/book/workflows/branches.md index 464f74e..6535e1b 100644 --- a/book/workflows/branches.md +++ b/book/workflows/branches.md @@ -80,19 +80,15 @@ Tip: It makes sense to give the branch a name related to the content you will be As user type 4 and 5, you make changes to the book locally on your computer rather than online on GitLab/GitHub. This allows you to create more complex and interactive sections to your book. Before you can start, there are a few preparatory steps you need to take. -**Cloning** +In order to create your own version, you will first have to open the repository. Then, you will need to clone the repository to your computer. This procedure is called cloning. -In order to create your own version, you will first have to open the repositery. Then, you will need to clone the repositery to your computer. This procedure is called cloning. - -**Branching** - -If your repositery is already cloned on your computer, you are almost ready to start editing the book. However, remember that you are most likely not the only person making changes to the book. To keep an overview of the changes made by you and your colleages, it is important that changes are first made in a 'copy' of the book and are then merged into the final version. This is done through branching! You can create your version of the book by creating a new version (branch) or you can continue the work in an existing version (checkout branch). +If your repository is already cloned on your computer, you are almost ready to start editing the book. However, remember that you are most likely not the only person making changes to the book. To keep an overview of the changes made by you and your colleages, it is important that changes are first made in a 'copy' of the book and are then merged into the final version. This is done through branching! You can create your version of the book by creating a new version (branch) or you can continue the work in an existing version (checkout branch). `````````{tab-set} -````````{tab-item} Cloning +````````{tab-item} ... when opening repository for first timeโ€ฆ -**1. Open the repository locally using ...** +**(a) ... by finding the repository url from ...** ```````{tab-set} @@ -146,7 +142,7 @@ You have now directly cloned the repository, so you can skip the next step! `````` ``````` -**2. Clone the local repositery with ...** +**(b) ... and opening (cloning) the local repository with ...** ```````{tab-set} ``````{tab-item} ... VS Code @@ -166,10 +162,10 @@ The VS Code welcome screen. ``````{tab-item} ... GitHub Desktop -1. You have previously copied the link of the repositery you would like to clone from GitLab or GitHub. In GitHub Desktop, navigate to the top bar, click on `File` and then on `Clone repositery`. +1. You have previously copied the link of the repository you would like to clone from GitLab or GitHub. In GitHub Desktop, navigate to the top bar, click on `File` and then on `Clone repository`.
- Example Image + Example Image
2. In the top bar click on `URL`. @@ -184,38 +180,18 @@ The VS Code welcome screen. `````` ``````` -**You have now cloned the repositery to your computer and you can start branching.
+**You have now cloned the repository to your computer and you can start branching.
Have a look at the other section!** ```````` -````````{tab-item} Branching +````````{tab-item} ... when working in previously opened repositoryโ€ฆ -**I want to...
-(a) update my repository (pulling) and
-(b) create my own version (branching) or select an existing version (checkout branch) using ...** +**(a) by creating my own version (branching) or select an existing version (checkout branch) ...** -```````{tab-set} -``````{tab-item} ... Git in VS Code - -**1. Update your repositery** - -Since you are working in a repositery with multiple colleagues, it is good practice to make sure your local repositery is up to date before you start branching. This is especially important when you want to work in an existing branch. In that case you want to make sure that the existing branch shows in your local repositery. Therefore, you first need to pull all the changes from the remote repositery to your local repositery. Simply click the Icon with the two arrows. - -```{figure} ../figures/Pull_VS.png -:name: Pull_VS - -Location of the branch menu. -``` -Once your local repositery is up to date you can start to work either in a new branch (new version) or in an existing branch (exisiting version). - -**2. Create your own version by creating a new branch** - -Although it is possible to create new branches in VS Code directly, creating new branches on the remote repositery (on GitLab or GitHub) is better for collaborating because the new branch becomes immediately visible to everyone working in the repositery as opposed to becoming visible after being pushed to the remote repositery. - -Create a new branch in... +Although it is possible to create new branches in VS Code directly, creating new branches on the remote repository (on GitLab or GitHub) is better for collaborating because the new branch becomes immediately visible to everyone working in the repository as opposed to becoming visible after being pushed to the remote repository. `````{tab-set} -````{tab-item} ... GitLab +````{tab-item} ... in GitLab 1. Navigate to the repository of your project. Under the project description, you should see a menu button with a "+" in it (see {numref}`new-branch-button`). Click this button, then click on "New branch". @@ -240,10 +216,7 @@ We're making a new branch called `chapter-2` from the `main` branch. The circled menu is the branch selection menu. ``` - -You have now created a new branch on the remote, make sure to fetch & pull again to see it on the local repositery! ```` - ````{tab-item} ... GitHub 1. Open the repository in which you want to work in. In the top bar you will see your current branch `main` and next to that there is a tab called `Branches`. @@ -271,11 +244,15 @@ Tip: It makes sense to give the branch a name related to the content you will be Example Image -5. jupYou have now created a new branch on the remote, make sure to fetch & pull again to see it on the local repositery! ```` ````` -**3. Work in an existing branch** +**(b) and updating my local repository (checking out and pulling) ...** + +```````{tab-set} +``````{tab-item} ... with Git in VS Code + +1. Open own version (checking out) If you want to work in an existing branch you need to *check out* our new branch in VS Code. *Checking out* means that we're changing our working branch (i.e., the one to which we will be committing our changes) from one to the other. @@ -294,91 +271,25 @@ Location of the branch menu. The branch selection menu, where our new branch has shown up. From this menu you can also select (checkout in git terms) another existing branch. ``` + +2. Update your local repository + +Since you are working in a repository with multiple colleagues, it is good practice to make sure your local repository is up to date. This is especially important when you want to work in an existing branch. In that case you want to make sure that the existing branch shows in your local repository. Therefore, you first need to pull all the changes from the remote repository to your local repository. Simply click the Icon with the two arrows. + +```{figure} ../figures/Pull_VS.PNG +:name: Pull_VS + +Location of the branch menu. +``` + `````` -``````{tab-item} ... GitHub Desktop +``````{tab-item} ... with GitHub Desktop -**1. Update your repositery** - -Since you are working in a repositery with multiple colleagues, it is good practice to make sure your local repositery is up to date before you start branching. This is especially important when you want to work in an existing branch. In that case you want to make sure that the existing branch shows in your local repositery. Therefore, you first need to pull all the changes from the remote repositery to your local repositery. - -This synchronizes the remote repositery with your local repositery on your computer. Click on `Fetch` in the top bar. Then on the same place, click on 'Pull'. - -
- Example Image -
- -**2. Create your own version by creating a new branch.** - -Although it is possible to create new branches in GitHub Desktop directly, creating new branches on the remote repositery (on GitLab or GitHub) is better for collaborating because the new branch becomes immediately visible to everyone working in the repositery as opposed to becoming visible after being pushed to the remote repositery. - -Create a new branch in... - -`````{tab-set} -````{tab-item} ... GitLab - -1. Navigate to the repository of your project. Under the project description, you should see a menu button with a "+" in it (see {numref}`new-branch-button`). Click this button, then click on "New branch". - -```{figure} ../images/gitlab-branch.png -:name: new-branch-button - -Click the highlighted button to make a new branch. -``` - -2. A new page opens ({numref}`new-branch-menu`), on which you can specify the name of your branch and the source branch. Try to think of a good name for your branch. For example, `chapter-2` is a suitable name if we're going to be working on Chapter 2 of our book. After you've made sure that the selected source branch is correct, click "Create branch". - -```{figure} ../images/gitlab-branch-name.png -:name: new-branch-menu - -We're making a new branch called `chapter-2` from the `main` branch. -``` - -3. You should be sent back to an overview page of your repository. In the branch selection menu (see {numref}`new-branch-repo`), it should now say `chapter-2` instead of `main`. - -```{figure} ../images/gitlab-new-branch-repo.png -:name: new-branch-repo - -The circled menu is the branch selection menu. -``` - -You have now created a new branch on the remote, make sure to fetch & pull again to see it on the local repositery! -```` - -````{tab-item} ... GitHub - -1. Open the repository in which you want to work in. In the top bar you will see your current branch `main` and next to that there is a tab called `Branches`. - -
- Example Image -
- -2. Clicking on `Branches` will bring you to an overview of all the branches in the repository. Click on the green `Create Branch` button. - -
- Example Image -
- -3. Finally, give your branch a name and specifiy the source branch.
-Tip: It makes sense to give the branch a name related to the content you will be creating or altering. - -
- Example Image -
- -4. You will find your new branch in the drop down menu as seen on the figure below. You can then select your new branch and start working in it (new version). - -
- Example Image -
- -5. You have now created a new branch on the remote, make sure to fetch & pull again to see it on the local repositery! -```` -````` - -**3. Work in an existing branch** +1. Open own version (checking out) The next step is to *check out* our new branch in GitHub Desktop. *Checking out* means that we're changing our working branch (i.e., the one to which we will be committing our changes) from one to the other. -In GitHub Desktop, the top bar has a menu called `Current Branch`. By clicking on it you can see all the branches you created on the remote repositery. +In GitHub Desktop, the top bar has a menu called `Current Branch`. By clicking on it you can see all the branches you created on the remote repository. ```{figure} ../figures/CheckOutBranch_GitHubDesktop.PNG ``` @@ -390,6 +301,17 @@ Leave your changes (stashed) on your working branch, in this case I was working 3. Check that the branch is indeed checked out by looking at the branch menu at the the top left again; the current branch should say the name. +4. Update your repository** + +Since you are working in a repository with multiple colleagues, it is good practice to make sure your local repository is up to date. This is especially important when you want to work in an existing branch. In that case you want to make sure that the existing branch shows in your local repository. Therefore, you first need to pull all the changes from the remote repository to your local repository. + +This synchronizes the remote repository with your local repository on your computer. Click on `Fetch` in the top bar. Then on the same place, click on 'Pull'. + +
+ Example Image +
+ + `````` ``````` **Now that you have created and checked out your new branch, you can start {ref}`making and committing changes `.** diff --git a/book/workflows/check_changes_online.md b/book/workflows/check_changes_online.md index 818d4c7..5d9315a 100644 --- a/book/workflows/check_changes_online.md +++ b/book/workflows/check_changes_online.md @@ -12,25 +12,20 @@ Now that you've pushed your changes online, it's time to check the change in the `````{tab-set} ````{tab-item} In GitLab -At the moment this is not possible, but the workflow will soon be the same as for GitHub. +At the moment this is not possible. +However, what you can do is 'mirror' your GitLab repository to GitHub. This will copy your content automatically (but maximum once every 5 minutes) to GitHub. This allows you to use the TeachBook's GitHub actions. + +Instructions on how to set up mirroring are provided here: https://docs.gitlab.com/ee/user/project/repository/mirror/push.html#set-up-a-push-mirror-from-gitlab-to-github + ```` ````{tab-item} In GitHub -1. Enable GitHub Pages on your repositery. Note that if you use the Teachbooks template this is probably already done! +Once GitHub Pages is enabled and your book is published, you can view it by visiting the GitHub Pages URL for your repository. A summary can be seen under the `Actions`- `All workflows` - `call-deploy-book` in GitHub. It shows you a descriptive summary. +The summary also provides build error messages, which you might fix in a new commit. -2. Once your book files are pushed to your GitHub repository you can view the book. Make sure you wait for the action to finish (GitHub Desktop shows progress if its part of a pull request, VS Code shows progress with the GitHub Actions addon). +If this is not activated yet, you can do so as describe [here](../external/deploy-book-workflow/README). Here you can also find more information. -3. Viewing the Book: Once GitHub Pages is enabled and your book is published, you can view it by visiting the GitHub Pages URL for your repository. The URL will typically be in the format https://.github.io/. - -Alternatively you can find it in the settings - -- Go to your GitHub repository's settings. -- Scroll down to the "GitHub Pages" section (left side-bar: pages) -- Copy the link or click on `Visit site` - -
- Example Image -
+```` ````` You can keep on [editing](edit_book) and checking your changes until you're satisfied and ready for a review by a colleague. \ No newline at end of file diff --git a/book/workflows/collaboration.md b/book/workflows/collaboration.md index edb4d24..08496da 100644 --- a/book/workflows/collaboration.md +++ b/book/workflows/collaboration.md @@ -7,7 +7,7 @@ This page is useful for user type 3, 4 and 5. A jupyter book is composed out of many files which contain the educational content produced by you. Through the use of branches it is possible to work on the book at the same time as your team-members. Working on content for the book is mainly individual work, the beauty of Git comes in when everybody's changes are merged into the main branch. -We have previously introduced the notions of using Git in the online environment (remote) or locally. All the (text, figures, etc.) files that make up the book are contained on the remote repository on GitLab or GitHub. This could be on an open repository on `gitlab.com` or `github.com`. In the context of creating educational books for students at TU Delft, the repository will most likely be located on `gitlab.tudelft.nl` or `github.com/teachbooks`. +We have previously introduced the notions of using Git in the online environment (remote) or locally. All the (text, figures, etc.) files that make up the book are contained on the remote repository on GitLab or GitHub. This could be on an open repository on `gitlab.com` or `github.com`. In the context of creating educational books for students at TU Delft, the repository will most likely be located on `gitlab.tudelft.nl` or `github.com/teachbooks`. If this is the first time you interact with books, you're advise to use `github.com`. The steps involved are as follows: @@ -26,18 +26,20 @@ The steps involved are as follows: ````{tab-item} Open repository for first time... **... by
-(a) opening the repository locally (cloning) and
-(b) creating your own version (branching) or selecting existing version (checkout branch):** +(a) creating your own version (branching) +(b) opening the repository locally (cloning) and selecting correct version (checkout branch):**
+ - branching - cloning - - branching / checkout branch + - checkout branch ```` ````{tab-item} Work in previously opened repository... **... by
-(a) updating your repository (pulling) and
-(b) creating your own version (branching) or select existing version (checkout branch):** - +(a) creating your own version (branching)
+(b) updating your repository (pulling) and select correct version (checkout branch):** + + - branching - pulling - branching / checkout branch ```` @@ -126,7 +128,6 @@ The steps involved are as follows: ```` `````` ``````` - 4. **Check candles nline** + 4. **Check changes online** 5. **Repeat steps 3 and 4 until you're satisfied** - 6. **Reviewing (merge request), (eventually repeat steps 3 and 4) and combine (merging) your version with main draft version of book** - 7. **Publish changes to student version of the book (merge request)** + 6. **Reviewing (merge request), (eventually repeat steps 3 and 4) and combine (merging) your version with main draft version of book** \ No newline at end of file diff --git a/book/workflows/edit_book.md b/book/workflows/edit_book.md index f79e0b4..7b7af0e 100644 --- a/book/workflows/edit_book.md +++ b/book/workflows/edit_book.md @@ -11,9 +11,9 @@ Suppose we are writing a new chapter, or are updating an existing chapter for ou `````{tab-set} ````{tab-item} ... GitLab -In GitLab, you can directly make changes in the files on the remote repositery. You can make changes to the files already in the repositery using the text editor but you can also upload new files! +In GitLab, you can directly make changes in the files on the remote repository. You can make changes to the files already in the repository using the text editor but you can also upload new files! -1. Navigate to the repositery you want to work in. +1. Navigate to the repository you want to work in and make sure you're in the correct branch. 2. Create a new file by clicking on the plus button in the top bar. You can either create an entirely new file by clicking `New File` or if you already have created a file you can upload it by clicking `Upload File`. @@ -21,25 +21,25 @@ In GitLab, you can directly make changes in the files on the remote repositery. Example Image -3. In the new window, you can start typing your content. Give your file a name and make sure to use the markdown extension: `Chapter1.md`. Once you are done, commit the new file to the repositery by clicking the blue button `Commit changes`. +3. In the new window, you can start typing your content. Give your file a name and make sure to use the markdown extension: `Chapter1.md`. Once you are done, commit the new file to the repository by clicking the blue button `Commit changes`.
Example Image
-4. In case you want to make changes to an existing file, navigate to the file in your remote repositery. Then click the blue button called `Edit` and select the option `Edit single file`. +4. In case you want to make changes to an existing file, navigate to the file in your remote repository. Then click the blue button called `Edit` and select the option `Edit single file`.
Example Image
-5. Make your changes in the text editor and when you are ready, commit your changes to the remote repositery by clicking on the blue `Commit changes` button. +5. Make your changes in the text editor and when you are ready, commit your changes to the remote repository by clicking on the blue `Commit changes` button.
Example Image
-6. In case you added a new file, you also need to include it table of contents of your book! The table of contents is specified in a file called `toc.yml` and it is already included in your repositery if you used the teachbooks template. +6. In case you added a new file, you also need to include it table of contents of your book! The table of contents is specified in a file called `toc.yml` and it is already included in your repository if you used the teachbooks template.
Example Image @@ -49,9 +49,9 @@ You can edit it and commit the changes in the same manner as with markdown (.md) ```` ````{tab-item} ... GitHub -In GitHub, you can directly make changes in the files on the remote repositery. You can make changes to the files already in the repositery using the text editor but you can also upload new files! +In GitHub, you can directly make changes in the files on the remote repository. You can make changes to the files already in the repository using the text editor but you can also upload new files! -1. Navigate to the repositery you want to work in. +1. Navigate to the repository you want to work in and make sure you're in the correct branch. 2. Create a new file by clicking on the button called `Add file` in the top bar. You can either create an entirely new file by clicking `Create new File` or if you already have created a file you can upload it by clicking `Upload files`. @@ -59,25 +59,25 @@ In GitHub, you can directly make changes in the files on the remote repositery. Example Image
-3. In the new window, you can start typing your content. Give your file a name and make sure to use the markdown extension: `Chapter1.md`. Once you are done, commit the new file to the repositery by clicking the green button `Commit changes`. +3. In the new window, you can start typing your content. Give your file a name and make sure to use the markdown extension: `Chapter1.md`. Once you are done, commit the new file to the repository by clicking the green button `Commit changes`.
Example Image
-4. In case you want to make changes to an existing file, navigate to the file in your remote repositery. Then click the downward pointing arrow on the very left in the top bar. Select the option `Edit in place`. +4. In case you want to make changes to an existing file, navigate to the file in your remote repository. Then click the downward pointing arrow on the very left in the top bar. Select the option `Edit in place`.
Example Image
-5. Make your changes in the text editor and when you are ready, commit your changes to the remote repositery by clicking on the green `Commit changes` button. +5. Make your changes in the text editor and when you are ready, commit your changes to the remote repository by clicking on the green `Commit changes` button.
Example Image
-6. In case you added a new file, you also need to include it table of contents of your book! The table of contents is specified in a file called `toc.yml` and it is already included in your repositery if you used the teachbooks template. +6. In case you added a new file, you also need to include it table of contents of your book! The table of contents is specified in a file called `toc.yml` and it is already included in your repository if you used the teachbooks template.
Example Image @@ -92,10 +92,10 @@ You can edit it and commit the changes in the same manner as with markdown (.md) ```````{tab-set} ``````{tab-item} ... for a brand new version (branch)... -**... by (1) making changes on a single or multiple file(s)
- (2) selecting changes to be added to the Git-timeline (staging)
- (3) adding changes to the Git-timeline (committing) and
- (4) adding changes to GitLab/GitHub (pushing) with ...** +**... by (a) making changes on a single or multiple file(s)
+ (b) selecting changes to be added to the Git-timeline (staging)
+ (c) adding changes to the Git-timeline (committing) and
+ (d) adding changes to GitLab/GitHub (pushing) with ...** `````{tab-set} ````{tab-item} ... Git in VS Code @@ -123,7 +123,7 @@ The new file has been staged, and we've written a Commit Message. ``` Now, we are ready to add the changes to the repository. This is done by *committing* the staged changes. To do this, simply press the big, blue "Commit" button in the Source Control menu. -In the bottom left corner, next to the branch name, click the "Synchronize Changes" button (the one that looks like this: ๐Ÿ”„, highlighted in the image below) to push the changes to GitLab. +4. In the bottom left corner, next to the branch name, click the "Synchronize Changes" button (the one that looks like this: ๐Ÿ”„, highlighted in the image below) to push the changes to GitLab. ```{figure} ../images/git-push.png @@ -140,9 +140,9 @@ After committing, click the ๐Ÿ”„ button to push our changes to the remote reposi Example Image
-3. Add changes to Git-timeline locally (committing). In the field that says `Summary(Required)`, write a short description of the changes you have made. This message is what is called the *Commit Message*. After we've done this, click the blue button `Commit to Repositery`. +3. Add changes to Git-timeline locally (committing). In the field that says `Summary(Required)`, write a short description of the changes you have made. This message is what is called the *Commit Message*. After we've done this, click the blue button `Commit to repository`. -4. Now we need to add changes to GitHub/GitLab. This is called pushing to the local repositery. After committing, the following screen will pop up. Click on `Push Origin`. +4. Now we need to add changes to GitHub/GitLab. This is called pushing to the local repository. After committing, the following screen will pop up. Click on `Push Origin`.
Example Image @@ -159,17 +159,17 @@ Alternatively, you can also click on `Push origin` in the top bar. ``````{tab-item} ... for an existing version (branch)... -**... by (1) regularly obtaining updates from colleagues from GitLab/GitHub (pulling),
- (2) solving potential incompatible changes (merging conflicts),
- (3) making changes on a single / multiple file(s),
- (4) selecting changes to be added to the Git-timeline (staging),
- (5) adding those to the Git-timeline (committing) and
- (6) adding changes to GitLab/GitHub (pushing) with ...** +**... by (a) regularly obtaining updates from colleagues from GitLab/GitHub (pulling),
+ (b) solving potential incompatible changes (merging conflicts),
+ (c) making changes on a single / multiple file(s),
+ (d) selecting changes to be added to the Git-timeline (staging),
+ (e) adding those to the Git-timeline (committing) and
+ (f) adding changes to GitLab/GitHub (pushing) with ...** `````{tab-set} ````{tab-item} ... Git in VS Code -1. If you collaborate with colleagues on your branch, you can get the updates from your colleagues as well by pulling from GitLab/GitHub. This synchronizes the remote repositery with your local repositery on your machine. On the left side-bar click on the icon that looks like a branch. +1. If you collaborate with colleagues on your branch, you can get the updates from your colleagues as well by pulling from GitLab/GitHub. This synchronizes the remote repository with your local repository on your machine. On the left side-bar click on the icon that looks like a branch.
Example Image @@ -177,7 +177,7 @@ Alternatively, you can also click on `Push origin` in the top bar. By clicking on the ๐Ÿ”„ button, you will pull your colleages' changes. -2. When multiple people work on one chapter, it is possible that conflicts will arise if you and your colleagues have made incompatible changes in the same branch. In that case, when pulling from the remote repositery, Git in VS Code will recognize conflicts and help you to solve potential incompatible changes (merging conflicts). Open the files that are marked as conflicitng. +2. When multiple people work on one chapter, it is possible that conflicts will arise if you and your colleagues have made incompatible changes in the same branch. In that case, when pulling from the remote repository, Git in VS Code will recognize conflicts and help you to solve potential incompatible changes (merging conflicts). Open the files that are marked as conflicitng.
Example Image @@ -214,7 +214,7 @@ The new file has been staged, and we've written a Commit Message. ``` Now, we are ready to add the changes to the repository. This is done by *committing* the staged changes. To do this, simply press the big, blue "Commit" button in the Source Control menu. -In the bottom left corner, next to the branch name, click the "Synchronize Changes" button (the one that looks like this: ๐Ÿ”„, highlighted in the image below) to push the changes to GitLab. +6. In the bottom left corner, next to the branch name, click the "Synchronize Changes" button (the one that looks like this: ๐Ÿ”„, highlighted in the image below) to push the changes to GitLab. ```{figure} ../images/git-push.png @@ -222,19 +222,19 @@ After committing, click the ๐Ÿ”„ button to push our changes to the remote reposi ```` ````{tab-item} ... GitHub Desktop -1. If you collaborate with colleagues on your branch, you can get the updates from your colleagues as well by pulling from GitLab/GitHub. This synchronizes the remote repositery with your local repositery on your machine. Click on `Fetch` in the top bar. Then on the same place, click on 'Pull'. +1. If you collaborate with colleagues on your branch, you can get the updates from your colleagues as well by pulling from GitLab/GitHub. This synchronizes the remote repository with your local repository on your machine. Click on `Fetch` in the top bar. Then on the same place, click on 'Pull'.
Example Image
-2. When multiple people work on one chapter, it is possible that conflicts will arise if you and your colleagues have made incompatible changes in the same branch. In that case, when pulling from the remote repositery, GitHub Desktop will recognize conflicts and help you to solve potential incompatible changes (merging conflicts). +2. When multiple people work on one chapter, it is possible that conflicts will arise if you and your colleagues have made incompatible changes in the same branch. In that case, when pulling from the remote repository, GitHub Desktop will recognize conflicts and help you to solve potential incompatible changes (merging conflicts).
Example Image
-In this case there are two conflicted files. GitHub Desktop is suggesting to resolve the changes in VS Code. Click on `Open in Visual Studio Code`. +In this case there are two conflicted files. GitHub Desktop is suggesting to resolve the changes in VS Code (in that case have a look at the section treating VS Code). By clicking on the small downwards arrow you can also solve the conflict directly in GitHub Desktop by choosing the branch of the file you want to keep.
Example Image @@ -256,9 +256,9 @@ Choose one of the options to resolve the merge conflict. You now have updated yo Example Image
-5. Add changes to Git-timeline locally (committing). In the field that says `Summary(Required)`, write a short description of the changes you have made. This message is what is called the *Commit Message*. After we've done this, click the blue button `Commit to Repositery`. +5. Add changes to Git-timeline locally (committing). In the field that says `Summary(Required)`, write a short description of the changes you have made. This message is what is called the *Commit Message*. After we've done this, click the blue button `Commit to repository`. -6. Now we need to add changes to GitHub/GitLab. This is called pushing to the local repositery. After committing, the following screen will pop up. Click on `Push Origin`. +6. Now we need to add changes to GitHub/GitLab. This is called pushing to the local repository. After committing, the following screen will pop up. Click on `Push Origin`.
Example Image @@ -281,11 +281,11 @@ Alternatively, you can also click on `Push origin` in the top bar. ```````{tab-set} ``````{tab-item} ... for brand new version (branch) -**... by (1) making changes on a single or multiple file(s)
- (2) checking changes locally,
- (3) selecting changes to be added to the Git-timeline (staging)
- (4) adding changes to the Git-timeline (committing) and
- (5) adding changes to GitLab/GitHub (pushing) with ...** +**... by (a) making changes on a single or multiple file(s)
+ (b) checking changes locally,
+ (c) selecting changes to be added to the Git-timeline (staging)
+ (d) adding changes to the Git-timeline (committing) and
+ (e) adding changes to GitLab/GitHub (pushing) with ...** `````{tab-set} ````{tab-item} ... Git in VS Code @@ -301,7 +301,7 @@ You will firstly need to actiavte the right environment. Type the following comm (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 repositery 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 folloing command: `jupyter-book build book` @@ -370,7 +370,7 @@ You will firstly need to actiavte the right environment. Type the following comm (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 repositery 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 folloing command: `jupyter-book build book` @@ -397,9 +397,9 @@ The staging GitHub Desktop assumes you want to stage all files. These files will Example Image
-4. Add changes to Git-timeline locally (committing). In the field that says `Summary(Required)`, write a short description of the changes you have made. This message is what is called the *Commit Message*. After we've done this, click the blue button `Commit to Repositery`. +4. Add changes to Git-timeline locally (committing). In the field that says `Summary(Required)`, write a short description of the changes you have made. This message is what is called the *Commit Message*. After we've done this, click the blue button `Commit to repository`. -5. Now we need to add changes to GitHub/GitLab. This is called pushing to the local repositery. After committing, the following screen will pop up. Click on `Push Origin`. +5. Now we need to add changes to GitHub/GitLab. This is called pushing to the local repository. After committing, the following screen will pop up. Click on `Push Origin`.
Example Image @@ -423,18 +423,18 @@ You can read more about it [here](/book/installation-and-setup/jupyter-book-setu ``````{tab-item} ... for an existing version (branch) -**... by (1) regularly obtaining updates from colleagues from GitLab/GitHub (pulling),
- (2) solving potential incompatible changes (merging conflicts),
- (3) making changes on a single / multiple file(s),
- (4) checking changes locally,
- (5) selecting changes to be added to the Git-timeline (staging),
- (6) adding those to the Git-timeline (committing) and
- (7) adding changes to GitLab/GitHub (pushing) with ...** +**... by (a) regularly obtaining updates from colleagues from GitLab/GitHub (pulling),
+ (b) solving potential incompatible changes (merging conflicts),
+ (c) making changes on a single / multiple file(s),
+ (d) checking changes locally,
+ (e) selecting changes to be added to the Git-timeline (staging),
+ (f) adding those to the Git-timeline (committing) and
+ (g) adding changes to GitLab/GitHub (pushing) with ...** `````{tab-set} ````{tab-item} ... Git in VS Code -1. If you collaborate with colleagues on your branch, you can get the updates from your colleagues as well by pulling from GitLab/GitHub. This synchronizes the remote repositery with your local repositery on your machine. On the left side-bar click on the icon that looks like a branch. +1. If you collaborate with colleagues on your branch, you can get the updates from your colleagues as well by pulling from GitLab/GitHub. This synchronizes the remote repository with your local repository on your machine. On the left side-bar click on the icon that looks like a branch.
Example Image @@ -442,7 +442,7 @@ You can read more about it [here](/book/installation-and-setup/jupyter-book-setu By clicking on the ๐Ÿ”„ button, you will pull your colleages' changes. -2. When multiple people work on one chapter, it is possible that conflicts will arise if you and your colleagues have made incompatible changes in the same branch. In that case, when pulling from the remote repositery, Git in VS Code will recognize conflicts and help you to solve potential incompatible changes (merging conflicts). Open the files that are marked as conflicitng. +2. When multiple people work on one chapter, it is possible that conflicts will arise if you and your colleagues have made incompatible changes in the same branch. In that case, when pulling from the remote repository, Git in VS Code will recognize conflicts and help you to solve potential incompatible changes (merging conflicts). Open the files that are marked as conflicitng.
Example Image @@ -467,7 +467,7 @@ You will firstly need to actiavte the right environment. Type the following comm (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 repositery 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 folloing command: `jupyter-book build book` @@ -514,19 +514,19 @@ After committing, click the ๐Ÿ”„ button to push our changes to the remote reposi ```` ````{tab-item} ... GitHub Desktop -1. If you collaborate with colleagues on your branch, you can get the updates from your colleagues as well by pulling from GitLab/GitHub. This synchronizes the remote repositery with your local repositery on your machine. Click on `Fetch` in the top bar. Then on the same place, click on 'Pull'. +1. If you collaborate with colleagues on your branch, you can get the updates from your colleagues as well by pulling from GitLab/GitHub. This synchronizes the remote repository with your local repository on your machine. Click on `Fetch` in the top bar. Then on the same place, click on 'Pull'.
Example Image
-2. When multiple people work on one chapter, it is possible that conflicts will arise if you and your colleagues have made incompatible changes in the same branch. In that case, when pulling from the remote repositery, GitHub Desktop will recognize conflicts and help you to solve potential incompatible changes (merging conflicts). +2. When multiple people work on one chapter, it is possible that conflicts will arise if you and your colleagues have made incompatible changes in the same branch. In that case, when pulling from the remote repository, GitHub Desktop will recognize conflicts and help you to solve potential incompatible changes (merging conflicts).
Example Image
-In this case there are two conflicted files. GitHub Desktop is suggesting to resolve the changes in VS Code (in that case have a look at the section treating VS Code). By clicking on the small downwards arrow you can also solve the conlict directly in GitHub Dekstop by choosing the branch of the file you want to keep. +In this case there are two conflicted files. GitHub Desktop is suggesting to resolve the changes in VS Code (in that case have a look at the section treating VS Code). By clicking on the small downwards arrow you can also solve the conflict directly in GitHub Desktop by choosing the branch of the file you want to keep. Choose one of the options to resolve the merge conflict. You now have updated your work with work from your colleagues and resolved potential conlicts. You are now ready to continue working on the content. @@ -541,7 +541,7 @@ You will firstly need to actiavte the right environment. Type the following comm (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 repositery 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 folloing command: `jupyter-book build book` @@ -567,9 +567,9 @@ Sometimes there are problems building the book. It could be that the building re Example Image
-6. Add changes to Git-timeline locally (committing). In the field that says `Summary(Required)`, write a short description of the changes you have made. This message is what is called the *Commit Message*. After we've done this, click the blue button `Commit to Repositery`. +6. Add changes to Git-timeline locally (committing). In the field that says `Summary(Required)`, write a short description of the changes you have made. This message is what is called the *Commit Message*. After we've done this, click the blue button `Commit to repository`. -7. Now we need to add changes to GitHub/GitLab. This is called pushing to the local repositery. After committing, the following screen will pop up. Click on `Push Origin`. +7. Now we need to add changes to GitHub/GitLab. This is called pushing to the local repository. After committing, the following screen will pop up. Click on `Push Origin`.
Example Image diff --git a/book/workflows/merge_request.md b/book/workflows/merge_request.md index 10a4208..acf79ea 100644 --- a/book/workflows/merge_request.md +++ b/book/workflows/merge_request.md @@ -51,7 +51,7 @@ In case you have cloned the repositery you can also resolve the conflicts locall 6. On the page of our merge request ({numref}`gitlab-finished-merge-request`), we're greeted with some more information. On top, you can read the description we just provided when creating the merge request. We can also see an "Approve" button, which you may or may not see, depending on your repository rights. Next, we can see a green checkmark, with a "Merge" button. This is good news: our changes do not conflict with existing files on the `main` branch, and we can merge our changes directly by clicking the button (if applicable: only after somebody else approved the request). -```{figure} ../images/gitlab-finished-merge-request.png +```{figure} ../../images/gitlab-finished-merge-request.png :name: gitlab-finished-merge-request The finished merge request. @@ -108,7 +108,7 @@ In case you have cloned the repositery you can also resolve the conflicts locall Example Image
```` -````{tab-item} Locally with GitHub Desktop +````{tab-item} Locally with GitHub Desktop for GitHub repositories hi ```` ````` diff --git a/book/workflows/publish.md b/book/workflows/publish.md deleted file mode 100644 index 99d7c71..0000000 --- a/book/workflows/publish.md +++ /dev/null @@ -1,8 +0,0 @@ -(publish_students)= -# Publish to students - -For this step it is assumed youโ€™re using TeachBookโ€™s GitHub actions or TeachBookโ€™s GitLab pipeline. - -Until now, you merged your changes to branch `main`, but you might see a branch called `publish` as well. This branch is where the student version of your book should go. The idea behind this is that the student version of your book should only change a few times per year at most to prevent confusion. This way, you can still make frequent changes to the `main` branch. - -To publish your changes to the student version, simply repeat the next step but now from `main` to `publish` \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 5c6680c..d42b694 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,5 @@ jupyter-book +teachbooks sphinx-inline-tabs jupyterlite-sphinx