[TW5] Comparing Tiddlers side by side

492 views
Skip to first unread message

The Bo

unread,
Feb 9, 2015, 9:16:29 AM2/9/15
to tiddl...@googlegroups.com
Hello,

I was looking for a way to show two tiddlers side by side to compare them.

I already tried to transclude them into a new tiddler with a table of two coloumns but it seems like this doesn't work.
My code so far is:

|<$transclude tiddler="tiddlerA" mode="block">|<$transclude tiddler="tiddlerB" mode="block">|

It only shows the transcluded tiddlerA. The tiddlerB is totally missing.

Any suggestions?
Is there a better way to compare two tiddlers side by side? Maybe a plug-in or macro?

Thank you for your help!
Tueb

Alex Hough

unread,
Feb 9, 2015, 9:58:37 AM2/9/15
to TiddlyWiki
Yes... i tried the same on TW.com

its not a typo


ALex

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, 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.

Birthe C

unread,
Feb 9, 2015, 11:12:18 AM2/9/15
to tiddl...@googlegroups.com
Hi Bo

|<$transclude tiddler="tiddlerA" mode="block"/>|<$transclude tiddler="tiddlerB" mode="block"/>|



Birthe

Alex Hough

unread,
Feb 9, 2015, 11:21:56 AM2/9/15
to TiddlyWiki
Ah ah!

A missing "/"!

Birthe - well done!

the strange thing is that the first one is rendered without the "/"


Alex

--

Alex Hough

unread,
Feb 9, 2015, 11:22:36 AM2/9/15
to TiddlyWiki
maybe there could be an error message of macros?


Alex

Astrid Elocson

unread,
Feb 9, 2015, 1:47:34 PM2/9/15
to tiddl...@googlegroups.com
> the strange thing is that the first one is rendered without the "/"

There are three kinds of tag, for both HTML and widgets:
  • opening <tag>
  • closing </tag>
  • self-closing <tag/>
A self-closing tag is a shorthand for an opening tag followed by a closing tag with no intervening content, i.e.

<tag/> is short for <tag></tag>

If a closing tag is omitted, it will be supplied automatically at the end of the tiddler.

So, in the example given,


|<$transclude tiddler="tiddlerA" mode="block">|<$transclude tiddler="tiddlerB" mode="block">|

the transclusion of B is inside the transclusion of A. And TiddlyWiki normally ignores any content that appears between <$transclude> and </$transclude>. (The exception is when the transclusion's source can't be found. Then, the content is used as placeholder text.)


> maybe there could be an error message of macros?

In this case, there is no error. The syntax is correct. It's entirely valid for the placeholder text of one transclusion to contain a further transclusion of its own.

> I think this could be added to the documentation.
> I don't know how to add or where it should go.

I agree. The syntax for tags (which is shared by both HTML and widgets) deserves a tiddler of its own, and this information belongs there.

At the moment, I'm working on the documentation for variables and macros, but once I've done those, I'll be turning my attention to the wonderful world of widgets.

– æ

Alex Hough

unread,
Feb 9, 2015, 2:36:59 PM2/9/15
to TiddlyWiki
æ,

elegant explanation - as always.

thank you for this and your continued efforts.

Alex

--

Tobias Beer

unread,
Feb 9, 2015, 6:52:15 PM2/9/15
to
A self-closing tag is a shorthand for an opening tag followed by a closing tag with no intervening content, i.e.

<tag/> is short for <tag></tag>

If a closing tag is omitted, it will be supplied automatically at the end of the tiddler.

Perhaps there is a way the parser can at least recognize a non-closing match and if present and render a warning for that tiddler... and even have the tiddler styled with some tc-warning.


Best wishes, Tobias.

The Bo

unread,
Feb 10, 2015, 3:41:28 AM2/10/15
to
Hi Birthe,

ah, it was so easy. Thanks! :)

Now my code looks like this and its working fine:

<table>
<colgroup width="50%" span="2"></colgroup>
<tr>
<td valign="top">
<$select tiddler='$:/generated-list1'>
<$list filter='[all[orphans]]'>
<option><$view field='title'/></option>
</$list>
</$select>
<$tiddler tiddler={{$:/generated-list1}}>
<$transclude mode='block'/>
</$tiddler></td>
<td valign="top">
<$select tiddler='$:/generated-list2'>
<$list filter='[all[orphans]]'>
<option><$view field='title'/></option>
</$list>
</$select>
<$tiddler tiddler={{$:/generated-list2}}>
<$transclude mode='block'/>
</$tiddler></td>
</tr>
</table>

However I would like to find a more comfortable solution. Maybe like a "compare button" on a tiddler where I can choose another tiddler to compare to.
Does anyone have an idea how to implement this?

Greetings
Tueb


Am Montag, 9. Februar 2015 17:12:18 UTC+1 schrieb Birthe C:
Hi Bo

|<$transclude tiddler="tiddlerA" mode="block"/>|<$transclude tiddler="tiddlerB" mode="block"/>|



Birthe


Den mandag den 9. februar 2015 kl. 15.16.29 UTC+1 skrev The Bo:
Hello,

I was looking for a way to show two tiddlers side by side to compare them.

I already tried to transclude them into a new tiddler with a table of two coloumns but it seems like this doesn't work.
My code so far is:

|<$transclude tiddler="tiddlerA" mode="block">|<$transclude tiddler="tiddlerB" mode="block">|

Felix Küppers

unread,
Feb 10, 2015, 4:52:22 AM2/10/15
to tiddl...@googlegroups.com
I think adding a split view for the import mechanism would be nice too. I added this as an issue at github...
https://github.com/Jermolene/TiddlyWiki5/issues/1487

-Felix

Jeremy Ruston

unread,
Feb 10, 2015, 5:15:10 AM2/10/15
to TiddlyWiki
I'm keen to integrate a diff viewer into the core, with several use cases:

* Reviewing imported tiddlers
* Reviewing the results of search and replace before committing them
* Tiddler versioning
* Reviewing shadow overrides

To do it, we'll need to integrate a 3rd party diff library such as this one:


I'm actually keener on integrating a lower level diff/patch/merge library because we can also use it for other things, such as differential tiddler versioning. An example is:


Best wishes

Jeremy.


--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, 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.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

Felix Küppers

unread,
Feb 10, 2015, 10:23:29 AM2/10/15
to tiddl...@googlegroups.com
Hi Jeremy,

Great use cases you mentioned there. Using a diff library would be a killer feature.
It could be also used to quickly signal at import whether tiddlers differ or not by e.g. coloring a title green or red. Then a user could open the diff viewer for a closer look.

-Felix

Tobias Beer

unread,
Feb 10, 2015, 2:42:02 PM2/10/15
to tiddl...@googlegroups.com
Great use cases you mentioned there. Using a diff library would be a killer feature.
It could be also used to quickly signal at import whether tiddlers differ or not by e.g. coloring a title green or red. Then a user could open the diff viewer for a closer look.

I think even without a line-by-line diffing, it would already be good to simply see which fields differ and those only. 

Best wishes, Tobias.

Felix Küppers

unread,
Mar 9, 2015, 12:13:53 PM3/9/15
to tiddl...@googlegroups.com, jeremy...@gmail.com

Alex Hough

unread,
Feb 9, 2015, 12:40:16 PM2/9/15
to TiddlyWiki
Also

I think this could be added to the documentation.
I don't know how to add or where it should go.



Alex
Reply all
Reply to author
Forward
0 new messages