Skip to content

Instantly share code, notes, and snippets.

@thegitfather
Last active July 16, 2017 00:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thegitfather/deb74713e6aff8fdfce2 to your computer and use it in GitHub Desktop.
Save thegitfather/deb74713e6aff8fdfce2 to your computer and use it in GitHub Desktop.
markdown elements

An exhibit of Markdown

This note demonstrates some of what Markdown is capable of doing.

Note: Feel free to play with this page. Unlike regular notes, this doesn't automatically save itself.

Basic formatting

Paragraphs can be written like so. A paragraph is the basic block of Markdown. A paragraph is what text will turn into when there is no reason it should become anything else.

Paragraphs must be separated by a blank line. Basic formatting of italics and bold is supported. This can be nested like so.

Lists

Ordered list

  1. Item 1
  2. A second item
  3. Number 3
    1. sub
    2. list
  4. und
  • noch
  • mehr
  1. weiter

Note: the fourth item uses the Unicode character for Roman numeral four.

Unordered list

  • An item
  • Another item
  • Yet another item
  • test
    • test2
    • An item
    • Another item
      • blub
    • narf
  • bla

Checklist

  • a bigger project
    • first subtask #1234
    • follow up subtask #4321
    • final subtask cc @mention
  • a separate task

Paragraph modifiers

Code block

Code blocks are very useful for developers and other people who look at code or other things that are written in plain text. As you can see, it uses a fixed-width font.

You can also make inline code to add code into other things.

// This function returns a string padded with leading zeros
function padZeros(num, totalLen) {
   var numStr = num.toString();             // Initialize return value as string
   var numZeros = totalLen - numStr.length; // Calculate no. of zeros
   for (var i = 1; i <= numZeros; i++) {
      numStr = "0" + numStr;
   }
   return numStr;
}

ASCII art

○◻◊◇◆■▥▤🗹🗷🗸🗶🖕🕱🌢🏶🕆🕇🕀🖸🖫🗐🖹🗅🖉

             ,-. 
    ,     ,-.   ,-. 
   / \   (   )-(   ) 
   \ |  ,.>-(   )-< 
    \|,' (   )-(   ) 
     Y ___`-'   `-' 
     |/__/   `-' 
     | 
     | 
     |    -hrr- 
  ___|_____________ 

Quote

Here is a quote. What this is should be self explanatory. Quotes are automatically indented when they are used.

Headings

There are six levels of headings. They correspond with the six levels of HTML headings. You've probably noticed them already in the page. Each level down uses one more hash character.

Headings can also contain formatting

They can even contain inline code

Of course, demonstrating what headings look like messes up the structure of the page.

I don't recommend using more than three or four levels of headings here, because, when you're smallest heading isn't too small, and you're largest heading isn't too big, and you want each size up to look noticeably larger and more important, there there are only so many sizes that you can use.

URLs

URLs can be made in a handful of ways:

Horizontal rule

A horizontal rule is a line that goes across the middle of the page.


It's sometimes handy for breaking things up.

Tables

Name Description
Help Display the help window.
Close Closes a window

Finally, by including colons : within the header row, you can define text to be left-aligned, right-aligned, or center-aligned:

Left-Aligned Center Aligned Right Aligned
col 3 is some wordy text $1600
col 2 is centered $12
zebra stripes are neat $1

Images

Image of flowers

Finally

There's actually a lot more to Markdown than this 🐫. See the official introduction and syntax for more information. However, be aware that this is not using the official implementation, and this might work subtly differently in some of the little things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment