On the Speed of ReST

Ian Bicking ianb at colorstudy.com
Wed May 21 02:53:58 EDT 2003


On Wed, 2003-05-21 at 00:32, Jane Austine wrote:
> > Yes, ReST is very slow.  I made a play Wiki with ReST, and generated the
> > HTML everytime the document was edited.  Intrawiki links were phrased
> > like <a href="!wikiname">...</a>, and then I used a regex to search and
> > replace these when the page was actually rendered (fixing the links and
> > applying the correct style depending on whether the page existed).  That
> > worked fine, and fast enough.
> 
> Thank you, but I don't understand it exactly. Does the reST produce a
> HTML and then regex replaces some part of the result? Are the
> intrawiki links what users type in or are they produced from reST?

Well, you can see what I did at (especially right at the bottom):

http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/webware-sandbox/Sandbox/ianbicking/wiki/Wiki.py?rev=HEAD&content-type=text/vnd.viewcvs-markup

It puts a hook in the reST parser so that links (like link_) that don't
resolve to anything are turned into Wiki links.  So if link_ is a wiki
link, it gets turned into <a href="!link">link</a>.  Then you use a
regex when the page is viewed to find all the links that start with !
(an arbitrary character put in there to distinguish Wiki links), and
turn those into proper links.  So you use reST once after the page is
edited, and then regexes everytime the page is viewed.

  Ian







More information about the Python-list mailing list