mkdcomments
Original plugin was created by ryneeverett.
A Python-Markdown preprocessor extension to ignore html comments opened by three dashes and any whitespace prior to them. I believe pandoc has similar functionality.
<!-- This is a standard html comment which will remain in the output. -->
<!--- This is a markdown comment which this extension removes. -->
Installation
pip install python-markdown-comments
Example
>>> import markdown
>>> from python_markdown_comments import CommentsExtension
>>> comments = CommentsExtension()
>>> markdowner = markdown.Markdown(extensions=[comments])
>>> markdowner.convert("""\
... blah blah blah <!--- inline comment -->
...
... <!---multiline comment
... multiline comment
... multiline comment-->
...
... even more text.""")
u'<p>blah blah blah</p>\n<p>even more text.</p>'
Infrequently Asked Questions
How can I write about markdown comments without them being removed?
In order to render markdown comments, you must *(a)*use them in an html block (which are not processed as markdown) and *(b)*escape the brackets so the browser won't think they're html comments. E.g.:
<pre>
<!--- meta markdown comment -->
</pre>
Release files for python-markdown-comments 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| python-markdown-comments-1.1.0.tar.gz | 3.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| python_markdown_comments-1.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 7.1 kB
Release files / python-markdown-comments-1.1.0.tar.gz
| Download URL | python-markdown-comments-1.1.0.tar.gz |
|---|---|
| Size | 3.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fa882d35e8d4d469434719e94d189258e7fa6e847cef6400d7ff16429b09d88
|
|
BLAKE2b-256 checksum How to use checksums |
82af701ea212590a9f498b7beab33da678e92cf6c26274cc7f6c658150908b4b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.7.5 Darwin/19.2.0
|
Release files / python_markdown_comments-1.1.0-py3-none-any.whl
| Download URL | python_markdown_comments-1.1.0-py3-none-any.whl |
|---|---|
| Size | 3.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ebf024b2f6abd86eb7d717402497d54a400a93f20005cf81e0ee064243282411
|
|
BLAKE2b-256 checksum How to use checksums |
20ac25d031460347cba842b4e36fe49754eb1636a1fa5a0de48060c3bb2aa68d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.0.0 CPython/3.7.5 Darwin/19.2.0
|