'tagging' or 'categorizing' text within a wiki page
Everything I've found about "tagging" relates to entire tiki objects (wiki, tracker, article, etc). Is there any way to "tag" content within a wiki page? I use "tag" loosely. Call it what you will. What I want to be able to do is create links to text that is identified as being of a type, and ideally grouped by value. Here is what I mean, specifically:
In my current site, which I'm transitioning to tiki, I have created a css class to identify text as the name of a ship.
(begin span class="ship-name")Titanic(end span)
(couldn't figure you how to add html as non-parsed - it got stripped anyway)
I use the class for formatting, but also as a parsing tool. I have a standalone application on my development machine (not the web client or server) that can parse all the files under a directory using the string "ship-name". It interprets the text between the tag elements as the ship name. It uses this name to group all pages containing a reference to that ship and then creates a link to each page. I then upload it as static index page
.
Ideally, I'd have an anchor at each span so that I could link directly to the reference, rather than just the page. Even more ideally, I would link only the first occurrence between header elements. I'm wondering if this could be automated with tiki. To much to hope for?
Assuming it can't be done, the rest of this post is a "change request" or "wish list" request for all the developers out there. I'm a programmer, but not for the web, and I'm just getting started with tiki for my "hobby" website. I'd be willing to help, but I think the learning curve would be too long and steep for the time I have. I so I'll do the "run it up the flag pole and see if anyone salutes" approach.
You might say that my theoretical, perfect-world, tiki plugin would combine PLuginAlink, PluginAname, and PluginDiv along with something that lists links, like PluginCategory. Here is my attempt at a spec:
{GROUPDIV(group=, item=, class=, list=0|1)}{GROUPDIV}
- group: name identifying a logical collection of items (e.g. ship names, music categories, etc). Only one can be specified.
- item: comma-separated (?) list of items within the group. The text string can belong to more than one item (useful for cross-references, e.g. ship that is renamed - example below). Can also be used to disambiguate duplicates (e.g. two ships with the same name - example below)
- class: name of css class for formatting (optional)
- list: whether or not to include in a listing using GROUPDIVLIST, i.e. whether or not to create an anchor. Default = 0
{GROUPDIVLIST(group=, item=, links=0|1, page=id, order=alpha|freq, linktext=title|?|?, format=list|table)}{GROUPDIV}
- group: group specified in GROUPDIV. Use to get listing for only one group, or leave blank to get listing of all groups
- item: item specified in GROUPDIV. Use to get links for only one item in the group, or blank to get all items. Ignored if 'group' is set, since different groups would not have same items.
- links: 0 means to list group/item names only, 1 means to list group names/item name and links to each 'tagged' wiki text string
- page: id of page from which to collect links. Optional. If not specified, includes links to all wiki pages
- order: alphabetical listing or by descending number of references (only counts where link=1)
- linktext: what to use as the link text
- format: Display format. These options are just off the top of my head - just to show that some formatting options would be useful.
- List is an unordered list, 'indented' at group/item/link level
- Collapsed would be a the unordered list, but with expand (+) and collapse (-) control, starting with all collapsed
- Expanded would be a the unordered list, but with expand (+) and collapse (-) control, starting with all expanded
- Table would be a table with, say, groups in the first column, items in the second, and links in the third
Note: the hope would be that the plugin would add new groups and items as they are encountered automatically, i.e. it is not necessary to set up groups and items before using them, as with categories. This would make it easier for members to create wiki pages.
I don't know the tiki architecture, but I presume that for all of this a database backend would be required, with some stored proceedures to update tables when wiki pages are created/modified. Not sure that's even possible.
Usage:
on wiki page titled Enterprise-I...
The first {GROUPDIV(group="ShipNames", item="Enterprise1", class="ship-name", list=1)}Enterprise{GROUPDIV}, a British supply sloop, was captured 18 May 1775 at St. Johns, Quebec, Canada, by Colonel B. Arnold, named {GROUPDIV(group="ShipNames", item="Enterprise1", class="ship-name")}Enterprise{GROUPDIV}, and armed for use on Lake Champlain.
would produce
The first Enterprise, a British supply sloop, was captured 18 May 1775 at St. Johns, Quebec, Canada, by Colonel B. Arnold, named Enterprise, and armed for use on Lake Champlain.
on a wiki page titled Enterprise-II...
The second {GROUPDIV(group="ShipNames", item="Enterprise2", class="ship-name", list=1)}Enterprise{GROUPDIV}, a schooner, was a successful letter-of-marque before she was purchased on 20 December 1776 for the Continental Navy.
would produce
The second Enterprise, a schooner, was a successful letter-of-marque before she was purchased on 20 December 1776 for the Continental Navy.
on wiki page titled Enterprise-III...
The third {GROUPDIV(group="ShipNames", item="Enterprise3", class="ship-name", list=1)}Enterprise{GROUPDIV}, a schooner, was built by Henry Spencer at Baltimore, Md., in 1799, and placed under the command of Lieutenant John Shaw. On 23 December 1803, {GROUPDIV(group="ShipNames", item="Enterprise3", class="ship-name" link=1)}Enterprise{GROUPDIV} joined with frigate {GROUPDIV(group="ShipNames", item="Constitution", class="ship-name", list=1)}Constitution{GROUPDIV} to capture the Tripolitan ketch {GROUPDIV(group="ShipNames", item="Mastico","Intrepid", class="ship-name", list=1)}Mastico{GROUPDIV}. Refitted and renamed {GROUPDIV(group="ShipNames", item="Mastico","Intrepid", class="ship-name", list=1)}Intrepid{GROUPDIV}, the ketch was given to Enterprise's commanding officer, Lieutenant Stephen Decatur, Jr....
would produce
On 23 December 1803, Enterprise joined with frigate Constitution to capture the Tripolitan ketch Mastico. Refitted and renamed Intrepid, the ketch was given to Enterprise's commanding officer, Lieutenant Stephen Decatur, Jr....
on wiki page titled 'The Barbary States'...
Here we list three ships (four names) involved in the wars with the the Barbary States, just to illustrate a point: {GROUPDIV(group="ShipNames", item="Enterprise3", class="ship-name" link=1)}Enterprise{GROUPDIV} {GROUPDIV(group="ShipNames", item="Constitution", class="ship-name", list=1)}Constitution{GROUPDIV} {GROUPDIV(group="ShipNames", item="Mastico","Intrepid", class="ship-name", list=1)}Mastico{GROUPDIV} {GROUPDIV(group="ShipNames", item="Mastico","Intrepid", class="ship-name", list=1)}Intrepid{GROUPDIV}
would produce
Here we list three ships (four names) involved in the wars with the the Barbary States, just to illustrate a point:
Enterprise
Constitution
Mastico
Intrepid
A page anywhere on the site with this text
{GROUPDIVLIST(links=0)}{GROUPDIVLIST}
would produce
- Constitution
- Enterprise
- Enterprise
- Enterprise
- Intrepid
- Mastico
{GROUPDIVLIST(links=1)}{GROUPDIVLIST}
would produce
- Constitution
- Enterprise-III (link)
- The Barbary States (link)
- Enterprise
- Enterprise-I (link)
- Enterprise
- Enterprise-II (link)
- Enterprise
- Enterprise-III (link)
- The Barbary States (link)
- Intrepid
- Enterprise-III (link)
- The Barbary States (link)
- Mastico
- Enterprise-III (link)
- The Barbary States (link)