Awesome Tips about Markdown



Series: Awesome Tips about Markdown

Syntax

  • Strikethrough: ~~your text~~
    • your text
  • Inline code: surround your text with backtick symbols `
    • you code

http://example.com/ address@example.com #### Named anchor - [Pandoc: https://pandoc.org/MANUAL.html#heading-identifiers](https://pandoc.org/MANUAL.html#heading-identifiers) - `{#identifier .class .class key=value key=value}` - This approach is easier to use. - we can use html in markdownhtml - Reference the anchormarkdown Mail’s Shortcuts ```

Images

  • Change image destination
    • wrap the image in another link

Build Status

Table without header

  • pipe_tables

Alignment Table Columns

Formatting Text in Tables

  • We can use markdown syntax for link, inline code block, bold, emphasis etc in table content.
Misc
  • Escape the pipe | using inline code block |

List

  • by default, it creates a compact list.
  • put spaces or comments between the items to create a loose list
  • subsequent paragraphs and code block must be indented.
  • Nested list
automatically numbered list
Checklist or task list
  • [] item incomplete
  • [x] item done
Definition Lists
The Term
This is the definition of the the term.

Special Characters

  • @
    • [@TODO title](link) this will not work, we need either escape the @ or remove it

Backslash Escape

Line breaks in markdown

Supported Languages

  • markdown, java, json,html, javascript, shell, yaml, xml etc

Footnotes

Emoji

🐱 😄 🐻

Collapsible Markdown?

CLICK ME hidden by default

Add CSS Style to Markdown


Basic Syntax

Header 1
========

Header 2
--------

~~crossed out~~
_italic_
__bold__
_You **can** combine them_

# kbd tag
<kbd>Ctrl</kbd>

> This is a blockquote
// horizontal rule tag (<hr />)
---
// Code span - use `and`
Type `echo 'Hello World'`

Pandoc Markdown Syntax

~~~~ {#mycode .haskell .numberLines startFrom="100"}
  • line_blocks: beginning with a vertical bar (|) followed by a space
    • useful for verse, addresses, resume
  • pandoc_title_block
  • yaml_metadata_block
    • when use --- as line break, better put a new line after it, otherwise it may be confused with yaml_metadata_block
  • attributes
    • inline_code_attributes
    • {.smallcaps}
    • raw_attribute: {=html}
  • tex_math_dollars

Advanced Markdown Syntax

Slides Syntax

Gotcha

  • Space matters:
    • for link, no space between [] and (), for header, need space between ### and the words
    • check the colors in atom
  • Empty line matters
    • when not sure, add empty line
  • It doesn’t wrap in code block

Tips

  • Add html(javascript, css) directly in Markdown.
  • Embed tweet, facebook, youtube videos by directly copying the embed html code.

Writing in Atom with Markdown

Markdown and Mind Map

Other Markdown Tools

Markdown for Email
  • Use Markdown to write email.
  • Use Markdown Preview to read long email (that roughly )
  • Not used syntax: self anchor link, summary, detail.

Troubleshooting

  • When the output is not same as expected, start from the first place and fix it.
  • Usually we can fix it by add new line, or put the text in `the_text`.
  • check broken headers by searching ## or ```

More Elements to Use


Labels

adsense (5) Algorithm (69) Algorithm Series (35) Android (7) ANT (6) bat (8) Big Data (7) Blogger (14) Bugs (6) Cache (5) Chrome (19) Code Example (29) Code Quality (7) Coding Skills (5) Database (7) Debug (16) Design (5) Dev Tips (63) Eclipse (32) Git (5) Google (33) Guava (7) How to (9) Http Client (8) IDE (7) Interview (88) J2EE (13) J2SE (49) Java (186) JavaScript (27) JSON (7) Learning code (9) Lesson Learned (6) Linux (26) Lucene-Solr (112) Mac (10) Maven (8) Network (9) Nutch2 (18) Performance (9) PowerShell (11) Problem Solving (11) Programmer Skills (6) regex (5) Scala (6) Security (9) Soft Skills (38) Spring (22) System Design (11) Testing (7) Text Mining (14) Tips (17) Tools (24) Troubleshooting (29) UIMA (9) Web Development (19) Windows (21) xml (5)