Markdown Basics - pcgoddard/Burchardlab_Tutorials GitHub Wiki

Markdown Tutorial

Pagé Goddard

Sep 1, 2017


Contents


Sublime add-ons

  • MarkdownEditor # for easier visualization pre-publication
  • OmniMarkupPreviewer # for previewing fully formatted document
    • ctrl + alt + o
    • OR MarkdownBuddy

Headers

Use # to indicate header level

# Heading1

## Sub-heading

###### level 6 subheading

Emphasis

italic: *word* or _word_

bold: **word** or __bold__

combined: ***word*** or ___word___

strikethrough: <del>word<del> or ~~ word ~~

Lists

unordered

  • unordered
  • lists
    • use *
    • and -

ordered

  1. ordered
  2. lists
  3. use
    1. numbers
    2. but not letters
      • number of tabs determines bullet level

task list

  • - [x] this is a complete item
  • - [ ] this is an incomplete item
  • - [ ] list autopopulates format

Links

URLs

example: wikipedia

\[Alt Text](url)

Images

All linked images must be hosted online. You can link to an image on your local machine but it will not be viewable in the published markdown on other devices. When the image is not publishable, the Alt Text input will be shown.

cute puppy

\!\[Alt Text](url)

you can resize images using standard HTML

\<img src="url" alt="Alt Text" width="200"/>

*note: the alt="" input is optional

Table of Contents Links

This requires use of anchor tags where you want the table of contents to link to.

\<a name="anchor_tag"></a>

# This is my header!

  • note: remove the \ before the first > to activate the anchor tag
  • personal preference: I like to put the anchor tag above the tagged section so that when the link jumps to that section you still see the header

You can then link to that line from anywhere in the document using:

\[My header\]\(\#anchor_tag\)

Block quotes

the following lines will be a quote

> it was the best of times

> it was the worst of times

it was the best of times

it was the worst of times

Code Blocks

Inline Code

This is your `code` to highlight

This is your code to highlight

Fenced Code Blocks

```javascript

function test() {

console.log("hello world");

```

function test() {
    console.log("hello world");
}

to put any text in a code box, just indent it once

any text

Tables

  • tables use | and - to indicate field divisions

column 1 | column 2

---------|--------- # this line is necessary to indicate table format

cell 1.1 | cell 2.1

cell 1.2 | cell 2.2

column 1 column 2
cell 1.1 cell 2.1
cell 1.2 cell 2.2

Line breaks

  • 3 or more * - or _

Escaping characters

removes special syntax meaning: italic v. *asterisks*

\character can be used on the following:

\ ` * # _ - + . { } [ ] ( ) !

Emjois (github)

(just remove the spaces)

👍 = : + 1 : ✨ = : sparkles : :octocat: = : octocat :

⚠️ **GitHub.com Fallback** ⚠️