如何在Markdown中编写注释,即HTML输出中未呈现的文本?我在Markdown项目中没有发现任何东西。


当前回答

您可以这样做(YAML块):

~~~
# This is a
# multiline
# comment
...

我只尝试了乳胶输出,请为其他人确认。

其他回答

以下方法非常有效

<empty line>
[whatever comment text]::

该方法利用语法通过引用创建链接由于使用[1]创建了链接引用:http://example.org不会呈现,同样,以下任何内容也不会呈现

<empty line>
[whatever]::
[whatever]:whatever
[whatever]: :
[whatever]: whatever
[whatever]: # whatever with spaces

你可以试试

[](
Your comments go here however you cannot leave
// a blank line so fill blank lines with
//
Something
)

另请参见由越来越多的Markdown工具支持的Critic Markup。

http://criticmarkup.com/

Comment {>> <<}

Lorem ipsum dolor sit amet.{>>This is a comment<<}

Highlight+Comment {== ==}{>> <<}

Lorem ipsum dolor sit amet, consectetur adipiscing elit. {==Vestibulum at orci magna. Phasellus augue justo, sodales eu pulvinar ac, vulputate eget nulla.==}{>>confusing<<} Mauris massa sem, tempor sed cursus et, semper tincidunt lacus.

这在GitHub上有效:

[](Comment text goes here)

生成的HTML如下所示:

<a href="Comment%20text%20goes%20here"></a>

这基本上是一个空链接。显然,您可以在渲染文本的源代码中阅读,但无论如何您都可以在GitHub上阅读。

将注释放在非eval、非echo R块中怎么样?即。,

```{r echo=FALSE, eval=FALSE}
All the comments!
```

对我来说似乎很好。