Re: rst2html for partial HTML generation [Was: Re: 2015: reStructuredText implementations in other programming languages?]

Guenter Milde <[email protected]>
Newsgroups gmane.text.docutils.user
Message-ID <[email protected]>
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


------------------------------------------------------------------------------
Monitor 25 network devices or servers for free with OpManager!
OpManager is web-based network management software that monitors 
network devices and physical & virtual servers, alerts via email & sms 
for fault. Monitor 25 devices for free with no restriction. Download now
http://ad.doubleclick.net/ddm/clk/292181274;119417398;o
_______________________________________________
Docutils-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/docutils-users

Please use "Reply All" to reply to the list.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.