|
From: Richard J. <rj...@ek...> - 2002-09-20 23:51:11
|
On Fri, 20 Sep 2002 8:17 pm, Axel Kollmorgen wrote: > i'm a contributor to drupal ( http://drupal.org ), a php content > management/discussion engine. me and some others there quite like rST, > and we are currently discussing ( http://drupal.org/node.php?id=507#649 > , > http://drupal.org/node.php?title=Structured+Text+-+filter+enhancement ) > the use of (re)StructuredText for submitting (and maybe storing) content > to the system. hence my questions: Sounds like a fine idea. > - does a php port of (re)StructuredText exists? No. > - does a php port of something similar to (re)StructuredText exists > (aside of http://www.keithdevens.com/software/ , StructuredText Markup)? *shrug* > - does any other language port of rST or similar exists? No. There should be :) > - as there is probably none of above: do you think it is possible to > port rST to php? more specifically: > . is there any general experience in porting python to php? I'm sure there's some out there, you just need to find it :) Seriously, I've never seen any conversion information between the two. I've seen some skin-deep comparisons, and they look similar - on the surface, PHP is Python with added punctuation ... "and bugs" according to our PHP developer :) > . how much of / which parts of the docutils distribution would be > required to port for basic functionality, i.e. for rendering html? how > much for more functionality including xml-storage? Fortunately, the design of the docutils project is quite clean and organised, and you can see how it all works at: http://docutils.sourceforge.net/#specification See PEP 258 for a description of the processing framework itself. That works along the basic lines of: 1. read from a source document, parsing the structure out of it and creating a DOM tree (http://docutils.sourceforge.net/spec/doctree.html) 2. optionally do some transforms on the tree (NOOP for current ReST reader) 3. pass the DOM to a writer, in this case HTML 4. perform any HTML-specific DOM transforms (insert system messages, turn references into hyperlinks, handle footnotes, ...) 5. turn the DOM into HTML > . is there any developer documentation about the code structure / > class hierarchies / ... beside > http://docutils.sourceforge.net/#docutils-internals , the code and the > devel-mailing list? See the above specification link. At a minimum, you could just implement a parser for ReST and your own framework for generating the HTML. If that's the case, you just need the ReST format specification: http://docutils.sourceforge.net/spec/rst/reStructuredText.html Hope this helps :) Richard |