Creating a glossary (not an index)

I’ve noticed a few times that the excellent demos page has How to build a glossary

I’m sure it’s well-written and all, but that’s not a glossary, not the way I think of it. It’s an index.

I have had need for a simple-to-maintain glossary for some of my work, and I’ve used a different technique, simply tagging tiddlers “Glossary”, and then extracting the first paragraph of each one and adding a “more” link to the whole tiddler. It’s not as precise as a hand-crafted glossary, but it’s quite easy to use. I demo it at https://crosseye.github.io/TW5-demos/2023-01-13a/. The Glossary has nothing but

<<excerptList [tag[Glossary]]>>

and the excerpt list macro is also fairly simple.

If this could be useful to you, feel free to drag $:/_/my/macros/excerptList to your own wiki to use it. Note that the excerpt list might be useful for other things. I have projects incorporating it for more than just glossaries.


Meta question: I choose the category Discussion, plus the tag “showcase”. Should this just go in the category “Showcase”? I’m not sure of the etiquette or of whether something as simple as this belongs there.

7 Likes

@ Scott_Sauyet. Very very useful for me. Thankyou. I already had a tiddler named “Glossary” for expanding abbreviations so I tried using a different name for the tiddler and for the referring tags, which works fine. Maybe obvious for more experienced users, but it’s easy to set up different ‘glossary’ sets by just changing the tag.

Hi @Scott_Sauyet
Nice job! The extraction of first paragraph is a clever solution and the more link is beautiful.
I like your solution. Keep going on.

The Refnotes from kookma has Glossary!
See Tutorial Abbreviations and look at th examples.

It allows to use in text glossary and on mouse hover show it. It also lets you to create glossary table whenever you like.

I use it primarily for creating glossary of abbreviated terms and so the definition shall be one or few lines not a long text as it uses dictionary tiddler.

It would be interesting to see what value an automated glossary would be for example from a list of terms available in the glossary, presumably they need definition, thats why they are in the glossary, search for the terms in the current tiddler and present the glossary links to those words found below.

  • Of course the free links plugin also turns words or phrases for which there is a matching tiddler title into links.

You’re right, it’s an index. I corrected the title, thanks !

1 Like

There is an old thread where I posted some macros. I don’t know if they still work. Don’t have time to test. So just the link: https://groups.google.com/g/tiddlywiki/c/3iKnbAMqCFY/m/JBAxa3P-AwAJ

I’m glad you find it useful. It was after I found a second – and quickly a third – need for it beyond my actual glossary that I refactored to extractList and realized that others might find it useful. I’m glad it helps you.

Oh yes, I looked into this when considering a solution for my glossary some time ago. It’s a wonderful tool that I would happily use for any academic work (and might pick up sooner for its footnotes for another project.) For my case, I want something with as little maintenance as possible. I would like a useful glossary, but at the moment, I really don’t want to maintain it.

If I decide I do want a more hand-crafted version, I can extend it easily enough to look first to a “definition” or “excerpt” field from the tiddler in question, and only take the first paragraph if that’s not available, allowing me do a slow change-over.

BTW, you have a reference in Refnotes 1.8.5 — references, citations, footnotes and abbreviations in Tiddlywiki to what I assume is an old location: https://kookma.github.io/Refnotes/.

Cool. I love your work on that demos page, BTW.

See the work pmario mentions here:

I tested and it still works fine. And I love the documentation included.

You are coming at the other end of the problem than I am. Your work starts with the premise that you already have or can easily write some definitions, and you create a technique to make it simple to make reference to them. Mine starts with the need for some definitions, where I already have the content needed for them embedded in tiddlers, and my technique makes it easy to create the list of definitions/excerpts from that.

I wouldn’t say they are complementary, as you would likely never need to use them together. But they are useful alternatives. As mentioned above, I could see my technique moving on to allow a wiki to perform a slow transition to something more like yours (although with decentralized content.)

I’ve heard about this plugin a number of times. Off to look it up now.

Thanks everyone for the feedback!

2 Likes

Thanks! This is very usefull in other usecases because of the use of filter.

I tinkered with it and get Filter error: Missing closing bracket in filter expression whenever I filter for a tag that contains a space. The filter isn’t actualy missing a bracket!
I can’t figure out a work-around.

Hmm, I’m looking into it. By wrapping the input in double quotes, we get rid of the error message… and destroy the functionality. :frowning_face:

Anyone with stronger understanding of TW internals, feel free to step in here. I’m still struggling with when and where to quote things, and when to use quotation marks versus {{{ - }}} versus other syntax. The issue is that if we call excerptList like this:

<<excerptList "[tag[ My Glossary]]">>

Then this list in excerptList:

\define excerptList(tiddlers)

<dl>
<$list filter="$tiddlers$">
   ***** Here *****
...
</$list>
\end

is empty. A demo of this is at https://crosseye.github.io/TW5-demos/2023-01-13b/. Suggestions quite welcome!

