Giter VIP home page Giter VIP logo

hackpad-templator's Introduction

Research Computing Training Templater

This repository contains the code for a github action workflow that automatically generates a Hackmd hackpad for our training workshops using the hackmd-cli and jinja2 templates.

Workflow

Create a new branch in this repo
containing a metadata file
            |
            |
            v
Github action detects the new branch and starts the action
            |  
            |
            v
Github action reads metadata file and uses variables to fill a jinja template
            |
            |
            v
This markdown file is then passed to hackmd-cli which imports the .md file as a new hackpad

Usage

You can use this repository to automatically create a new Hackmd.io hackpad for Research Computing training sessions using templates included within this repo.

To create a new hackpad you need to create a branch with the format <training-course-code>-yyyy-mm for example for HPC0 running in November 2021 you would create a branch hpc0-2021-11. You should then create a config.yaml file at the root of your repository containing values to be autofilled for the template.

JinJa is picky over the file ending of the config file. Ensure it .yaml rather than .yml!

# example git command for creating a new branch
$ git checkout -b hpc0-2021-11

# create a config.yaml in the repo root
$ cat <<EOF > config.yaml
date: 2021-11-22
morning: true
EOF

# add stage config file for commit
$ git add config.yaml

# commit changes
$ git commit -m 'adding config file for workshop'

# push branch back to github to trigger action
$ git push -u origin hpc0-2021-11

After the hackpad is created you will still need to configure the hackpads sharing settings and edit the url slug of the hackpad which can be done via the hackmd.io interface.

Expected config

Each template expects a config.yaml file to be committed within the branch to generate the hackpad. These just have to be simple yaml documents that specify the variables that jinja2 will fill in.

HPC0 & HPC1

Expected yaml file:

date: "2021-11" # specify the date to be included in the hackmd heading
morning: True # specify if the session is morning or not to control generated agenda timings

SWD6

Expected yaml file:

date: "2021-11" # specify the date to be included in the hackmd heading

hackpad-templator's People

Contributors

sparrow0hawk avatar jhodrien avatar lukeconibear avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.