如何在Markdown中编写注释,即HTML输出中未呈现的文本?我在Markdown项目中没有发现任何东西。
当前回答
我使用标准的HTML标记,例如
<!---
your comment goes here
and here
-->
注意三点划线。其优点是,在生成TeX或HTML输出时,它可以与pandoc一起工作。有关更多信息,请访问pandoc讨论组。
其他回答
披露:我写了这个插件。
由于问题没有指定特定的markdown实现,我想提到python markdown的Comments插件,它实现了上述相同的pandoc注释样式。
Vim Instant Markdown用户需要使用
<!---
First comment line...
//
_NO_BLANK_LINES_ARE_ALLOWED_
//
_and_try_to_avoid_double_minuses_like_this_: --
//
last comment line.
-->
如果它在VS代码中,那么还有另一个好选项:
<span hidden> Some texts </span>
与“HTML注释标记”相比,它具有在编辑区域保持语法高亮显示的优势,以及为语义标记添加属性的能力,如<span notice hidden>。
警告:根据常识,不要在源代码中包含个人信息。
如果您正在使用Jekyll或octopress,下面的操作也会起作用。
{% comment %}
These commments will not include inside the source.
{% endcomment %}
Liquid标记{%comment%}首先被解析,并在MarkDown处理器到达它之前被删除。访问者在尝试从浏览器查看源代码时将看不到。
你可以试试
[](
Your comments go here however you cannot leave
// a blank line so fill blank lines with
//
Something
)
推荐文章
- 增强的for循环中的Null检查
- 如何从同一个YAML文件的其他地方引用YAML“设置”?
- 在VS Code中禁用“Comments are not allowed In JSON”错误
- Swift:理解// MARK
- 把if-elif-else语句放在一行中?
- 在构建中编写注释的语法是什么?gradle文件?
- Javascript函数前导bang !语法
- 如何将LaTeX与Markdown混合?
- extern关键字对C函数的影响
- 方括号[]在sql语句中有什么用?
- Java注释中的/**和/*
- PHP中的三个点(…)是什么意思?
- 乳胶渲染在README。md在Github上
- 关键字使用virtual+override vs. new
- 在Markdown Jekyll中使用图像说明