如何在 Markdown 注释一段文字

作者: dvorak4tzx | 来源:发表于2016-12-21 17:29 被阅读15048次

    写代码你可以注释,不需要处理的代码就 comment out。
    写 Markdown 呢?一篇文章写出来,总是有点草稿的,每次都忍痛割爱删掉,可能下次还要再敲一遍。
    所以我一般都写到某个特定的 class 的 div 里,再用 CSS 把它们隐藏。

    可惜这种方法既不优雅也不通用。
    机智如我如果一下就 bing 到了:syntax - Comments in Markdown - Stack Overflow

    你可以用下面这些:

    [comment]: <> (This is a comment, it will not be included)
    [comment]: <> (in  the output file unless you use it in)
    [comment]: <> (a reference style link.)
    [//]: <> (This is also a comment.)
    [//]: # (This may be the most platform independent comment)
    

    我决定以后用:

    [^_^]:
        commentted-out contents
        should be shift to right by four spaces (`>>`).
    

    亲测可用(Pandoc、GitHub、简书、作业部落)。十分完美,除了这个 warning:

    pandoc: Duplicate note reference `^' "source" (line 85, column 1)
    

    如果你想测试一下你的 Markdown 能不能这么用,这是一点测试的文字:

    a
    
    [^_^]:
        b
    
    c
    
    d
    

    显示的 a c d 应当间隔一样长。如下:

    a

    c

    d


    @delogn 的评论:

    [^_^]:
        1
    
    [>_<]:
        2
    
    [>_>]:
        3
    

    都可以用啊,不错不错!以后吐槽和心情都可以写在注释里了!

    赞赞赞!

    相关文章

      网友评论

      本文标题:如何在 Markdown 注释一段文字

      本文链接:https://www.haomeiwen.com/subject/rhwqvttx.html