Friday, June 26, 2015

Write Markdown

Write Blog with Markdown

What is markdown

Markdown is a way to write content for the web. It’s written in what nerds like to call “plaintext,” which is exactly the sort of text you’re used to writing and seeing. Plaintext is just the regular alphabet, with a few familiar symbols, like asterisks ( * ) and backticks ( ` ).

Basic Syntax

  • Italic and Bold:

    To make a phrase italic in Markdown, you can surround words with an underscore ( _ ). For example, this word would become italic.

    To make a word bold, we can use to asterisks( ** ). For example, we can make word bold has bold effect.

  • Header

    To make headers in Markdown, you preface the phrase with a hash mark (#). You place the same number of hash marks as the size of the header you want.

  • Link

    Example: to create a hyperlink to www.github.com, with a link text that says, Visit GitHub!, you'd write this in Markdown: Visit GitHub!

    To add an image, we can use ![text](Some link)

  • Quote

    To create a block quote, all you have to do is preface a line with the "greater than" caret (>).

    You can also place a caret character on each line of the quote. This is particularly useful if your quote spans multiple paragraphs.

  • Indent Lists

    Indent each asterisk one space more than the preceding item.(No blank line)

  • Addtional Context after Lists

    Must start with a blank line beforehead!!! (Or two spaces)

  • Hard Break and Soft Break

    Hard break is a blank line where soft break is two spaces after a line of words.

How to use pandoc

  • Use pandoc to read markdown file
    1. install pandoc

    2. make alias

      alias mdless='function _mdless(){ pandoc -s -f markdown -t man $@ | groff -T utf8 -man | less;};_mdless' 
    3. use 'mdless' to read markdown file

    4. use 'pandoc' to convert markdown file to html
      HTML with smart quotes, table of contents, CSS, and custom footer

      pandoc -s -S --toc -c pandoc.css -A footer.html README -o example3.html  

      Here are some examples of pandoc.

TO DO......

No comments :

Post a Comment