Markdown cheat sheet

Feb 10, 2024

3 min read

Hugo Lassiège

This blog is a static blog generator that uses markdown files to generate blog posts. It uses Nuxt-content under the hood.

Standard markdown features

You can use all standard markdown features such as: text formatting, images, links, code blocks, etc.

You should read the official markdown documentation to learn more about markdown.
Edit this file to see how it works.

Horizontal Rules




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

Indented code

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

Block code "fences"

Sample text here...

Nuxt-content provide code highlighting with shiki. You can specify the language of the code block to enable syntax highlighting: This is a paragraph with a code block:

var foo = function (bar) {
  return bar++;
};

console.log(foo(5));

It's also possible to display a code block with a specific file name:

file.js
  export default () => {
    console.log('Code block')
  }

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.

link text

link with title

Autoconverted link https://www.google.com

Youtube and Twitter embed

You can embed youtube videos and tweets in your markdown files.

Images

This is a paragraph with an image

the image is automatically centered on the page and the alt text is displayed below as a caption
the image is automatically centered on the page and the alt text is displayed below as a caption
.

Emojies

Classic markup: πŸ˜‰ 😒 πŸ˜† πŸ˜‹

Footnotes

Footnote 1 link1.

Footnote 2 link2.

Duplicated footnote reference2.

Advanced markdown features

You can use advanced markdown features such as graphs, mathematical formulas and custom components.

Graphs

You can use mermaid to create diagrams and flowcharts.

Here is an example of a basic flowchart:

A
B
C
D

Mathematical formulas

Centered formula

L=12ρv2SCLL = \frac{1}{2} \rho v^2 S C_L

Using code block

(βˆ‘k=1nakbk)2≀(βˆ‘k=1nak2)(βˆ‘k=1nbk2)\left( \sum_{k=1}^n a_k b_k \right)^2 \leq \left( \sum_{k=1}^n a_k^2 \right) \left( \sum_{k=1}^n b_k^2 \right)

Inline formula

This is an inline formula a2+b2=c2a^2 + b^2 = c^2.

Frontmatter

It also supports frontmatter to add metadata to your markdown files.

---
id: "2"
title: "Use markdown power"
description: "Use markdown at its full potential."
date: "2024-02-09"
tags:
  - markdown
cover: "doc/markdown.png"
---
  • id is mandatory if you want to use the comment system. It is used to identify the article.
  • title and description are used for SEO and social sharing. It's also used on the index page. Don't forget to fill them.
  • date is used to sort the articles. Date in the future will not be displayed.
  • tags are only used to display the tags on the article page. It's optional.
  • cover is used to display an image on the index page. It's also used when you share your article on social media. It's optional (it's however better to have one).

Custom components

tip

On top of the standard markdown features, you can also use custom components with Vue.js to extend markdown features.
Read the custom components documentation to learn more.

Footnotes

  1. Footnote can have markup
    and multiple paragraphs. ↩
  2. Footnote text. ↩ ↩2

Share