zoukankan      html  css  js  c++  java
  • [linux] 使用markdown写文档

    github上很多项目都使用*.md来做说明文档 github上会自动将.md文件内容转成html进行呈现

    想用go来写个相关的解析器,顺便练手!!~

     

    # markdown地址
    http://daringfireball.net/projects/markdown/

    # 下载安装
    wget http://daringfireball.net/projects/downloads/Markdown_1.0.1.zip
    unzip Markdown_1.0.1.zip
    cd Markdown_1.0.1/

    # 编译tags文件&查看
    $./Markdown.pl --html4tags foo.md > foo.html
    $firefox foo.html &

    # 语法

    foo.md

    This is an H1
    =============
    
    this is an h2
    ---------------
    
    # This is an H1
    ## This is an H2
    ### This is an H3
    #### This is an H4
    ##### This is an H5
    ###### This is an H6
    
    # This is an H1 #
    ## This is an H2 #
    ### This is an H3 #
    #### This is an H4 #
    ##### This is an H5 #
    ###### This is an H6 #
    
    ## HTML ##
    This is a regular paragraph.
    
    <table>
        <tr>
            <td>Foo</td>
        </tr>
    </table>
    
    This is another regular paragraph.
    
    ## BLOCK ##
    ###### block.eg1 #
    > This is the first level of quoting.
    >
    > > This is nested blockquote.
    >
    > Back to the first level.
    
    ###### block.eg2 #
    > ## This is a header.
    > 
    > 1.   This is the first list item.
    > 2.   This is the second list item.
    > 
    > Here's some example code:
    > 
    >     return shell_exec("echo $input | $markdown_script");
    
    ###### block.code.eg1 #
    Here is an example of AppleScript:
    
        tell application "Foo"
            beep
        end tell
    
    ###### block.code.eg2 #
    ``There is a literal backtick (`) here.``
    
    ## LIST ##
    
    ###### list.eg1 #
    *  red
    *  green
    *  blue
    
    ###### list.eg2 #
    +  red
    +  green
    +  blue
    
    ###### list.eg3 #
    -  red
    -  green
    -  blue
    
    ###### list.eg4 #
    1. red
    2. green
    3. blue
    
    ## HORIZONTAL RULES #
    
    * * *
    ***
    ******
    - - -
    ---------------------------------
    
    ## LINK #
    This is [an example](http://example.com/ "Title") inline link.
    
    [This link](http://example.net/) has no title attribute.
    
    ## EMPHASIS #
    
    *single asterisks*
    
    _single underscores_
    
    **double asterisks**
    
    __double underscores__
    
    ## IMAGE #
    ![Alt text](/path/to/img.jpg)
    
    ![Alt text](/path/to/img.jpg "Optional title")
    
    ![Alt text](http://www.google.com.hk/images/srpr/logo3w.png "Optional title")
    
    ## MISC #
    ###### AUTOMATIC LINKS  #
    <http://www.163.com>
    
    <address@example.com>
  • 相关阅读:
    idea 严重: Error configuring application listener of class org.springframework.web.context.Context 后面省略
    idea 新建 maven项目遇到的一些问题
    常用的DOS命令
    我对速汇金业务的理解
    和同事下班路上讨论心得(服务器部署的几点问题)
    5/6月学习工作总结(压力越大,意志越坚定)
    苏州银行对公久悬户
    苏州银行对公定存通项目
    苏州银行对公存款业务模块维护
    [转载]一个人的失败,99%失败于“脾气”
  • 原文地址:https://www.cnblogs.com/bluefrog/p/2652526.html
Copyright © 2011-2022 走看看