Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
markdown.md 8.36 KiB
layout: page
permalink: /external/markdown/

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.

Syntax

Markdown Rendered Output
# Header 1
## Header 2
### Header 3
#### Header 4

Header 1


Header 2


Header 3


Header 4

To **bold** text, add **two asterisks** or __underscores__ before and after a word or phrase. To make text **italic** text, add *one asterisks* or _underscores_. To make phrase bold text, add two asterisks or underscores before and after a word or phrase. To make text italic, add one asterisks or underscores.
Use numbers for ordered lists:
1. First item
2. Second item
3. Third item
    1. Indented item
    2. Indented item
4. Fourth item
  1. First item
  2. Second item
  3. Third item
    1. Indented item
    2. Indented item
  4. Fourth item
For unordered lists * First item
* Second item
* Third item
* Fourth item
  • First item
  • Second item
  • Third item
  • Fourth item
Include links referring to a web [page](https://www.markdownguide.org/) Include links referring to a web page
Include local pictures: ![My awesome picture](/img/r3_logo.png) Include local pictures:
Include code blocks! ``` myAwesomeFunction <- function(x) x+1; # Apply function myAwesomeFunction(2); ``` Include code blocks! myAwesomeFunction <- function(x) x+1; # Apply function myAwesomeFunction(2);

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 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