Skip to main content

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>
&lt;!--- meta markdown comment --&gt;
</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)

Source distribution for python-markdown-comments 1.1.0
File Size Uploaded
python-markdown-comments-1.1.0.tar.gz 3.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for python-markdown-comments 1.1.0
File Interpreter ABI Platform
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

Release history Release notifications | RSS feed

This release

1.1.0 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page