6.95 KB
Newer Older
Toby Hodges's avatar
Toby Hodges committed
layout: page
Toby Hodges's avatar
Toby Hodges committed
title: Guidelines for Contributing

Contributions to this project are very welcome.
7 8 9
Changes should be submitted by merge request from a new branch to `master`.
Merge requests should be reviewed by at least one Maintainer before merging.

10 11 12 13 14 15 16 17
See `` for information on the structure of the repository.

## Step by step guide

To contribute to this project, please follow those steps:

1. Clone this repository: `git clone`
1. On your computer, make a new branch. For example, if you would like to contribute python code to the module you may: `git checkout -b pythonBinarization`
1. Now add your changes on your computer (staying in this branch) - see "Adding a new module" section, below.
1. When you are done, please `git add .; git commit -m "some message"`
1. Now you can upload your branch to the online repository by typing: `git push --set-upstream origin pythonBinarization`.
21 22 23
1. Go to the online repository on gitlab:
1. On gitlab, there will now be button at the top of the page. Click this button to stage a "merge request" of your contribution (in your branch) to the master branch. There will also a possibility to assign a project maintainer to review your contribution and to merge it. Please select someone appropriate here.
1. Thank you for your contribution!
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125

## Adding a new module

Each module page is built from a template (`_layouts/module.html`),
ensuring a consistent structure and style for the whole collection.
To create a new module, you will need to add a few files
in a few different places in this repository.

### Module file
Most important is the module file itself.
This module file should be saved with a short, descriptive name (no spaces!)
ending with the `.md` (Markdown) extension.
Typically, the only content of this Markdown file should be a header
written in YAML. See the specification below.
All fields not marked as optional are required for the page to build.
You can check that your YAML is valid with [this tool](

title:     Title of the Module
layout:    module               # don't change this
  - "a list of things that learners should know"
  - "in order to understand this module"
  - "a list of learning objectives"
  - "see note 1 below for more info"
motivation: >
  A description of *why* you would want to learn this.
  Can be written in
  (GitHub-flavoured) [Markdown](
  and split
concept_map: > # see note 2
  graph TD
      A[Christmas] -->|Get money| B(Go shopping)
      B --> C{Let me think}
      C -->|One| D[Laptop]
      C -->|Two| E[iPhone]
      C -->|Three| F[fa:fa-car Car];
figure: /figures/mymodule.png # store the example image for your module in the `figures` folder and provide the absolute path from the root of the site here.
figure_legend: Some description of the figure. (optional)
activity_preface: >
  Some general description of the activity for
  that learners will do while studying the module.
  It will be followed by platform-specific instructions/example code.
activities: # platform-specific activity instruction/example code files (see note 3) (optional)
  "ImageJ GUI": "mymodule/activities/"
  "ImageJ Macro": "mymodule/activities/"
  "Jython": "mymodule/activities/"
exercises_preface: >
  You could put general, language-agnostic questions here...
exercises: # platform-specific exercises (in Markdown files) (see note 3) (optional)
  "ImageJ GUI": "mymodule/exercises/"
  "ImageJ Macro": "mymodule/exercises/"
  "Jython": "mymodule/exercises/"
  "MATLAB": "mymodule/exercises/"
learn_next: # see note 4
  - "[name_of_one](calibration)"
  - "[or_more_modules](object_splitting)"
  - "[to link to next](display)"
  - "[link to]("


1. Learning objectives should be worded as endings to a sentence beginning "After completing this lesson, learners should be able to...". We recommend starting each learning objective with a verb from [Bloom's Taxonomy](
2. Concept maps are drawn with [Mermaid.js]( The indentation of the chart description is important, so be careful!
3. The `activities` and `exercises` fields should be populated with key-value pairs, where the key is the name of the platform (e.g. "ImageJ GUI", "Python", etc) and the value is the path (relative to `_includes/`) to the file containing the activity instructions/exercises for that platform.
4. The points in "Learn Next" are Markdown links, which should be formed as `[Module Title](modulefilename)`, where the extension has been removed from the filename.

### Associated files

Below is a list of all the other files that you should provide
to accompany a new module,
as well as the appropriate location for each
(relative to the top level of the repository).
Examples are given for a `/modules/`

- The `figure` image
  - an file containing an example image to illustrate the concept being taught in the module
  - location: `/figures/`
- The `activities` files
  - Markdown files containing instructions and/or example code for an activity that learners should follow to learn how to apply the concept on a particular platform (ImageJ Macro, MATLAB, etc)
  - location: `_includes/mymodule/activities/`
- The `exercises` files
  - Markdown files containing exercises to test the learner's understanding of applying the concept on a particular platform
  - location: `_includes/mymodule/exercises/`

## Adding exercises/activity instructions for a new platform

Contributions of instructions and exercises for more platforms are very welcome - please see the "Associated files" subsection above for details of where these contributed files should be added.

## Questions about the module layout

If you have questions about the module layout, please contact [Toby Hodges](
Toby Hodges's avatar
Toby Hodges committed
126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144

## Building locally

To test your changes locally, install `jekyll` on your system. Instructions for Mac OSX are here: [](

Once you have `jekyll` and `bundler` setup,
clone and move into this repository,
and run:

bundle exec jekyll serve

All going well, your built pages are now beng served locally.
Copy the URL provided in the output
(should be
and paste it into your web browser.
Now you can navigate around the locally-built version of the pages
and check whether you're happy to submit your changes to be merged into `master` :+1: