Check the relevance of the data in the official Markdown documentation
Introduction to Markdown Comments
Markdown comments are a useful feature that allows authors to add notes, reminders, and metadata to their documents without affecting the rendered output. In this article, we will explore the syntax and usage of Markdown comments.
Syntax and Usage
Markdown comments are created using a reference-style link that points nowhere, followed by a placeholder URL (#
) and the comment content in parentheses. The syntax is as follows:
[//]: # (This is a comment)
[//]: # "This is also a comment"
[comment]: # (Another way to comment)
To break it down:
[//]:
creates a reference-style link that points nowhere#
is used as a placeholder URL- The text in parentheses is the comment content
Use Cases
Markdown comments are useful for:
- Adding notes to yourself or other contributors
- Temporarily hiding content
- Including metadata that shouldn't be visible in the final rendered document
- Leaving reminders or TODOs in the source
Examples
Here is an example of how to use Markdown comments to add a note to a document:
This is a paragraph of text.
[//]: # (Note: This paragraph needs to be revised)
In this example, the comment is invisible in the rendered output, but visible in the source code.
Комментариев нет:
Отправить комментарий