From: Dmitry S. M. <dm...@at...> - 2014-03-27 02:28:02
|
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi, So far my google searches failed to come up with clean implementation of RST [pre/post] processing allowing me to add support for Wiki-like links. The stuff I found normally post-processes resuting HTML which is neither clean no kosher if you ask me :) Which brings me here. I did pick up that there are Readers, Parsers and Writers and that I can drop in Transforms. However I'm a bit puzzled as far as sequence goes. I did find a couple of resources pointing in some direction: http://docutils.sourceforge.net/sandbox/codeintro/codeintro.txt and http://www.webwareforpython.org/downloads/Wiki/ . However the former seems to be unfinished while latter is a bit complex to grok on it's own. What I'm looking for is a sample code that loads RST file, transforms certain elements, then outputs the result. So what I'm thinking is (really pseudo-code here): my_reader=MyReader my_parser=MyParser my_writer=MyWriter my_transform=MyTransform my_writer.default_transform=(my_transform,) my_rst=""" Title ===== something [WikiLinkHere] """ parts=publish_parts(my_rst,reader=my_reader,parser=my_parser,writer=my_writer) So what I want is to process document tree after it has been parsed and built and before it's converted to, say HTML. Which in essence may mean that I could use defaults instead of my_reader and my_parser, but I am unsure. I noticed that there is "default_priority" which seems to control order... Is there some sample/simple code to digest on this subject? -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iD8DBQFTM4GDyDrVuGfS98QRAi3IAJ46hcFmafKROvzVpo/0TZVO848DKQCeM3sl 8U4Pvhd8ct1knIHRJ2atSg8= =4fXk -----END PGP SIGNATURE----- -- This communication is intended for the use of the recipient to whom it is addressed, and may contain confidential, personal, and or privileged information. Please contact us immediately if you are not the intended recipient of this communication, and do not copy, distribute, or take action relying on it. Any communications received in error, or subsequent reply, should be deleted or destroyed. --- |