Markdown

Markdown is a lightweight markup language with plain text formatting syntax which became very popular in past decade and which nowadays serves as a standard in various digital communication channels.

Main features of Markdown

  • It has very simple syntax easy to learn.
  • It is already widely used in scientific community.
  • It separates content from visual presentation so it allows you to focus on writing, not formatting.
  • It is a non-proprietary file format.
  • It is powerful - allows to format text with very little effort.
  • It is portable - since it is actually plain text, it can be opened by literally all text editors.
  • It is machine readable - as simple text, markdown documents can be tracked and version using a versioning system (Git, SVN)
  • small file size
  • easy to convert to other formats - existing editors and command line tools (e.g. pandoc allows for easy conversion between Markdown and other widely used formats like HTML, PDF, docx, LaTeX, etc.

Quick reference

  • The following symbol behind the file name means that your changes/writing is not saved.

    press crt+s to save your procedure

  • To preview your writing click on:

Tips to write in markdown:

Markdown

Rendered Output

Header 1

    ## Header 2
    ### Header 3 
    #### Header 4

Header 1 Header 2 Header 3 Header 4

To make a text bold, use double asterisk or underscores before and after a word or phrase. To make a text italic, use one asterisk or underscore.

To make a text bold, use double asterisk or underscores before and after a word or phrase. To make text italic, use one asterisk or underscore.

Use numbers for ordered lists 1. First item 2. Second item 3. Third item     1. Indented item     1. Indented item 4. Fourth item

Use numbers for ordered lists First item Second item Third item

  Indented item
  Indented item
  
  
  Fourth item

For unordered lists use asterisk, minus or plus - First item - Second item * Third item     * Indented item     + Indented item * Fourth item

For unordered lists use asterisk, minus or plus

  First item
  Second item
  Third item
  
  Indented item
  Indented item
  
  Fourth item

Include links referring to a web page

Include links referring to a web page

Include local pictures using markdown My awesome picture

  Or use HTML tag allowing you to alter the image properties (e.g. size)
    <img src="img/r3_logo.png" width="40">

Include local pictures using markdown Or use HTML tag allowing you to alter the image properties (e.g. size)

Include code blocks! def myAwesomeFunction(x) x+1 myAwesomeFunction(2)

Include code blocks!

  def myAwesomeFunction(x)
    x+1
  myAwesomeFunction(2)

Create table | Tables | Are | Cool
|————|:——:|:—– | value one | blue | $1024 | value two | red | $256
| value three| green | $128

Create table Tables

          Are
          
          
          Cool
          
        
      
      
        
          
          value one
          
          
          blue
          
          
          $1024
          
        
        
          
          value two
          
          
          red
          
          
          $256
          
        
        
          
          value tree
          
          
          green
          
          
          $128

This is an overview of basic Markdown features. For more in-build features, please see various online documentation.

Advanced formatting

Plain syntax is usually enough. But special requirements lead to development of many of so called “flavored” markdown syntaxes implementing more formatting functionality such as linking different sections, highlighting blocks of code, table extensions, strikethroughs, …

Another big advantage of Markdown is that it can contain HTML tags, which makes formatting very flexible.

When to use markdown?

  • Documentation - Markdown is a perfect solution for description of a data package, project folder, workflow or code repository. Using Markdown ensures that the description will be accessible to everyone even after decades while still nicely structured. Guide for writing a good README is not covered by this HowTo page but you can find plenty of resources online, e.g.:
    • guide from Cornell University, UK
    • GitHub page for READMEs in a software repository
  • Blogging and tutorials - structured document with chunks of code, pictures and results of the analyses can be easily converted to HTML format and posted on personal/team websites.

  • Notes and meeting minutes - you can use following template for simple and nicely structured meeting notes:

Markdown template

Rendered Output

DocTitle

      ### Attendees
      ### Location
      ## Objective / Agenda
      ## Meeting Notes
        * first note 
        * second note 
        * ...
      ## Actions
      - [ ] Josh, Alice and Cindy will do this.
      - [x] Bob stops doing that.
      - [ ] Will and Tom will take care of those

DocTitle Attendees Location Objective / Agenda Meeting Notes

       first note
      second note
      ...
    
     Actions
     Josh, Alice and Cindy will do this.
     Bob stops doing that.
     Vanessa and Tom will take care of those
  • Analyses, reports and papers - embedding R markdown in an R project allows you to include executable code and related text in the very same document. This brings unprecedented level of consistency, shareability and reproducibility into the workflows.

  • Online discussion forums - many scientific and non-scientific discussion forums and social networks support Markdown for formatting the content of messages (e.g. StackOverflow, GitHub, Reddit or even Facebook)

  • Presentations - variety of tools support Markdown-powered slide generation, e.g. reveal.js, HackerSlides or landslide

Cases when Markdown is not easily applicable

  • Official documents like legal agreements and project proposals could be in theory written in Markdown but it is not yet accepted by administrative processes.

  • Big structured tables with multilevel headers or special formatting can be written in HTML editors and then pasted into your Markdown document.

  • Thesis writing requires support of citation managers and additional formatting. This can be achieved but usually is conditioned by embedding Latex into your workflow.

Editors

Markdown file can be written in any text editor. There are many editors supporting rendering and live preview, here are some of them:

  • Freeware
    • Atom
    • Dillinger
    • Visual Studio Code
    • ghostwriter
    • Typora
    • HackMD
  • Payware:
    • iA Writer
    • SublimeText
    • ByWord
  • Online