Herman

NotesSlidevMe
moon indicating dark mode
sun indicating light mode

Writing in markdown

March 27, 2020

This is the first post for Herman's Blog on writing in Markdown.

Markdown Syntax

1. Headers

H1

H2

H3

H4

H5
H6

Alternatively, for H1 and H2, an underline-ish style:

Alt-H1

Alt-H2

2.Emphasis

Emphasis, aka italics, with asterisks or underscores.

Strong emphasis, aka bold, with asterisks or underscores.

Combined emphasis with asterisks and underscores.

Strikethrough uses two tildes. Scratch this.

3.Lists

(In this example, leading and trailing spaces are shown with with dots: ⋅)

  1. First ordered list item
  2. Another item
    • Unordered sub-list.
  3. Actual numbers don't matter, just that it's a number
  4. Ordered sub-list
  5. And another item.
  • Unordered list can use asterisks
  • Or minuses
  • Or pluses

4.Links

There are two ways to create links.

I'm an inline-style link

I'm an inline-style link with title

I'm a reference-style link

You can use numbers for reference-style link definitions

Or leave it empty and use the link text itself.

URLs and URLs in angle brackets will automatically get turned into links. http://www.example.com or http://www.example.com and sometimes example.com (but not on Github, for example).

Some text to show that the reference links can follow later.

5.Images

Here's our logo (hover to see the title text):

Inline-style: alt text

Reference-style: alt text

6.Code and Syntax Highlighting

Inline code has back-ticks around it.

Blocks of code are either fenced by lines with three back-ticks ```, or are indented with four spaces. I recommend only using the fenced code blocks -- they're easier and only they support syntax highlighting.

var s = "JavaScript syntax highlighting"
alert(s)
s = "Python syntax highlighting"
print s
{
"title": "The Zen of Python"
"content": [
"Beautiful is better than ugly.",
"Explicit is better than implicit.",
"Simple is better than complex.",
"Complex is better than complicated.",
"Flat is better than nested.",
"Sparse is better than dense.",
"Readability counts.",
"Special cases aren't special enough to break the rules.",
"Although practicality beats purity.",
"Errors should never pass silently.",
"Unless explicitly silenced.",
"In the face of ambiguity, refuse the temptation to guess.",
"There should be one-- and preferably only one --obvious way to do it.",
"Although that way may not be obvious at first unless you're Dutch.",
"Now is better than never.",
"Although never is often better than *right* now.",
"If the implementation is hard to explain, it's a bad idea.",
"If the implementation is easy to explain, it may be a good idea.",
"Namespaces are one honking great idea -- let's do more of those!"
]
}
No language indicated, so no syntax highlighting.
But let's throw in a <b>tag</b>.

7.Tables

Tables aren't part of the core Markdown spec, but they are part of GFM and Markdown Here supports them. They are an easy way of adding tables to your email -- a task that would otherwise require copy-pasting from another application.

Colons can be used to align columns.

TablesAreCool
col 3 isright-aligned$1600
col 2 iscentered$12
zebra stripesare neat$1

There must be at least 3 dashes separating each header cell. The outer pipes (|) are optional, and you don't need to make the raw Markdown line up prettily. You can also use inline Markdown.

MarkdownLessPretty
Stillrendersnicely
123

8.Blockquotes

Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.

9.Quote break.

This is a very long line that will still be quoted properly when it wraps. Oh boy let's keep writing to make sure this is long enough to actually wrap for everyone. Oh, you can put Markdown into a blockquote. Blockquotes are very handy in email to emulate reply text. This line is part of the same quote.

10.Definition list

Definition list
Is something people use sometimes.
Markdown in HTML
Does *not* work **very** well. Use HTML tags.

I AKA Herman, build stuff with words and codes.
『 不用闪躲,为我喜欢的生活而活。』
年少轻狂,幸福时光;老当益壮,剑拔弩张。