Back

Markdown guide

Headings


h1 Heading 8-)

h2 Heading

h3 Heading

h4 Heading

h5 Heading
h6 Heading

Horizontal Rules




Emoji

Complete list ๐Ÿ˜„ ๐Ÿ˜ ๐Ÿ˜† ๐Ÿ˜Œ ๐Ÿ˜ฎ ๐Ÿค“ ๐Ÿ˜Ÿ ๐Ÿ˜ฆ ๐Ÿ˜ง ๐Ÿ˜• ๐Ÿ˜’ ๐Ÿ˜ญ ๐Ÿ‘

Typographic replacements

Enable typographer option to see result.

(c) (C) (r) (R) (tm) (TM) (p) (P) +-

test.. test... test..... test?..... test!....

!!!!!! ???? ,, -- ---

"Smartypants, double quotes" and 'single quotes'

Emphasis

This is bold text

This is bold text

This is italic text

This is italic text

Strikethrough

Blockquotes

Blockquotes can also be nested...

...by using additional greater-than signs right next to each other...

...or with spaces between arrows.

Lists

Unordered

  • Create a list by starting a line with +, -, or *
  • Sub-lists are made by indenting 2 spaces:
    • Marker character change forces new list start:
      • Ac tristique libero volutpat at
      • Facilisis in pretium nisl aliquet
      • Nulla volutpat aliquam velit
  • Very easy!

Ordered

  1. Lorem ipsum dolor sit amet

  2. Consectetur adipiscing elit

  3. Integer molestie lorem at massa

  4. You can use sequential numbers...

  5. ...or keep all the numbers as 1.

Start numbering with offset:

  1. foo
  2. bar

Code

Inline code npm install -g yarn

Indented code

// Some comments
line 1 of code
line 2 of code
line 3 of code

Block code "fences"

Sample text here...

Syntax highlighting and file names

data.json
data: [{
  name: "Test",
  age: 22
},
{
  name: "Test",
  age: 32
},
{
  name: "Test",
  age: 42
}]
Card.vue
<template>
  <button 
    class="fullscreenButton" @click="emitActivateModal()">
    Hello World
  </button>
</template>

<script>
export default {
  props: {
    codeBlock: undefined
  },
  methods: {
    emitActivateModal() {
      this.$emit('activate-code-modal', this.codeBlock);
    }
  }
};
</script>
nuxt.config.js
var foo = function (bar) {
  return bar++;
};

console.log(foo(5));
sidebar.component.ts
import { HttpErrorResponse } from '@angular/common/http';
import { Component, OnInit } from '@angular/core';
import { Monster } from '../../models/monster';
import { DataService } from '../../services/data.service';
import { MonsterService } from '../../services/monster.service';

@Component({
  selector: 'app-sidebar',
  templateUrl: './sidebar.component.html',
  styleUrls: ['./sidebar.component.less']
})
export class SidebarComponent implements OnInit {
  
  public title = 'Monsters';
  public monsters: Monster[] = [];
  public selectedMonster: any;
  public monstersByCategory: any[] = [];
  public accordionCategoryIsOpen: string[] = [];

  constructor(private monsterService: MonsterService,
    private dataService: DataService) { }

  ngOnInit() {
    this.getMonsters();
    this.dataService.selectedMonster.subscribe(selectedMonster => {
      return this.selectedMonster = selectedMonster;
    });
  }

  public getMonsters(): void {
    this.monsterService.getMonsters().subscribe(
      (response: Monster[]) => {
        this.monsters = response;
        let monstersByCategory = this.groupMonstersByCategory(response);
        this.monstersByCategory = this.sortMonstersByCategoryAlphabetically(monstersByCategory);
      }
    ),
    (error: HttpErrorResponse) => {
      console.log(error.message);
    }
  }
}
startup.cs
public static main() {
  Console.WriteLine("Hello World");
}
style.scss
.fullscreenButton {
  display: none;
  background: url("~assets/fullscreen.svg");
  background-size: 25px 25px;

  &.active {
    background: url("~assets/clipboard-check-regular.svg");
    background-size: 25px 25px;
    background-repeat: no-repeat;
    background-position: center;
  }

  &:hover {
    background-color: gray;
    cursor: pointer;
  }
}
startup.cs
public static main() {
  Console.WriteLine("Hello World");
}
main.py
def main():
  print("Hello World")
  for index, collection in nodes.items():
    if collection["parentId"] is not None:
      nodes[collection["parentId"]]["children"].append(collection)

