Using Images in Structured Text
Hello ! I saw that the code for using inline Images in STX like eg. "My Image":img:myimage.jpg is already in the Zope Distribution. I want to use the img-Style in DTML-Documents which I include in other Documents via the <dtml-var xyz fmt=structured-text> command. Has anyone a solution for that problem. I saw that only Standard-Structured-Text is used, when I use the above notation. So maybe there is another fmt or something like that, maybe as an extention/patch to Standard-Zope. Thanks ! Severin Wiedemann -- Wiedemann EDV Systeme GmbH Landsbergerstr. 77 80339 München Tel.: 089/5108599-0 Fax.: 089/5108599-99
On Fri, Sep 14, 2001 at 12:13:33PM +0200, Severin Wiedemann wrote:
I want to use the img-Style in DTML-Documents which I include in other Documents via the <dtml-var xyz fmt=structured-text> command.
This is a hack, one that doesn't provide for alt text, and doesn't use exactly the same tag structure that you want, but it's a start, and may spur someone into showing a better solution: in StructuredText.py, change the ctag function to: def ctag(s, em=regex.compile( ctag_prefix+(ctag_middle % (("*",)*6) )+ctag_suffix), strong=regex.compile( ctag_prefix+(ctag_middl2 % (("*",)*8))+ctag_suffix), image=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), ): if s is None: s='' s=gsub(strong,'\\1<strong>\\2</strong>\\3',s) s=gsub(image,'\\1<center><img src="\\2"></center>\\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) return s This does allow for you to insert images with --image_object-- tags in the structured text. As I said, no alt tags currently, but it's a start. It will revert back to old behavior on each Zope upgrade if you do it exactly this way, but I'm sure someone else can show how to turn it into a monkey-patch or some other improvement. -- Mike Renfro / R&D Engineer, Center for Manufacturing Research, 931 372-3601 / Tennessee Technological University -- renfro@tntech.edu
You may want to take a look at my external method http://www.zope.org/Members/Barabbas/stx_to_html Danny At 12:13 14/09/2001 +0200, Severin Wiedemann wrote:
Hello !
I saw that the code for using inline Images in STX like eg.
"My Image":img:myimage.jpg
is already in the Zope Distribution.
I want to use the img-Style in DTML-Documents which I include in other Documents via the <dtml-var xyz fmt=structured-text> command.
Has anyone a solution for that problem. I saw that only Standard-Structured-Text is used, when I use the above notation. So maybe there is another fmt or something like that, maybe as an extention/patch to Standard-Zope.
Thanks !
Severin Wiedemann
--
Wiedemann EDV Systeme GmbH Landsbergerstr. 77 80339 München Tel.: 089/5108599-0 Fax.: 089/5108599-99
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
participants (3)
-
Danny William Adair -
Mike Renfro -
Severin Wiedemann