FilterOperators to enable revision history?

120 views
Skip to first unread message

TJ Hoeft

unread,
Feb 27, 2015, 12:03:58 PM2/27/15
to tiddl...@googlegroups.com
All,
Thank you very much for TiddlyWiki 5!  Great product.  

I really like using it if I'm writing white papers.  It gives me the freedom to express logical ideas in chunks and worry about the outline later (more of a bottom-up approach).  This works great.  However, I would like the ability to version these atomic ideas as I'm trying to fit them into a structure. I believe that FilterOperators may be able to do this but I don't know how.  I would like to have families of atomic ideas that can change over time (version history) with generic placeholders for document structure.  When I look at this document structure, I want it to be populated with the most recent version of each atomic idea.  However, I would like to easily be able to list all changes over time and search all changes over time.  I believe the fine granularity and search-ability give much greater power over traditional version control systems.

I believe this approach would translate into having Tiddlers that have timestamps by default and FilterOperators that would query by Title and choose the most recent timestamp to transclude into a story.  Can anyone help?

Thank you,
TJ

Jed Carty

unread,
Feb 27, 2015, 12:33:54 PM2/27/15
to
Edited again because I realized that I was using 'name' to refer to two separate things.

That is an interesting idea, and I believe that it can be done using filters.

As long as you create tiddlers for each version, or at least only use the latest one, I have no idea why you wouldn't, than you can make your outline using list filters using a process that is something like this:

1) Every tiddler that is going to be in the final version, and all revisions of those tiddlers, have some tag (someTagForThingsToInculde in the example below). This includes old versions.
2) Each subject/idea that gets revisions has a unique identifier. Each tiddler holding one of the revisions of this idea has a field called `identifier` (or whatever you wish to call it) and in this field it has the name for that subject. The tiddlers themselves have some descriptive title like idea r-1 and idea r-2 or however you want to name them.
3) When you want a new version of an idea you clone the tiddler holding the current version and title it appropriately, then edit the cloned and renamed tiddler as your new version.

To display the full thing with only the latest revisions use something like this (you will probably want to make it prettier than this will be, but the structure will be the same):

<$list filter='[tag[someTagForThingsToInclude]has[identifier]each[identifier]get[identifier]]' variable=CurrentIdentifier>
<$list filter='[identifier<CurrentIdentifier>sort[created]limit[1]]'>
<$transclude/>
</$list>
</$list>

This will find all the tiddlers that are tagged with your inclusion tag, make sure that they have the field `identifier`, only take unique elements (so no duplicate entries) and then give the list of unique identifiers. (the first list widget)
For each one of those identifiers returned it will find the most recently created tiddler (the second list widget) and transclued that (the transclude widget).

You can expand this into sections with subheadings and things like that, but this will give you a basic version of what you want. The inner list widget is the most important part as far as that goes.

edit:

Oh, and to view the revisions over time you can just remove the limit[1] part and it will show all revisions in each section. Or you could use

<$list filter='[identifier[whetevernameyouwanttolookat]sort[created]]'>
<$transclude/>
</$list>

to see a list of the revisions for the things named whetevernameyouwanttolookat

TJ Hoeft

unread,
May 1, 2015, 7:37:06 PM5/1/15
to tiddl...@googlegroups.com
Hi Jed,
Thank you for your reply!  I guess I didn't have the "email me on update" for google groups selected.  Sorry about my late response. I will give this a try and see how it works out.
TJ

TJ Hoeft

unread,
May 6, 2015, 2:51:32 PM5/6/15
to tiddl...@googlegroups.com
Hi Jed,
I'm playing with the method you described.  While I haven't played with transclusion, I did the following:

Versioned Tiddler Family Title: <Theme> <Revision #>
Example: Elevator Pitch - Rev 0.2.1
Tags: elevator-pitch, versioned

Current Tiddler Title: Current Elevator Pitch
Tiddler Query:

<<list-links filter:"[tag[elevator-pitch]tag[versioned]!sort[created]limit[1]]">>

This works pretty well right now.

Thanks again,
TJ

Jed Carty

unread,
May 6, 2015, 5:37:19 PM5/6/15
to tiddl...@googlegroups.com
I am glad it is working. Post if you have any other problems. This is an interesting idea so sharing a version without any sensitive information on tiddlyspot or somewhere public would be nice.

TJ Hoeft

unread,
May 7, 2015, 9:46:46 AM5/7/15
to tiddl...@googlegroups.com
Hi Jed,
I've uploaded a simple versioning example to: http://version-history.tiddlyspot.com/

Is there a way to automatically generate this version history using something like the "Draft Mode"?

Thanks again for the help,
TJ

TJ Hoeft

unread,
May 7, 2015, 2:52:12 PM5/7/15
to tiddl...@googlegroups.com
Hi Jed,
I wanted to mention another use that I found with this approach.  I have been seeking business contacts and I have needed to maintain a Call History for multiple contacts.  By adding a query similar to the version history (shown below), I have been easily able to manage multiple contacts.

Create a tiddler for each <Business Name> to roll up important state.  Within this tiddler, add a corresponding history (timeline).

<<list-links filter:"[tag[business-name]tag[timeline]!sort[created]]">>

Thanks for the ideas,
TJ
Reply all
Reply to author
Forward
0 new messages