1 Like

It would be much easier to fix typing mistakes if the macro had a tag parameter, because the filter could be anything it’s very hard to fix typos

Never mind. It works fine, so long as you don’t add an extra space. D’oh.

// Wrong!!
<<excerptList "[tag[ My Glossary]]">>
//                 ^^^

// Right
<<excerptList "[tag[My Glossary]]">>
//                 ^^

This is at https://crosseye.github.io/TW5-demos/2023-01-13c/

I’ll update the main demo to include the quotes because they won’t harm anything in the absence of spaces.

I thought this was on purpose !

Here’s a solution I had found, limited to search by tags - just in case this could be useful to someone:

<$edit-text field="tag"/>

<$macrocall $name="excerptList" tiddlers="[tags[]search{!!tag}]:map:flat[all[tiddlers+shadows]tag<currentTiddler>]"/>

Edit: actually it’s even easier than that… <$macrocall $name="excerptList" tiddlers="[search:tags{!!tag}]"/>

Are you suggesting that the parameter should be a single tag?

Wouldn’t that be much more limited? It was the ability to use this for other things than my simple tag that made it more valuable to me. I’ll try to add another example to the demo to show this.

I think I am doing something wrong, though. I want to pass a list of tiddlers to the macro. I think at this point I’m passing a string that the macro then runs to create the list. That feels wrong. But I may be wrong about this. I still have a fair bit of magical thinking when it comes to TW syntax. I’m trying to move beyond that but it’s slow going.

I thought that your question was how to fix a typo (here an extra space at the beginning of the tag name) in a provided filter string, I think this is possible but it requires to write filters that parse the input string, understand each parameter and apply the correct fix to find a result, which is very hard to do with the tools tiddlywiki provide. But if you’re fine with giving the user the responsibility to type their filter without mistakes, then yes it’s better to have a single macro parameter expecting a filter string :slight_smile:

IMO the approach is right but instead of calling the parameter “tiddlers”, it should be called “filter”

That makes sense. I’ll change to that.

I can’t call myself a newbie anymore, I guess, but I think it’s still a newbie mistake. I thought I was passing a list of tiddlers; it was a filter all along and it was just how I handled it further down that accidentally fixed my misconception.

At least it’s an easy fix. :slight_smile:

1 Like

I think that’s now in the demo. I use spaces everywhere, even when they’re optional.

Done.

The original demo has been updated.

Thanks, everyone for the feedback and the help!

1 Like

Whoa! Useful. Works. Tx!

Though the glossary example … Primo cogitavi te alchimiam describere. :slight_smile:

Why did I like this thread? Because it directly addresses simple, recurring, issues to do with categorisation. And you gave a basis to ease understanding and solving those.

At root this is not any kind of TW “problem”.

Rather, it is a great example of how we can use TW to maintain variant everyday classification and commentary systems easily.

If only other software were so flexy.

TT

:blush:

Regardless of whether I use lorem ipsum text in my demos, I have no Latin except what comes from being a wide-read English speaker.

This however is clear enough without a translation. No alchemy here.

It’s precisely the ability to do this sort of thing that made me choose to use TiddlyWiki inside GigantiCorp where I work. We have Sharepoint, Confluence, GitHub and GitLab pages; I work often with Docsify and Docusaurus; there are dozens more options. But the project I’m documenting has a multitude of interlinked parts. The ability to write small tiddlers and repeatedly combine them into great numbers of views is unequaled by any tool I’ve used. This is just one example of that. It’s not particularly difficult, although I think I asked here some months ago about part of the syntax I needed.

To me, what’s amazing about this community is that my little thing might be useful to you or to another user. But others will want pmario’s version or Mohammad’s. They’re all simply available, and all do slightly different, but related things, so you can choose what’s best for you.

(Findability is a different question. I think the community, for all its attempts, still hasn’t really solved this.)

3 Likes

It is good to read about such cases as yours.
Confirming the practicality and the almost fun to get a simple TW square of the hypotenuse.

Many thanks
TT

I tried to recreate something look-alike @springer’s Glossary of Terms from Ethics at Wes — Dec 20 Tuesday     . I was totaly lost in the complexity and dependencies to templates, stylesheets etc.
Now I tinkered witch your macro, combined it with @Mohammad’s shiraz’s Multicolumn tiddler layout and I got what I tried for hours within minutes.

\define excerptListcompact(filter)
<dl>
<$list filter="$filter$">
<$set name="parent" value={{!!title}}>
@@color:steelblue; ''{{!!title}}: ''@@
<$list filter="[all[current]get[text]splitbefore[

]split[

]first[]]">
<<currentTiddler>> &nbsp; <$link to=<<parent>>> [... more]</$link>
</$list><br>
</$set>
</$list>
</dl>
\end

Install shiraz and give the tiddler a field class:multicol.
Just a Big Thanks to the contributing folks!

4 Likes