Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Kristinita/python-markdown-comments

Open more actions menu
 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mkdcomments

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 git+https://github.com/ryneeverett/python-markdown-comments.git

Example

>>> import markdown
>>> import mkdcomments
>>> comments = mkdcomments.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>

About

A Python-Markdown extension to ignore html comments opened by three dashes.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 82.6%
  • HTML 8.6%
  • CSS 4.8%
  • Python 3.6%
  • Nix 0.4%
Morty Proxy This is a proxified and sanitized view of the page, visit original site.