[Zope] Structured Text with Images in regular Zope?

Michel Pelletier michel@digicool.com
Tue, 29 May 2001 10:34:18 -0700 (PDT)


On Tue, 29 May 2001, Mike Renfro wrote:

> On Tue, May 29, 2001 at 11:10:36AM -0400, marc lindahl wrote:
> 
> > I concur -- it would be nice to add an easy image tag in STX.  Just
> > as double quotes is supposed to create a link, some other syntax to
> > generate an OBJECT tag (or, intelligently, IMG if an image... for,
> > ugh, NS4 compatibility), for inclusion of images, sound, video, etc.
> 
> The syntax is already there in the code for the Zope book -- I forgot
> to mention that earlier. My problem is in making the book's
> StructuredText code work with regular Zope. Making it work with the
> STX_Document ZClass would be even better.

The book code is in Zope too, it's just not exposed in any way.  You would
have to do your processing in an external method.

Zope does a really poor job of exposing stx to users.  The only interface
is <dtml-var fmt=structured-text> and that sucks for a few reasons:

  You can't use other input parser, like for images.

  You can't use other outputs, like docbook

  The stx is turned into a dom and transformed every time, instead of
  being cached, making it slow.

I had written a pure python product called STXDocument that exposed all of
this functionality through an API and addable object.  Someone at DC
however, probably mistakenly, deleted it from the CVS repository (or moved
it to where I can't find it) without informing me, so it's gone.

I suggest using an External Method to hack you way to the
StructuredText.HTMLWithImages.HTMLWithImages class.  The syntax is similar
to a link in stx:

"Image alt tag contents":img:/path/to/image

-Michel