[ZDP] Bending Structured Text to My Will

Paul Boddie paulb@infercor.no
Wed, 18 Aug 1999 13:35:46 +0200

John M. Miller wrote:

> As a test of the looking-to-be-very-cool preview of ZPT I snarfed the
> Structured Text documentation from its respective python source file and
> inserted it into a Structured Text document on my member page
> (http://www.zope.org:18200/Members/millejoh/structuredText/).  Structured
> Text is very intuitive, but I find myself forgetting details more often than
> I like so I though it might be useful having documentation in a fairly
> accessible place.

More accessible than lib/python/StructuredText/StructuredText.py? ;-)

> With a keen sense of irony and a desire to do as little typing as possible
> I'm storing the help doc as structured text.
> Now, it's a testament to ST that the doc moves with almost no need for
> additional enhancements, however I am having a maddeningly difficult problem
> with the following segment:
>   - Text encoded by double quotes followed by a colon, a URL, and concluded
>   by punctuation plus white space, *or* just white space, is treated as a
>   hyper link. For example:
>      "Zope":http://www.zope.org/ is ...
>      Is interpreted as '<a href="http://www.zope.org/">Zope</a> is ....'<br>
>      Note: This works for relative as well as absolute URLs.
> No amount of cajoling on my part will get the "Zope":http://www.zope.org/
> bit to appear as is.  I've tried several permutations of surrounding the
> text with single quotes.  I've even tried surrounding the text with
> <code></code>.  All to no avail.  Any suggestions, anyone.  Pretty please?

Yes, the URL has to be followed by a punctuation mark such as a comma or full
stop. I don't remember if I submitted this one as a bug to the DC team, although
I do remember studying the source code before realising just how difficult it
was going to be to fix the problem on my own.

Structured text is very useful, although it can be restrictive occasionally. I
ended up making a new tag called 'stext' to enable me to get the right heading
levels used in my marked-up documents; I couldn't figure out how to change the
'var' tag code in order to fix this in the 'fmt' option.