CONTRIBUTING.md 6.26 KB
Newer Older
1 2 3
---
layout: default
---
4 5
# Guidelines for Contributing

6
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 `README.md` 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 https://git.embl.de/grp-bio-it/image-analysis-training-resources.git`
1. On your computer, make a new branch. For example, if you would like to contribute python code to the binarization.md module you may: `git checkout -b pythonBinarization`
18
1. Now add your changes on your computer (staying in this branch) - see "Adding a new module" section, below.
19
1. When you are done, please `git add .; git commit -m "some message"`
20
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: https://git.embl.de/grp-bio-it/image-analysis-training-resources
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](http://www.yamllint.com/).

```yaml
---
title:     Title of the Module
layout:    module               # don't change this
prerequisites:
  - "a list of things that learners should know"
  - "in order to understand this module"
objectives:
  - "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](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
  and split
  across
  multiple
  lines.
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.
  (optional)
activities: # platform-specific activity instruction/example code files (see note 3) (optional)
  "ImageJ GUI": "mymodule/activities/mymodule_imagejgui.md"
  "ImageJ Macro": "mymodule/activities/mymodule_imagejmacro.md"
  "Jython": "mymodule/activities/mymodule_jython.md"
exercises_preface: >
  You could put general, language-agnostic questions here...
  (optional)
exercises: # platform-specific exercises (in Markdown files) (see note 3) (optional)
  "ImageJ GUI": "mymodule/exercises/mymodule_imagejgui.md"
  "ImageJ Macro": "mymodule/exercises/mymodule_imagejmacro.md"
  "Jython": "mymodule/exercises/mymodule_jython.md"
  "MATLAB": "mymodule/exercises/mymodule_matlab.md"
learn_next: # see note 4
  - "[name_of_one](calibration)"
  - "[or_more_modules](object_splitting)"
  - "[to link to next](display)"
external_links:
  - "[link to](https://external.page.com)"
---
```

Notes:

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](https://cft.vanderbilt.edu/guides-sub-pages/blooms-taxonomy/)
2. Concept maps are drawn with [Mermaid.js](https://mermaidjs.github.io/flowchart.html). 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/mymodule.md`

- The `figure` image
  - an file containing an example image to illustrate the concept being taught in the module
  - location: `/figures/mymodule.md`
- 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/mymodule_platformnospaces.md`
- 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/mymodule_platformnospaces.md`

## 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](mailto:toby.hodges@embl.de).