Table of Content generate from tags

226 views
Skip to first unread message

James

unread,
Jan 13, 2015, 12:28:49 AM1/13/15
to tiddl...@googlegroups.com
Hi All,

First of all, I am aware of the existing function "TableOfContentsMacro Expandable", but the function only show the hierarchy of tags and sub-tags.

I am looking for a solution to automate the Table of Content using the tags.

For instance,

Economics
- Journals
- Articles
Business
- Journals
- Whitepaper

:. Tiddlers that tagged with "Journals" are tagged with "Economics".  Those tiddlers tagged with "Journals" and NOT "Economics" will no show in the list.

I have a bunch of journals categories into different subjects and categories.  How can I generate a list like above?

Thanks for your time.  I apology if the explanation is too confusing.

Tobias Beer

unread,
Jan 13, 2015, 6:07:49 AM1/13/15
to tiddl...@googlegroups.com
Hi James,

Have a look at...


Best wishes, Tobias.

Tobias Beer

unread,
Jan 13, 2015, 6:48:32 AM1/13/15
to tiddl...@googlegroups.com
Did some more updates.

Tobias Beer

unread,
Jan 13, 2015, 8:22:19 AM1/13/15
to tiddl...@googlegroups.com
Also added here...


Best wishes, Tobias.

Astrid Elocson

unread,
Jan 13, 2015, 8:29:37 AM1/13/15
to tiddl...@googlegroups.com
Hi Tobias,

You've got </styles> instead of </style> at the end of in the catlist macro.

I'm impressed by the speed with which you create these complicated macros. You write them in far less time than it takes me to understand what you've written! Do you find these sort of macros easy to read if you come back to them a week later?

– æ

Tobias Beer

unread,
Jan 13, 2015, 9:23:04 AM1/13/15
to tiddl...@googlegroups.com
You've got </styles> instead of </style> at the end of in the catlist macro.

Thanks! 

I'm impressed by the speed with which you create these complicated macros. You write them in far less time than it takes me to understand what you've written! Do you find these sort of macros easy to read if you come back to them a week later?

So long as I know / remember what they're supposed to do, yes. ^^ 
Documentation helps ;-)

Best wishes, Tobias.

Tobias Beer

unread,
Jan 13, 2015, 9:30:47 AM1/13/15
to tiddl...@googlegroups.com
For some odd reason it now fails on tb5,
I have no idea what's going on.


Someone has a pointer?

Best wishes, Tobias. 

Tobias Beer

unread,
Jan 13, 2015, 9:38:20 AM1/13/15
to tiddl...@googlegroups.com
Someone has a pointer?

Haha, turns out I already had another example with a macro called catlist. ^^
Renamed that one to catfields as I think it's less relevant.

Best wishes, Tobias.

Tobias Beer

unread,
Jan 13, 2015, 9:42:51 AM1/13/15
to tiddl...@googlegroups.com
Renamed that one to catfields as I think it's less relevant.

And again renamed to cat-by-field... anyhow:


Best wishes, Tobias.

Jimmy Liew

unread,
Jan 13, 2015, 10:07:08 PM1/13/15
to tiddl...@googlegroups.com
Hi Tobias,
Thanks for you response on this.  I really appreciate that.

--
Best Regards,
Jimmy Liew

--
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/EzypDKdUOFE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.

David Gifford

unread,
Jan 13, 2015, 11:54:32 PM1/13/15
to tiddl...@googlegroups.com
Thanks Tobias for this plugin!

Here is an experiment I did with

1. Your catlist (didn't notice the rename until just now)
2. A Google font I particularly enjoy
3. textlines table CSS
4. Images in the same folder

http://giffmex.org/history/history.html

Dave

Tobias Beer

unread,
Jan 14, 2015, 3:57:41 AM1/14/15
to tiddl...@googlegroups.com
Hi Dave,

That is a neat experiment!

By the way, you can use the categories parameter to tell catlist to use the categories defined at a tiddler other than the one you're looking at. So, if the categories are supposed to be the same throughout all, e.g. Centuries, you can simply define them there and say...

<<catlist categories:Centuries>>

If you always want to show a catlist for all centturies, i.e. tiddlers matching a filter, use this method:


For example, you could create...

title: Centuries
catlist
: Events Groups Ideas Institutions People ByLocation

<<list-links filter:"[all[current]tagging[]sort[]]">>

...and tag all centuries Centuries.
Instead of list-links you could use the tagging macro.

Then create a conditional ViewTemplate section...

title: $:/.history/ui/ViewTemplate/catlists
tags
: $:/tags/ViewTemplate
list
-after: $:/core/ui/ViewTemplate/body

<$list
filter
="[all[current]tag[Centuries]]">
<<catlist categories:Centuries>>
</$list><$list
filter
="[all[current]tag[SomeOtherTopic]]">
<<catlist categories:SomeOtherTopic>>
</$list>

Now you can remove all the catlist fields and special markup from your century tiddlers and you are sure to always see the same category listing throughout all centuries without having to set the catlist field for each and every.

I also like to use a summary field at tiddlers for use in lists, e.g.

example: same tiddler

and then...


...rather than a plain tagging list, e.g. in the Centuries tiddler,
so as to show a summary for each century along with just the name.

Best wishes, Tobias. 

Tobias Beer

unread,
Jan 14, 2015, 6:18:50 AM1/14/15
to tiddl...@googlegroups.com
Did some more organising and added an example for automatic catlists here...


As discussed above, the Start tiddler in the documentation wiki now also shows summaries for the examples...


Best wishes, Tobias.

Tobias Beer

unread,
Jan 14, 2015, 7:02:08 AM1/14/15
to tiddl...@googlegroups.com
Also added an example showing a number of category lists in tabs...


Best wishes, Tobias. 

David Gifford

unread,
Jan 14, 2015, 7:28:52 AM1/14/15
to tiddl...@googlegroups.com
Thanks Tobias! I will have a look at that this afternoon, if all goes well. I had been wondering about that, because I thought it would be nice to have, say, one tiddler that filters "People" by century, and one tiddler that filters "People" by type (philosopher, politician, theologian, etc)

Blessings

Dave

Tobias Beer

unread,
Jan 14, 2015, 7:33:17 AM1/14/15
to tiddl...@googlegroups.com
I have made it a little more official now.
Any future updates to catlist and catlist.tiddlyspot.com will be discussed and posted there...


I thought it would be nice to have, say, one tiddler that filters "People" by century, and one tiddler that filters "People" by type (philosopher, politician, theologian, etc)

All of this should (now) be possible.

Best wishes, Tobias.

Tobias Beer

unread,
Jan 14, 2015, 6:19:27 PM1/14/15
to tiddl...@googlegroups.com
Last spot to indicate the changes...

Please note, catlist is dead — except for that older, now revived macro by the same name —  long live xlist.

I...
  • changed it
  • renamed it
  • moved it
Sorry for the fuzz, and move over to this new thread for discussion:


As for James & Dave, please adopt your wikis to the new xlist macro.
The changes shouldn't be all too dramatic.

Best wishes, Tobias.

Tobias Beer

unread,
Jan 16, 2015, 8:57:52 AM1/16/15
to tiddl...@googlegroups.com
Hi James,

I hope this process of changing the basics won't become the norm,
but I have completely rewritten xlist, once more...


So, now it can handle all of these...
  1. a tag-category by other category-tags
  2. a field-category by category-tags
  3. a tag-category by category-fields
  4. a field-category by other category-fields
In short: some filter grouped by some other filter


Best wishes, Tobias.
Reply all
Reply to author
Forward
0 new messages