Thanks to Jaquin from #twiki@irc.freenode.net for making me discover a way to simplify the syntax of creating a glossary in TWiki. Apparently, I missed out a part of TWiki’s text formatting rules that allows a user to create anchors. Stupid me.
It’s an update of my previous post. Consider the following…
---+++ A
$ <a name="Application">Application</a> : Of or being a computer program designed for a specific task or use.
That’s what we had before. To simplify it, we change it to the following…
---+++ A
#ApplicationOne
$ Application : Of or being a computer program designed for a specific task or use.
Basically, we add an anchor above the definition list. According to TWiki’s formatting rules, it should be #WikiWordHere. TWiki doesn’t accept #One word, so we must take note that it has to be #MoreThanOne.
Then, we must make some changes to the EXTRACT pattern:
%MAKEINDEX{ "%EXTRACT{ topic="%TOPIC%" expand="off" pattern="^\#(.*?)\n^\s{3}\$\s(.*?)\s:\s(.*?)[\r\n]+”" format=”$1;$2@” }%” split=”@” pattern=”(.*);(.*)” format=”[[#$1][$2]]” }%
Nice and simple. The updated sample can be found here!
Much thanks to Michael Daum for creating such a flexible plugin for TWiki!
1 Response to “Update on creating a glossary in TWiki”