Structured Text with Images in regular Zope?
I'm getting tired of writing HTML for all my lab documentation, but I need screenshots, too. What do I need to do to get structured text working with inline images? I know I can just stick <img> tags in the file, but I'd rather not. (Zope 2.3.1, Debian 2.2) -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
From: Mike Renfro <renfro@tntech.edu>
I'm getting tired of writing HTML for all my lab documentation, but I need screenshots, too. What do I need to do to get structured text working with inline images? I know I can just stick <img> tags in the file, but I'd rather not.
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. Perhaps, some other odd character, like '|'?
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. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
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
"Michel Pelletier" <michel@digicool.com> wrote:
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.
Google says it is here http://cvs.zope.org/Zope2/lib/python/Products/STXDocument/Attic/ hth ./Jason
Hi Mike, Mike Renfro wrote:
I'm getting tired of writing HTML for all my lab documentation, but I need screenshots, too. What do I need to do to get structured text working with inline images? I know I can just stick <img> tags in the file, but I'd rather not.
(Zope 2.3.1, Debian 2.2)
i needed that too, so here is my local modification of the ctag function in the file StructuredText.py (Note: this from Zope 2.3.2): def ctag(s, em=regex.compile( ctag_prefix+(ctag_middle % (("*",)*6) )+ctag_suffix), strong=regex.compile( ctag_prefix+(ctag_middl2 % (("*",)*8))+ctag_suffix), under=regex.compile( ctag_prefix+(ctag_middle % (("_",)*6) )+ctag_suffix), code=regex.compile( ctag_prefix+(ctag_middle % (("\'",)*6))+ctag_suffix), bild=regex.compile( ctag_prefix+(ctag_middl2 % (("_",)*8))+ctag_suffix), ): if s is None: s='' s=gsub(strong,'\\1<strong>\\2</strong>\\3',s) s=gsub(under, '\\1<u>\\2</u>\\3',s) s=gsub(code, '\\1<code>\\2</code>\\3',s) s=gsub(em, '\\1<em>\\2</em>\\3',s) s=gsub(bild, '\\1<img src=\\2>\\3',s) return s This defines __imageobjectid__ as a new ST-Tag. Works for me, but i have to remember every Zope-Update to check if this works. Ciao, Jochen -- -------------------------------------------------- Jochen Knuth WebMaster http://www.ipro.de IPRO GmbH Phone ++49-7152-93330 Steinbeisstr. 6 Fax ++49-7152-933340 71229 Leonberg EMail: J.Knuth@ipro.de
participants (5)
-
Jason Cunliffe -
Jochen Knuth -
marc lindahl -
Michel Pelletier -
Mike Renfro