From: Roberto A. <ra...@ne...> - 2015-06-26 13:58:23
|
On 26/06/15 10:43, Marcelo Huerta wrote: > Roberto Alsina decía, en el mensaje "Re: [Docutils-users] rst2html for partial > HTML generation [Was: Re: 2015: reStructuredText implementations in other > programming languages?]" del 26/6/2015 9:34:16: > >> In Nikola I just extract the body element using lxml and put it in the >> template where I want it. > Maybe I'm being silly, but wasn't it possible to simply call publish_parts and > use the returned parts['html_body'], as indicated in > http://docutils.sourceforge.net/docs/api/publisher.html#publish-parts-details > ? Tell me if I'm missing something. No, that was perfectly fine. We do extract body because we support a bunch of "compilers" and not all of them play as nice. Actual code for rst is like this: return pub.writer.parts['docinfo'] + pub.writer.parts['fragment'] I don't quite recall the specifics of how it ended up like that ;-) |