如何在Markdown中编写注释,即HTML输出中未呈现的文本?我在Markdown项目中没有发现任何东西。
当前回答
使用mkdocs时,添加mkdocs.yml:
- pymdownx.striphtml:
strip_comments: true
strip_js_on_attributes: false
然后在任何markdown文件中使用普通的html注释,如
<!-- this is a comment -->
将从html输出中删除。
其他回答
将注释放在非eval、非echo R块中怎么样?即。,
```{r echo=FALSE, eval=FALSE}
All the comments!
```
对我来说似乎很好。
kramdown基于Ruby的markdown引擎,这是Jekyll的默认引擎,因此GitHubPages通过其扩展语法内置了注释支持:
{::comment}
This text is completely ignored by kramdown - a comment in the text.
{:/comment}
Do you see {::comment}this text{:/comment}?
{::comment}some other comment{:/}
这样做的好处是允许在线评论,但缺点是不能移植到其他Markdown引擎。
你可以试试
[](
Your comments go here however you cannot leave
// a blank line so fill blank lines with
//
Something
)
使用mkdocs时,添加mkdocs.yml:
- pymdownx.striphtml:
strip_comments: true
strip_js_on_attributes: false
然后在任何markdown文件中使用普通的html注释,如
<!-- this is a comment -->
将从html输出中删除。
Vim Instant Markdown用户需要使用
<!---
First comment line...
//
_NO_BLANK_LINES_ARE_ALLOWED_
//
_and_try_to_avoid_double_minuses_like_this_: --
//
last comment line.
-->
推荐文章
- 增强的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中使用图像说明