Linking to definitions

345 views
Skip to first unread message

Richard Evans

unread,
Apr 4, 2016, 6:34:28 PM4/4/16
to TiddlyWiki
Hi,

I am using the Definitions List syntax to create a Glossary Tiddler.

;aTerm
:aDefiniton
;aSecondTerm
:aSecondDefinition


What would like to do is is provide a link in a separate Tiddler that opens the Glossary Tiddler at the right term.

Is this possible? Does anybody have any alternatives to achieve the same end, a tooltip for instance?

I have tried using transclusion and/or dictionary tiddlers, I could not get either to behave the way I want.

     Sincerely R A Evans

c pa

unread,
Apr 5, 2016, 1:54:09 AM4/5/16
to TiddlyWiki
You could use the regex filter to search the text of your glossary. Or you could convert your glossary to type=json
title: glossary
text:
{
"aTerm":"aDefiniton",
"aSecondTerm":"aSecondDefinition"
}
Type: application/json

And then link using: {{glossary##aTerm}}

PMario

unread,
Apr 5, 2016, 7:18:44 AM4/5/16
to TiddlyWiki
Hi Richard,

I did extend c pa's idea a little bit. ... IMO it would be nicer to directly show the definition on hover.

So I did create 2 little macros.

 - The first one let's you create a glossary overview
 - The second macro lets you reference the terms

eg:
<<show-glossary>> will show the whole list and
<<term abc>> will show the term and add the definition as tooltip.

download the attachment and drag and drop import it to your TW

There will be a lot more possibilities. But imo it should be a good starter.

have fun!
mario
glossaryTiddlers.json

Lyn Headley

unread,
Apr 5, 2016, 6:45:51 PM4/5/16
to TiddlyWiki
Something I've often wanted is a glossary whose terms could have multiple definitions, along with a way to reference a specific definition from a point of use. This would be useful in preparing an edition of a philosophical text whose author uses the same term to mean different things depending on context. The role of the editor would be to mark up the author's text so that crucial words point to the specific definition indicated by the context.

Richard Evans

unread,
Apr 5, 2016, 11:14:46 PM4/5/16
to tiddl...@googlegroups.com
c pa:
Thank you for the suggestion, but that does not provide the behaviour I want. It substitutes the link text with its value from the json file.

What I want to do is istead of replacing the item, I want to show it, I could use a Tiddler to get the same functionality but then then each Glossary term is in a separate Tiddler with all the overhaeds in maintenance that entails and they are not all in one place. I could tag them with a Glossary tag and collect them under one Tiddler.

But I think it would be much simpler, to use the existing linking structure and be able to go to a point in a Tiddler, and not just the Tiddler.

c pa

unread,
Apr 6, 2016, 12:02:32 AM4/6/16
to TiddlyWiki
Ah hah. Try this

\define showTerm(term)
<tr><td>$term$</td><td>{{glossary##$term$}}</td></tr>
\end

<table><tr><th>Term</th><th>Definition</th></tr>
<$list variable="term" filter="[[glossary]indexes[]]" >
<$macrocall $name="showTerm" term=<<term>> />
</$list>
</table>

As shown here: http://cpashow.tiddlyspot.com/#glossary:glossary%20[[List%20Terms]]

Richard Evans

unread,
Apr 6, 2016, 12:15:55 AM4/6/16
to TiddlyWiki
PMario:

Thank you that is much more what I wanted, having a tooltip definition pop-up is brilliant.I would not have the first idea how to do it myself, so I am indebited to you.

I do have one question, in the <<show-glossary>> macro there is a sort operation but the glossary it produces is not sorted by the terms. I have obviously misunderstood the syntax. Why is the sort operation there, it does not appear to do anything?

Thanks again

     Ciao Ric

PMario

unread,
Apr 6, 2016, 7:46:56 AM4/6/16
to TiddlyWiki
On Wednesday, April 6, 2016 at 5:14:46 AM UTC+2, Richard Evans wrote:
What I want to do is istead of replacing the item, I want to show it, I could use a Tiddler to get the same functionality but then then each Glossary term is in a separate Tiddler with all the overhaeds in maintenance that entails and they are not all in one place. I could tag them with a Glossary tag and collect them under one Tiddler.
 
IMO if you use TW for a longer time, you'll find out, that, if every term is a tiddler has much more advantages, than drawbacks. ... but this only time can tell :)

But I think it would be much simpler, to use the existing linking structure and be able to go to a point in a Tiddler, and not just the Tiddler.

It's actually much much harder, since this is against the TW design priciple, where "everything is a tiddler". So accassing lists of tiddlers is easy, because TW knows about tiddlers but it doesn't know much about the tiddler content atm.

-m

PMario

unread,
Apr 6, 2016, 7:48:47 AM4/6/16
to TiddlyWiki
On Wednesday, April 6, 2016 at 6:15:55 AM UTC+2, Richard Evans wrote:
Thank you that is much more what I wanted, having a tooltip definition pop-up is brilliant.I would not have the first idea how to do it myself, so I am indebited to you.

I do have one question, in the <<show-glossary>> macro there is a sort operation but the glossary it produces is not sorted by the terms. I have obviously misunderstood the syntax. Why is the sort operation there, it does not appear to do anything?

http://tiddlywiki.com/#sort%20Operator  it should default to title. But since we use a dictionary the title field may not be set. ... Which in turn may be a bug. We'll have to investigate.

-mario

Richard Evans

unread,
Apr 6, 2016, 10:03:47 PM4/6/16
to TiddlyWiki
Thanks again

I have to comment on your statment:


It's actually much much harder, since this is against the TW design priciple, where "everything is a tiddler". So accassing lists of tiddlers is easy, because TW knows about tiddlers but it doesn't know much about the tiddler content atm.
Just because it is a design principle does mean it is a good idea. Writing documents has evolved over the centuries to a particular form. This includes various sections within the document that perform specific functions, e.g. table of contants, index, bibliography, and the subject of my query a glossary. A well written document includes these. Whilst they are not appropriate for all documents, for many they are essentail.

TiddlyWiki is a very good idea, but as soon as you try to use it to documention anything of a technical nature, these sections become a requirment that TiddlyWiki has a problem fullfilling.

When a design principle such as everything is a tiddler, prevents good practice. It needs to be re-evaluated.

If TiddlyWiki is to become more than a curiousity used by a few,  it needs to address these points

      Ciao Ric

c pa

unread,
Apr 8, 2016, 1:35:23 PM4/8/16
to TiddlyWiki
Lyn,

Yes. TiddlyWiki can be used for context based definitions. Of course to make it work you need well defined contexts and terms.
I've created a demo of what you can do with context based definitions here: http://cpashow.tiddlyspot.com/#Context%20based%20definitions

I've often thought about this problem. Could you describe what you are thinking of? Provide an example of the contexts and terms you would want to use?
Reply all
Reply to author
Forward
0 new messages