On Wed, Mar 4, 2009 at 3:20 AM, Jens Vogel <[email protected]> wrote:
>
> Hi,
>
> you can us the Image-Macro like this:
>
> [[Image(clip.png)]]
>

The Image macro will allow you to embed images in many places ... for
example, you could use something like these to paste images attached
to another ticket, or even other wiki pages or external imgs ... (pls,
try them all ... perhaps I am mistaken somehow ;).

[[Image(attachment:ticket:<id>:clip.png)]]
[[Image(attachment:wiki:<PageName>:clip.png)]]

and even to different versions ... AFAICR it is something like this ...

[[Image(attachment:ticket:<id>?version=1:clip.png)]]
[[Image(attachment:wiki:<PageName>?version=3:clip.png)]]

(... if you cannot do this, then read what follows ... ;)

... This gives you many options (see WikiMacros page in TracGuide ;)
... however, this is limited to some standard sources. If you
incorporate new plugins with different trac links pointing to
different images, then you should not be able to render such pictures
using Image macro ... :(

Recently I have developped a plugin (... I will tell you about it [1]_
in more detail later ... now it is in 'alpha' dev state ... ;) and I
realized that there is a way to provide a more extensible approach
[2]_ so that *ANY* valid TracLinks expression may be used inside wiki
macros ... the idea is to use the class FirstTracLinkFormatter [2]_
inside the macro implementation ... This way it is posible to get the
first trac link found in the text supplied in as an arg to the macro
...

Conclusions :

  - If you want to show different images, it is also possible to
extend the current macro so as to make it accept *ANY* TracLinks
expression.
  - Otherwise ... use plain http://<server>/xxx inside Image macro ...
this *should* work ...

For devs :
  -  You could use FirstTracLinkFormatter [2]_ (... or a better
solution ...) to easily expand the possibilities of your macros
accepting TracLinks ...
  - If people like this and find it helpful, it could be included in
Trac itself (... either in utils.py or formatter.py, or ... ;) so that
it be at hand for everybody to be used ... ;)

PD: Image macro is great !!!! ... ;)

.. [1] Trac integration with Google Visualization API
         (https://opensvn.csie.org/traccgi/swlcu/wiki/En/Devel/TracGViz)

.. [2] FirstTracLinkFormatter
         
(https://opensvn.csie.org/traccgi/swlcu/browser/trunk/trac-dev/gviz/ig/wiki...@17:97-L143#L97)

-- 
Regards,

Olemis.

Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/

Featured article:
No me gustan los templates de Django ...

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Trac 
Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/trac-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to