Tags:
create new tag
, view all tags

Select tag Plugin

I am implementing a Plugin to extract the content of a TWiki tag end return it as a file. This would simplify the embedding and extraction of textual informations in a topic.

E.g.: I could do .../view/SelectTagPlugin?selecttag=EXAMPLE&id=foo&num=2 to extract the third occurrence of the %EXAMPLE{... id="foo" ...}% tag from the topic.

This would allow me to create a GraphvizPlugin with almost no effort ... (using WebDot). E.g.:

  • %GRAPHVIZ{"... graph ..." id="foo"}% is transformed to
  • <img src="/cgi-bin/webdot%SCRIPTURLPATH%/view/%WEB%/%TOPIC%.dot.png?selecttag=GRAPHVIZ&id='foo'">

Perhaps this could be useful also for the NotePlugin to extract elements from a different topic?

-- AndreaSterbini - 03 Apr 2002

Cool idea. But wouldnt the GraphvizPlugin still require quite a bit more work if you wanted the image to be clickable. Ie. Where you put TWiki topics as nodes for example?? You would in essence have to massage the "... graph ..." information to add URL information on the fly.

-- JohnCavanaugh - 03 Apr 2002

You just need to wrap the image in the Map by using Webdot again:

  • %GRAPHVIZ{"... graph ..." id="foo"}% to
  • <A MAP="/cgi-bin/webdot....dot.map"><IMG SRC="/cgi-bin/webdot....dot.png"/></A>

-- AndreaSterbini - 04 Apr 2002

Notes and other tags are messed by an editing (for instance, by inserting a tag in the middle).

I suggest that there should be a mechanism for insering a unique id to tags when saving, so for instance a %NOTE% tag is converted into %NOTE{id="adf45dcc7764"}% or something similar. The same for your =%GRAPHWIZ% .

Moreover, I suggest that tags and variables in topics should be accessible using the same mechanism, WEB.TOPIC.TAG.RESOURCE or WEB.TOPIC.VARIABLE. Clearly, there should be a function for accessing variables and tags (used by the rendering machine) at disposal of plugins.

Then, clearly the NOTES plugin would be easier to be written.

-- FrancoBagnoli - 04 Apr 2002

Andrea, you are correct that should work for those graphs that people specify there own specific URL mapping strategy. However, I still believe that is insufficient to make the map clickable for wiki topics. Consider

digraph example {
   WebHome -> WebStatistics;
   WebHome -> SelectTagPlugin;
   SelectTagPlugin -> Main.JohnCavanaugh;
   SelectTagPlugin -> Main.AndreaSterbini;
}

There is no information about how to turn them into links. Granted for an initial implementation this probably wont matter, but if we are to retain the auto-linking capability of wiki I think some additional processing of the graph description will be required.

-- JohnCavanaugh - 05 Apr 2002

If I correctly remember my old WebMapAddon the above graph can be made clickable by writing something similar to:

digraph example {
   node [ color = %WEBBGCOLOR% ;
          URL = "%SCRIPTURL%/view%SCRIPTSUFFIX%?topic=%WEB%.\N" ];
   WebHome; WebStatistics; SelectTagPlugin;
   node [ color = %VAR{"WEBBGCOLOR" web="Main"}%
          URL = "%SCRIPTURL%/view%SCRIPTSUFFIX%?topic=\N" ];
   Main.JohnCavanaugh; Main.AndreaSterbini;
   WebHome -> WebStatistics;
   WebHome -> SelectTagPlugin;
   SelectTagPlugin -> Main.JohnCavanaugh;
   SelectTagPlugin -> Main.AndreaSterbini;
}

I.e. first you specify the nodes and their characteristics, then the edges.

-- AndreaSterbini - 08 Apr 2002

Agreed, that would work fine. Im just lazy and wouldnt want to do that other typing because I would expect the tool to do that for me. But perhaps I am proposing for the tool to be too smart.

-- JohnCavanaugh - 09 Apr 2002

Edit | Attach | Watch | Print version | History: r10 < r9 < r8 < r7 < r6 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r10 - 2003-04-20 - PeterThoeny
 
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2017 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.