From: Guenter M. <mi...@us...> - 2015-06-26 15:10:24
|
Ahoj Matěj, On 2015-06-26, Matěj Cepl wrote: > However, I have decided to make The Right Thing™ and wrote my > hexo renderer using rst2html > (https://gitlab.com/mcepl/hexo-renderer-restructuredtext) except > now I have a different problem (issue #1 in that repository). > rst2html generates only complete HTML documents and relies on > tons of CSS stylesheets. To get parts of the HTML document, the "publish_parts()" convenience function can be used. It is described in http://docutils.sourceforge.net/docs/api/publisher.html#publisher-convenience-functions with example code in http://docutils.sourceforge.net/docutils/examples.py > Would it be possible to somehow persuade rst2html to produce > just as plain HTML as possible without dependency on too much of > CSS? This depends on what you intend: * the default html4css2 writer uses one stylesheet¹, default.css (which is very long) * the new html_base writer (!! to be renamed !!)² in the SVN repository uses two stylesheets¹: * minimal.css required basic rules * plain.css rules for easier reading and pleasant layout This writer also gets rid of IE 6 compatibility hacks to achieve a cleaner HTML output. * the html4trans__ writer in the sandbox does not depend on CSS It uses hard-coded HTML-styling (bad!) instead for rST elements that have no real equivalent in HTML. __ http://docutils.sourceforge.net/sandbox/html4trans/ ¹ + ``math.css``, if you have maths in the document and the "math-output" setting is html ² cf. http://repo.or.cz/w/docutils.git/blob_plain/HEAD:/docutils/docs/user/html.txt Günter |