Markdown - cheatsheet

Markdown - cheatsheet
Page content

Markdown is an easy way to write formatted and structured content in a simple text editor. It converts easily to various formats, such as HTML and is often used to publish github project documentation in form of a README.md. Here is my personal cheatsheet.

First appearance

Markdown has no official RFC or specification and is just a collection of best practises, that may differ depending on the platform / parser that is used. Although there is no official specification, a link to the original source may help you understanding the idea before going into detail.

Headers

# H1
## H2
### H3
#### H4
##### H5
###### H6

Emphasis

*italic*
**bold**
***bold italic***
~~strikethrough~~

<!--- this might not work everywhere -->
==highlight yellow==
[An embedded link](https://www.pilabor.com "Link title")

[A link referenced by number][1]
[1]: https://www.pilabor.com

[A link referenced by name]
[A link referenced by name]: https://www.pilabor.com

Images

![embedded alt text](https://picsum.photos/200 "embedded title text")


![referenced alt text][my-image]
[my-image]: https://picsum.photos/200 "referenced title text"

Blockquotes

> This is one multiline
> blockquote

> this is a blockquote
>> this is a nested blockquote

Footnotes

This is a footnote[^1], that might not work everywhere

[^1]: Footnotes can be used to give details at the bottom of a page

Escaping

\*literal asterisks - not italic\*
Escaping backticks might work different: `` or \`

List of chars, that may need to be escaped (depending on context): \, `, *, _, {, }, [, ], (, ),#, +, -, ., !

Lists

<!--- unordered lists -->
- unordered list item 1
  - sub item
- unordered list item 2

<!--- ordered lists -->
1. ordered list item
   - unordered sub item
2. ordered list item

<!--- split lists (different lists following up each other) -->
- list one - item 1
  ^
- list two - item A
  ^
- list three - item _i_

<!--- task lists (with checkboxes) - this might not work everywhere -->
- [x] completed task
- [ ] open task
- [x] another completed task

Horizontal rules

Horizontal rules can be done like this: 

---

Raw HTML

If everything else fails to work, you can still use raw HTML most of the time, although this might be escaped by some renderers to provide better security:


# We need to do something very complex here

an acronym with multiple color letters: 
<span style="color:red;">R</span>
<span style="color:green;">G</span>
<span style="color:blue;">B</span>


Details / spoilers

<!--- github variant -->
<details><summary>Show more...</summary>
here are some details
</details>

<!--- stackoverflow variant -->
>! A multi-line spoiler  
>! contains ! multiple times

Tables

| First Column (align left) | Second Column (center) | Third Column (align right) |
| ------------------------- |:----------------------:| --------------------------:|
|^---no colon align left---^|^---two colons center--^|^-right colon aligns right-^|
| Second line, col 1        | Second line, col 2     | Second line, col 3         |

Code and Syntax


`inline code`

``` 
// code block
```

```php
// php highlighted code block
// available highlighters depend on your environment
// for a list of them, see bottom of the page
```

<!--- markdown to show how to use code in markdown (INCEPTION - more backticks nest more layers)-->
# Here is how to highlight code
````markdown
My code looks like this
```php
<?php
echo "hello world!";
```
````

Syntax highlighting

Markdown renderers often ship with different features for syntax highlighting. The list below is searchable a reference for hugo , the static site generator, which might work for other renderers.

Highlighter (e.g. ```markdown)Language
markdownMarkdown
ABAP, abapABAP
abnfABNF
actionscript, asActionScript
actionscript3, as, as3ActionScript 3
ada, ada2005, ada95, adb, adsAda
al, dalAL
ng2Angular2
antlrANTLR
aconf, apache, apacheconf, conf, htaccessApacheConf
aplAPL
applescriptAppleScript
arduino, inoArduino
awk, gawk, mawk, nawkAwk
bal, ballerinaBallerina
*, bsdmake, mak, make, makefile, mf, mkBase Makefile
bash, bash_*, bashrc, ebuild, eclass, env, exheres-0, exlib, ksh, sh, shell, zsh, zshrcBash
bat, batch, cmd, dosbatch, winbatchBatchfile
bib, bibtexBibTeX
b3d, bb, blitzbasic, bplus, declsBlitzBasic
bnfBNF
b, bf, brainfuckBrainfuck
c, h, idc, x[bp]mC
c#, cs, csharpC#
C, CPP, H, c++, cc, cp, cpp, cxx, h++, hh, hpp, hxxC++
caddy, caddyfileCaddyfile
caddy-d, caddyfile-d, caddyfile-directivesCaddyfile Directives
capnpCap’n Proto
cassandra, cqlCassandra CQL
ceylonCeylon
cf, cf3, cfengine3CFEngine3
cfscfstatement
chai, chaiscriptChaiScript
cheetah, spitfire, spt, tmplCheetah
clj, clojureClojure
cmake, txtCMake
COB, CPY, cob, cobol, cpyCOBOL
coffee, coffee-script, coffeescriptCoffeeScript
cl, common-lisp, lispCommon Lisp
coq, vCoq
cr, crystalCrystal
cssCSS
cython, pxd, pxi, pyrex, pyxCython
d, diD
dartDart
diff, patch, udiffDiff
django, jinjaDjango/Jinja
docker, dockerfileDocker
dtdDTD
dyl, dylan, intrDylan
ebnfEBNF
elixir, ex, exsElixir
elmElm
el, elisp, emacs, emacs-lispEmacsLisp
erl, erlang, es, escript, hrlErlang
factorFactor
fish, fishshell, loadFish
forth, frt, fs, fthForth
F03, F90, f03, f90, fortranFortran
F, f, fortranfixedFortranFixed
fs, fsharp, fsiFSharp
S, asm, gas, sGAS
gd, gdscriptGDScript
genshi, kid, xml+genshi, xml+kidGenshi
html+genshi, html+kidGenshi HTML
genshitextGenshi Text
Cucumber, FEATURE, Gherkin, cucumber, feature, gherkinGherkin
frag, geo, glsl, vertGLSL
gnuplot, plot, pltGnuplot
go, golangGo
go-html-templateGo HTML Template
go-text-templateGo Text Template
gql, graphql, graphqlsGraphQL
1p, 3pm, [1-9], groff, man, nroffGroff
gradle, groovyGroovy
handlebars, hbsHandlebars
haskell, hsHaskell
haxe, hx, hxslHaxe
hclHCL
hexdumpHexdump
hlbHLB
htm, html, xhtml, xsltHTML
httpHTTP
hy, hylangHy
idr, idrisIdris
igor, igorpro, ipfIgor
cfg, dosini, editorconfig, gitconfig, inf, iniINI
ioIo
ijs, jJ
javaJava
javascript, js, jsm, mjsJavaScript
jsonJSON
jl, juliaJulia
jungleJungle
kotlin, ktKotlin
lighttpd, lightyLighttpd configuration file
ll, llvmLLVM
lua, wluaLua
mako, maoMako
markdown, md, mkdmarkdown
m, mason, mc, mhtml, miMason
cdf, ma, mathematica, mma, nb, nbpMathematica
m, matlabMatlab
mcfunctionmcfunction
metalMetal
MZN, dzn, fzn, minizinc, mznMiniZinc
mlirMLIR
def, m2, mod, modula2Modula-2
mc, monkeycMonkeyC
morrowind, mwscriptMorrowindScript
myghty, mytMyghty
mysql, sqlMySQL
ASM, asm, nasmNASM
newspeak, ns2Newspeak
conf, nginxNginx configuration file
nim, nimrodNim
nix, nixosNix
h, m, obj-c, objc, objective-c, objectivecObjective-C
ml, mli, mll, mly, ocamlOCaml
m, octaveOctave
openscad, scadOpenSCAD
org, orgmodeOrg Mode
conf, pacmanconfPacmanConf
perl, pl, pm, tPerl
inc, php, php3, php4, php5, php[345]PHP
inc, php, php[345], phtmlPHTML
pigPig
pc, pkgconfigPkgConfig
plpgsqlPL/pgSQL
no-highlight, plain, text, txtplaintext
ponyPony
postgres, postgresqlPostgreSQL SQL dialect
eps, postscr, postscript, psPostScript
inc, povPOVRay
powerquery, pqPowerQuery
posh, powershell, ps1, psd1, psm1PowerShell
ecl, pl, pro, prologProlog
promqlPromQL
proto, protobufProtocol Buffer
pp, puppetPuppet
bazel, bzl, jy, py, py3, pyi, python, python3, pyw, sage, sc, tacPython
py2, python2Python 2
BAS, bas, basic, qbasicQBasic
qbs, qmlQML
R, Renviron, Rhistory, Rprofile, S, r, s, splusR
racket, rkt, rktd, rktlRacket
ragelRagel
6pl, 6pm, nqp, p6, p6l, p6m, perl6, pl, pl6, pm, pm6, raku, rakudoc, rakumod, rakutest, tRaku
jsx, reactreact
re, reason, reasonml, reiReasonML
reg, registryreg
rest, restructuredtext, rstreStructuredText
arexx, rex, rexx, rxRexx
duby, gemspec, rake, rb, rbw, rbx, rubyRuby
in, rs, rustRust
SAS, sasSAS
sassSass
scalaScala
scheme, scm, ssScheme
sce, sci, scilab, tstScilab
scssSCSS
smalltalk, squeak, stSmalltalk
smarty, tplSmarty
snobolSnobol
sol, soliditySolidity
rq, sparqlSPARQL
sqlSQL
conf, squid, squid.conf, squidconfSquidConf
fun, sig, smlStandard ML
styl, stylusStylus
svelteSvelte
swiftSwift
automount, device, dnssd, link, mount, netdev, network, path, scope, service, slice, socket, swap, systemd, target, timerSYSTEMD
sv, svh, systemverilogsystemverilog
tablegen, tdTableGen
ASM, asm, tasmTASM
rvt, tclTcl
csh, tcshTcsh
src, termcapTermcap
src, terminfoTerminfo
terraform, tfTerraform
aux, latex, tex, tocTeX
thriftThrift
tomlTOML
tradingview, tvTradingView
t-sql, tsqlTransact-SQL
tu, turingTuring
ttl, turtleTurtle
twigTwig
ts, tsx, typescriptTypeScript
ts, typoscriptTypoScript
typoscriptcssdataTypoScriptCssData
typoscripthtmldataTypoScriptHtmlData
bas, vb, vb.net, vbnetVB.net
v, verilogverilog
vhd, vhdlVHDL
exrc, gvimrc, vim, vimrcVimL
vue, vuejsvue
wdteWDTE
rss, svg, wsdl, wsf, xml, xsd, xsl, xsltXML
conf, xorg.confXorg
yaml, ymlYAML
yangYANG
zigZig
Andreas Fuhrich avatar
About Andreas Fuhrich
I’m a professional software developer and tech enthusiast from Germany. On this website I share my personal notes and side project details. If you like it, you could support me on github - if not, feel free to file an issue :-)