Skip to content
Snippets Groups Projects

HIFIS workshop material template

This is the HIFIS workshop material template. It is made with cookiecutter. In addition, we make use of cruft to manage templates updates.

Getting started

  • You require Python 3.10 and a Git client.
  • Install cruft, for example, by running: pip install cruft

Create your workshop template

  • Run cruft as follows:
    cruft create git@codebase.helmholtz.cloud:hifis/software/education/hifis-workshops/cookiecutter-hifis-workshop-template
    
    [1/6] project_name (Workshop template):
    [2/6] project_slug (workshop_template):
    [3/6] maintainer (Anonymous <anonymous@anonymous.net>):
    [4/6] copyright (2024 Unknown):
    [5/6] site_url (https://hifis.net/workshop-materials/workshop_template/):
    [6/6] repo_url(https://codebase.helmholtz.cloud/hifis/software/education/hifis-workshops/workshop_template/):

Check the website locally

  • Switch into the created template project: cd workshop_template
  • Install the dependencies to build the website locally: pip install -r requirements.txt
  • Check the website locally: mkdocs serve

Create the GitLab project

  • To make it REUSE-compliant create the .cruft.json.license file as follows: printf "SPDX-FileCopyrightText: NONE\n\nSPDX-License-Identifier: CC0-1.0\n" > .cruft.json.license
  • Initialize the local Git repository as follows:
git init --initial-branch main .
git add .
git commit -m "Add the base version"
  • Create the GitLab project as follows:
git remote add origin git@codebase.helmholtz.cloud:hifis/software/education/hifis-workshops/workshop_template.git
git push origin main

Where to go from here?

  • You can now start providing your content in the workshop_materials directory.
  • The README.md fo your template and the example content provides further useful details.

Link an existing workshop material repository

  • We assume that you have an existing workshop material repository which is similar to the template but not yet linked and that you want to synchronize upcoming changes of the template files.
  • You can establish the link as follows:
    • Clone your workshop material repository and change into it.
    • Link with the template by running cruft link and answering the template questions:
    cruft link git@codebase.helmholtz.cloud:hifis/software/education/hifis-workshops/cookiecutter-hifis-workshop-template
    
    [1/6] project_name (Workshop template):
    [2/6] project_slug (workshop_template):
    [3/6] maintainer (Anonymous <anonymous@anonymous.net>):
    [4/6] copyright (2024 Unknown):
    [5/6] site_url (https://hifis.net/workshop-materials/workshop_template/):
    [6/6] repo_url(https://codebase.helmholtz.cloud/hifis/software/education/hifis-workshops/workshop_template/):
    Linking against the commit: 765a2d7ef12fc0533e382f1b4e6841332f5b5dbc which corresponds with the git reference: None
    Press enter to link against this commit or provide an alternative commit.
    Link to template at commit [765a2d7ef12fc0533e382f1b4e6841332f5b5dbc]:
    • To make it REUSE-compliant create the .cruft.json.license file as follows: printf "SPDX-FileCopyrightText: NONE\n\nSPDX-License-Identifier: CC0-1.0\n" > .cruft.json.license
    • Add and commit the new files.
  • Now, you can use cruft check and cruft update to check for template changes and to apply them.