『此文為轉(zhuǎn)載让蕾,侵刪浪规,原文連接在末尾』
代碼可以注釋,不要的代碼可以先 comment out 探孝。 寫 Markdown 呢笋婿?一篇文章寫出來,總是有點草稿的顿颅,每次都忍痛割愛刪掉缸濒,可能下次還要再敲一遍。 所以我一般都寫到某個特定的 class 的 div 里粱腻,再用 CSS 把它們隱藏庇配。
可惜這種方法既不優(yōu)雅也不通用。
剛搜了一下: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 (vim :`>>`).
親測可用( Pandoc 捞慌、 GitHub 、簡書柬批、作業(yè)部落)啸澡。
如果你想測試一下你的 Markdown 能不能這么用,這是一點測試的文字:
a[^_^]:bcd
顯示的 a c d 應(yīng)當(dāng)間隔一樣長氮帐。
第 1 條附言 · 137 天前
不是每種 Markdown 都能注釋多行文字嗅虏,測試代碼:
a[^_^]: b cd
效果:
a
c
d
v2ex 似乎無力了……(在我自己用的 pandoc 下,只有 a 和 d 這兩行上沐。)
我還試了 Pandoc皮服、GitHub、簡書和作業(yè)部落對此的支持,放在了這里 多行代碼注釋-簡書 - 簡書冰更。
此文為轉(zhuǎn)載产徊,存為己用:原文地址