Markdown
- What is Markdown?
- Why Markdown?
- Is there anything markdown can’t do?
- Markdown <> Code & Data Management?
- Implementations and variants
- Converting markdown files
- Real-time collaboration
- Tutorials and resources
- Recommended VS code extensions
- Hands-on markdown tutorial
- Software
- Basic Syntax
What is Markdown?
Section titled “What is Markdown?”- Markdown is a lightweight markup language
- Other markup languages: HyperText Markup Language (HTML), Extensible Markup Language (XML), LaTeX
- WYSIWYG: “What You See Is What You Get
- You literally write out, what you want the text to look like
- File extensions:
.mdor.markdown - Official markdown website: https://daringfireball.net/projects/markdown/
Note: No worries, this is not about learning HTML. The following is just an example to show the idea of markup.
In HTML:
<html> <body> <h3>headline level 3</h3> <h4>headline level 4</h4> </body></html>In Markdown:
### headline level 3 #### headline level 4Rendered output:
headline level 3
Section titled “headline level 3 ”headline level 4
Section titled “headline level 4 ”In HTML:
<ul> <li>List item 1</li> <li><strong>List item 2 in bold</strong></li> </ul>In Markdown:
- List item 1 - **List item 2 in bold**Rendered output:
- List item 1
- List item 2 in bold
- simple, plain text format
- no hassle with formatting
- Worry about content, not layout.
- Most benefits of LaTeX, but simpler
- easy-to-read, easy-to-write
- intuitively human-readable
- machine-actionable, convertible
- independent
- open source
- You only need a text editor
- No need for “word processor programs”
- Microsoft Word, WordPad, macOS Pages, Google Docs, LibreOffice Writer
- reusable
- text is not stuck in formats or layouts
- extendible
- many programs and tools work with markdown
Is there anything markdown can’t do?
Section titled “Is there anything markdown can’t do?”- Beautiful, perfectly designed documents or slide shows
- Reminder: “WYSIWYG”
- Theming, customization, special formatting, design is hard(ly possible)
- Use a word processor (or LaTeX ;-) )
- Collaboration on documents (e.g. reviewing manuscripts)
- comments, suggestions, discuss changes, text highlighting
Markdown <> Code & Data Management?
Section titled “Markdown <> Code & Data Management?”- Works perfectly with (text based) version-control (-> git)
- Many GitHub / GitLab features are based on MD
- README.md, issues, wiki pages, discussions and comments
- referencing files and folders, e.g. in a README.md
- Structuring and commenting code supported by IDEs1, e.g.
- Jupyter Notebooks ~ markdown-commented python scripts
- RMarkdown ~ markdown-commented R scripts
Implementations and variants
Section titled “Implementations and variants”Markdown can be used in many programming languages, platforms and frameworks, incl.:
- GitHub (see GitHub Flavored Markdown)
- Gitlab
- Microsoft Team Chats
- Stack Exchange
- RStudio (see RMarkdown)
- Website generators (forget WordPress)
Note: There are different flavors to how and what is “interpreted”,
e.g. not every markdown parser understands
- bold html text
- emojis :bike:, :beers:, :tent:
- or footnotes2
Converting markdown files
Section titled “Converting markdown files”In case you want to provide your markdown document in another file format, converters help you. The top recommendation: Pandoc.3
Note: pandoc conversion to pdf depends on a LaTeX Installation on your system. If you run into issues, see https://pandoc.org/installing.html for details and recommendations.
Use pandoc to convert your…
pandoc README.md -o markdown_intro.html # ... markdown to .htmlpandoc README.md -o markdown_intro.pdf # ... markdown to .pdfpandoc README.md -o markdown_intro.docx # ... markdown to .docxpandoc -t slidy -s --slide-level=2 --metadata pagetitle=markdown_intro README.md -o markdown_intro_slides.html # ... markdown to html slidesReal-time collaboration
Section titled “Real-time collaboration”Although markdown is not perfect for collaboration on documents (e.g. manuscripts), there are occasions where online collaboration in markdown format comes in very handy (meetings with people that understand MD, code-intensive classes, etc.).
- HedgeDoc: https://hedgedoc.org
- CodiMD https://github.com/hackmdio/codimd
Tutorials and resources
Section titled “Tutorials and resources”- Markdown Guide: https://www.markdownguide.org/
- Commonmark Tutorial: https://commonmark.org/help/tutorial/
- Cheat sheets:
- Markdown emojis https://gist.github.com/rxaviers/7360908
Recommended VS code extensions
Section titled “Recommended VS code extensions”There are many markdown extensions available for Visual Studio Code.
These support you in
-
Creating a table, copy/pasting a table from excel
-
Converting a markdown to PDF
-
Structuring and formatting
-
Creating a TOC
-
Use shortcuts
-
Microsoft Docs Authoring Pack, including
Hands-on markdown tutorial
Section titled “Hands-on markdown tutorial”mostly (adapted) from https://daringfireball.net/projects/markdown/dingus
Try writing a markdown document, using either
- an online markdown editor (e.g. https://demo.hedgedoc.org/new),
- the GitHub or GitLab IDE to create / adapt the
README.md, or - (advanced) your favorite text-editor that supports markdown.
*This is italic*_This is also italic_**This is bold**__This is also bold__# Header 1
## Header 2
###### Header 6Ordered, without paragraphs:
Section titled “Ordered, without paragraphs:”1. Item 12. Item 24. Item 3Note the “4.” in md
Unordered, with paragraphs:
Section titled “Unordered, with paragraphs:”- A list item.- BarYou can nest them:- Abacus * answer * Bubbles 1. bunk 2. bupkis - BELITTLER 3. burperNote: indentation matters
```> Email-style angle brackets> are used for blockquotes.
> > And, they can be nested.
> #### Headers in blockquotes>> - You can quote a list.> - Etc.``````- `<code>` spans are delimited by backticks.
- You can include literal backticks like `` `this` ``.``````This is a code block```Horizontal Rules
Section titled “Horizontal Rules”Three or more dashes or asterisks:
---
* * *
- - - -Manual Line Breaks
Section titled “Manual Line Breaks”End a line with two or more spaces:Roses are red,Violets are blue.- Inline: An [example](http://url.com/ "Title")
- Reference-style labels (titles are optional): An [example][id]. Then, anywhere else in the doc, define the link:
[id]: http://example.com/ "Title"
-
Integrated development environments ↩
-
I am a footnote ↩
-
https://pandoc.org/ “Pandoc” ↩