Markdown cheatsheet
Most of the Markdown syntax is common for different Markdown engines.
But some features listed below tested and might work only with Material theme for MkDocs markdown extensions.
Italic font
*Italic Example 1*
_Italic Example 2_
Italic Example 1
Italic Example 2
Bold font
**Strong Example 1**
__Strong Example 2__
Strong Example 1
Strong Example 2
Inline links
This is an [inline link](http://example.com "and its title").
Another link to: <http://example.com>.
This is an inline link.
Another link to: http://example.com.
Referenced links
Some text with a [referenced link 1][link1] and
with another [referenced link 2][link2].
[link1]: http://example.com/ "Title 1"
[link2]: http://example.org/ "Title 2"
Some text with a referenced link 1 and with another referenced link 2.
Inline images
Inline Image:
![Alt](/favicon.ico "Title")
Inline Image:
Referenced images
Referenced Image:
![Alt][img1]
[img1]: /favicon.ico "Title"
Referenced Image:
Bullet lists
Bullet Lists:
* Item 1
* Item 2
- Item 3
- Item 4
Bullet Lists:
- Item 1
- Item 2
- Item 3
- Item 4
Numbered lists
Numbered List 1:
1. Item 1
2. Item 2
Numbered List 2:
1. Item 1
1. Item 2
Numbered List 1:
- Item 1
- Item 2
Numbered List 2:
- Item 1
- Item 2
Quotations
> Quoted text.
> > Quoted quote.
> * Quoted
> * List
Quoted text.
Quoted quote.
- Quoted
- List
Inline code
`This is some inline code`
This is some inline code
Code block
Example 1
~~~
This is a
piece <good>of</good> code
in a block
~~~
This is a
piece <good>of</good> code
in a block
Example 2
```
This is
another <fine>piece of code</fine>
in a block too
```
This is
another <fine>piece of code</fine>
in a block too
Example 3
This is
another <fine>piece of code</fine>
in a block too
This is
one more <fine>piece of code</fine>
in a block
Headers
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
Definitions
Definition
: This is some definition
- Definition
- This is some definition
Tables
Example 1
| First Header | Second Header |
| ------------- | ----------------- |
| Content Cell | Content **Cell** |
| `some()` | Some Code |
First Header | Second Header |
---|---|
Content Cell | Content Cell |
some() | Some Code |
Example 2
| AAA | BBB |
| - | - |
| aaa1 | bbb1 |
| aaaaa2 | bbbbb2 |
AAA | BBB |
---|---|
aaa1 | bbb1 |
aaaaa2 | bbbbb2 |
Admonition
Note
Text
!!! note
Text
Changed title
Text with changed title
!!! note "Changed title"
Text with changed title
Text without title
!!! note ""
Text without title
Abstract
Example:
!!! abstract
abstract / summary
Info
Example:
!!! info
info / todo
Tip
Example:
!!! tip
tip / hint / important
Success
Example:
!!! success
success / check / done
Question
Example:
!!! question
question / help / faq
Warning
Example:
!!! warning
warning / caution / attention
Failure
Example:
!!! failure
failure / fail / missing
Danger
Example:
!!! danger
danger / error
Bug
Example:
!!! bug
bug
Example
Example:
!!! example
example / snippet
Quote
Example:
!!! quote
quote / cite
Syntax highlighting
Specifying the language
via Markdown syntax
```ruby
def index
puts "hello world"
end
```
def index
puts "hello world"
end
via Shebang
#!/usr/bin/ruby
def index
puts "hello world"
end
1 2 3 4 |
|
via three colons
:::ruby
def index
puts "hello world"
end
def index
puts "hello world"
end
Highlight specific lines
``` python hl_lines="3 4"
""" Bubble sort """
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
```
""" Bubble sort """
def bubble_sort(items):
for i in range(len(items)):
for j in range(len(items) - 1 - i):
if items[j] > items[j + 1]:
items[j], items[j + 1] = items[j + 1], items[j]
List of supported languages
- Cucumber ('*.feature')
- abap ('*.abap')
- ada ('.adb', '.ads', '*.ada')
- ahk ('.ahk', '.ahkl')
- apacheconf ('.htaccess', 'apache.conf', 'apache2.conf')
- applescript ('*.applescript')
- as ('*.as')
- as3 ('*.as')
- asy ('*.asy')
- bash ('.sh', '.ksh', '.bash', '.ebuild', '*.eclass')
- bat ('.bat', '.cmd')
- befunge ('*.befunge')
- blitzmax ('*.bmx')
- boo ('*.boo')
- brainfuck ('.bf', '.b')
- c ('.c', '.h')
- cfm ('.cfm', '.cfml', '*.cfc')
- cheetah ('.tmpl', '.spt')
- cl ('.cl', '.lisp', '*.el')
- clojure ('.clj', '.cljs')
- cmake ('*.cmake', 'CMakeLists.txt')
- coffeescript ('*.coffee')
- console ('*.sh-session')
- control ('control')
- cpp ('.cpp', '.hpp', '.c++', '.h++', '.cc', '.hh', '.cxx', '.hxx', '*.pde')
- csharp ('*.cs')
- css ('*.css')
- cython ('.pyx', '.pxd', '*.pxi')
- d ('.d', '.di')
- delphi ('*.pas')
- diff ('.diff', '.patch')
- dpatch ('.dpatch', '.darcspatch')
- duel ('.duel', '.jbst')
- dylan ('.dylan', '.dyl')
- erb ('*.erb')
- erl ('*.erl-sh')
- erlang ('.erl', '.hrl')
- evoque ('*.evoque')
- factor ('*.factor')
- felix ('.flx', '.flxh')
- fortran ('.f', '.f90')
- gas ('.s', '.S')
- genshi ('*.kid')
- glsl ('.vert', '.frag', '*.geo')
- gnuplot ('.plot', '.plt')
- go ('*.go')
- groff ('.(1234567)', '.man')
- haml ('*.haml')
- haskell ('*.hs')
- html ('.html', '.htm', '.xhtml', '.xslt')
- hx ('*.hx')
- hybris ('.hy', '.hyb')
- ini ('.ini', '.cfg')
- io ('*.io')
- ioke ('*.ik')
- irc ('*.weechatlog')
- jade ('*.jade')
- java ('*.java')
- js ('*.js')
- jsp ('*.jsp')
- lhs ('*.lhs')
- llvm ('*.ll')
- logtalk ('*.lgt')
- lua ('.lua', '.wlua')
- make ('.mak', 'Makefile', 'makefile', 'Makefile.', 'GNUmakefile')
- mako ('*.mao')
- maql ('*.maql')
- mason ('.mhtml', '.mc', '*.mi', 'autohandler', 'dhandler')
- markdown ('*.md')
- modelica ('*.mo')
- modula2 ('.def', '.mod')
- moocode ('*.moo')
- mupad ('*.mu')
- mxml ('*.mxml')
- myghty ('*.myt', 'autodelegate')
- nasm ('.asm', '.ASM')
- newspeak ('*.ns2')
- objdump ('*.objdump')
- objectivec ('*.m')
- objectivej ('*.j')
- ocaml ('.ml', '.mli', '.mll', '.mly')
- ooc ('*.ooc')
- perl ('.pl', '.pm')
- php ('.php', '.php(345)')
- postscript ('.ps', '.eps')
- pot ('.pot', '.po')
- pov ('.pov', '.inc')
- prolog ('.prolog', '.pro', '*.pl')
- properties ('*.properties')
- protobuf ('*.proto')
- py3tb ('*.py3tb')
- pytb ('*.pytb')
- python ('.py', '.pyw', '.sc', 'SConstruct', 'SConscript', '.tac')
- rb ('.rb', '.rbw', 'Rakefile', '.rake', '.gemspec', '.rbx', '.duby')
- rconsole ('*.Rout')
- rebol ('.r', '.r3')
- redcode ('*.cw')
- rhtml ('*.rhtml')
- rst ('.rst', '.rest')
- sass ('*.sass')
- scala ('*.scala')
- scaml ('*.scaml')
- scheme ('*.scm')
- scss ('*.scss')
- smalltalk ('*.st')
- smarty ('*.tpl')
- sourceslist ('sources.list')
- splus ('.S', '.R')
- sql ('*.sql')
- sqlite3 ('*.sqlite3-console')
- squidconf ('squid.conf')
- ssp ('*.ssp')
- tcl ('*.tcl')
- tcsh ('.tcsh', '.csh')
- tex ('.tex', '.aux', '*.toc')
- text ('*.txt')
- v ('.v', '.sv')
- vala ('.vala', '.vapi')
- vbnet ('.vb', '.bas')
- velocity ('.vm', '.fhtml')
- vim ('*.vim', '.vimrc')
- xml ('.xml', '.xsl', '.rss', '.xslt', '.xsd', '.wsdl')
- xquery ('.xqy', '.xquery')
- xslt ('.xsl', '.xslt')
- yaml ('.yaml', '.yml')