if __name__ == "__main__":
  main()
index.php
$name = "Test";
echo $name;
customers.sql
SELECT *
FROM [Customers]
WHERE [FirstName] LIKE 'Tom'
README.md
project
โ”‚   README.md
โ”‚   file001.txt    
โ”‚
โ””โ”€โ”€โ”€folder1
โ”‚   โ”‚   file011.txt
โ”‚   โ”‚   file012.txt
โ”‚   โ”‚
โ”‚   โ””โ”€โ”€โ”€subfolder1
โ”‚       โ”‚   file111.txt
โ”‚       โ”‚   file112.txt
โ”‚       โ”‚   ...
โ”‚   
โ””โ”€โ”€โ”€folder2
    โ”‚   file021.txt
    โ”‚   file022.txt

Running code

A nice helper component for running code

main.py
for i in range(1, 6):
  print("Hello world " + str(i))

print({ name: "Dr Alan Grant", age: 45, address: "Jurassic Park", phone: 1234 })
TERMINAL
Python
user@ShedloadOfCode:~$ main.py

Let's test out remove duplicates from a sorted array and return the number of valid entries after deletion.

duplicates.py
def delete_duplicates(A: list[int]) -> int:
    if not A:
        return 0

    list_length = len(A)
    slow_pointer = 0
    for fast_pointer in range(1, list_length):
        if A[slow_pointer] != A[fast_pointer]:
            slow_pointer += 1
            A[slow_pointer] = A[fast_pointer]

    new_list_length = slow_pointer + 1
    return new_list_length


test_array = [0, 0, 1, 1, 1, 2, 2, 3, 3, 4]

new_list_length = delete_duplicates(test_array)
print(f"The number of valid entries after deleting duplicates: {new_list_length}")
TERMINAL
Python
user@ShedloadOfCode:~$ duplicates.py

Raw HTML

Tables

OptionDescription
datapath to data files to supply the data that will be passed into templates.
engineengine to be used for processing templates. Handlebars is the default.
extextension to be used for dest files.

Right aligned columns

OptionDescription
datapath to data files to supply the data that will be passed into templates.
engineengine to be used for processing templates. Handlebars is the default.
extextension to be used for dest files.

Internal link

test

link text

link with title

Autoconverted link https://github.com/nodeca/pica (enable linkify to see)

Images

Minion

Source: Octodex

Stormtroopocat

Source: Octodex

Stormtroopocat

Source: Personal image

Like links, Images also have a footnote style syntax

Alt text

Source: Octodex

With a reference later in the document defining the URL location:

Videos

Plugins

The killer feature of markdown-it is very effective support of syntax plugins.

Emojies

Classic markup: :wink: :crush: :cry: :tear: :laughing: :yum:

Shortcuts (emoticons): :-) :-( 8-) ;)

see how to change output with twemoji.

Subscript and Superscript

  • 19^th^
  • H2O

<ins>

++Inserted text++

<mark>

==Marked text==

Footnotes

Footnote 1 linkfirst.

Footnote 2 linksecond.

Inline footnote^[Text of inline footnote] definition.

Duplicated footnote referencesecond.

Definition lists

Term 1

: Definition 1 with lazy continuation.

Term 2 with inline markup

: Definition 2

    { some code, part of Definition 2 }

Third paragraph of definition 2.

Compact style:

Term 1 ~ Definition 1

Term 2 ~ Definition 2a ~ Definition 2b

Abbreviations

This is HTML abbreviation example.

It converts "HTML", but keep intact partial entries like "xxxHTMLyyy" and so on.

*[HTML]: Hyper Text Markup Language

Custom containers

::: warning here be dragons :::


  1. Footnote can have markup

    and multiple paragraphs.โ†ฉ

  2. Footnote text.โ†ฉ