Re: Output rst comments to HTML5?
Guenter Milde <[email protected]>
| Newsgroups | gmane.text.docutils.user |
|---|---|
| Message-ID | <[email protected]> |
Dear Matěj,
On 2017-02-27, Matěj Cepl wrote:
> Would it be possible to persuade rst2html5 to output comments as
><p class="comment"> (or something of that sort) in HTML? So,
> that it would be possible to have comments visible in the draft
> version of the document?
This is possible via subclassing the writer and overriding the
visist_comment/depart_comment
methods.
The simpler method would be to set the class in the rst source::
.. class:: comment
This is a paragraph with class="comment" in all export formats.
which becomes::
<document source="/tmp/comm.rst">
<paragraph classes="comment">
This is a paragraph with class="comment" in all export formats.
(The class directive allows content, an empty class directive is applied to
the next element.)
Changing these comments to "real" rst comments is a simple replace-all task.
Günter
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users
Please use "Reply All" to reply to the list.