Link Sentence to other Tiddler

470 views
Skip to first unread message

Marcel Bauer

unread,
Sep 2, 2015, 5:26:02 AM9/2/15
to TiddlyWiki
Hi,
first sorry for my bad English :-)

Is it possible to write special sentences and these sentences appear automatically in another Tiddler as a List?
For Example.
Tiddler 1: "Lorem Ipsum <Special> Veni vidi vici </Special> Lorem ipsum"
Tiddler 2: "1. Veni vidi vici 2. .... 3. ...."

Thanks.


Joshua Fontany

unread,
Sep 2, 2015, 1:32:16 PM9/2/15
to TiddlyWiki
Hi,

I'm also a TW newbie, but I think I understand enough about Transclusion to help out here.
For this case you would want the "Special Sentences" contained in their own tiddlers (tagged with something like 'Special').

Example (TiddlerName: textfield):

Special1: Veni vidi vici
Special2: I came; I saw; I conquered
Tiddler1:  Lorem Ipsum {{Special1}} Lorem ipsum
Tiddler2: <$list filter="[tag[Special]sort[title]]"/>

Tiddler1 would appear as: Lorem Ipsum Veni vidi vici Lorem ipsum
Tiddler2 would appear as:
  • Veni vidi vici
  • I came; I saw; I conquered
Hope that helps. :)

Mat

unread,
Sep 2, 2015, 4:39:26 PM9/2/15
to TiddlyWiki
Ok, you want to "collect" specific segments of many tiddlers content into one tiddler.

I think this should work. Tell me if it doesn't. "special" is a new field you make, i.e the the rows under the large text field.


title: Tiddler1
text: Lorem ipsum {{!!special}} lorem ipsum dolor
special: Veni vidi vici

title: Tiddler2
text: Blahonga fobarim {{!!special}} lorum filorum
special: Alea iacta est

title: Tiddler3
text: <$list filter="[all[]has[special]]">{{!!special}}<br></$list>


<:-)

Jon

unread,
Sep 3, 2015, 5:09:13 AM9/3/15
to TiddlyWiki
Hi,

I'd be very interested in doing this also but I think Marcel was looking for a way of marking up sections of text to be included in a separate tiddler.

Mat, if I understand your suggestion correctly, this would involve writing the text for selection in a separate field box which would be pretty laborious.

Is there a way of simply marking up the text for an automatic transclusion, perhaps something similar to Jeremy's recent addition to split tiddlers based on certain markup in the text (can't remember name)?

Regards
Jon

Marcel Bauer

unread,
Sep 3, 2015, 5:15:56 AM9/3/15
to TiddlyWiki
Thanks a lot guys for your help, but Jon is right.
I just want to mark a sentence in a normal text and would collect them in another Tiddler.

Jed Carty

unread,
Sep 3, 2015, 5:44:04 AM9/3/15
to TiddlyWiki
I like the idea but I don't think it is practical. To make the list all the text of all tiddlers would have to be searched. This search would probably happen every time the list refreshed which would probably be a big problem for the performance of the wiki.
There are other ways, like Mat or Joshua suggested, that would give the same end result but aren't as convenient.

There may be a way to write a plugin that would update the list when you press a button, but I am not sure how complicated that would be.

BJ

unread,
Sep 3, 2015, 3:01:43 PM9/3/15
to TiddlyWiki
HI

On Thursday, September 3, 2015 at 10:09:13 AM UTC+1, Jon wrote:
Hi,

I'd be very interested in doing this also but I think Marcel was looking for a way of marking up sections of text to be included in a separate tiddler.

Mat, if I understand your suggestion correctly, this would involve writing the text for selection in a separate field box which would be pretty laborious.

Is there a way of simply marking up the text for an automatic transclusion, perhaps something similar to Jeremy's recent addition to split tiddlers based on certain markup in the text (can't remember name)?

This could be done by adding extra functionality to the edtor widget, but would involve defining new markup and parsing - not a small job

cheers
BJ

UBi

unread,
Sep 3, 2015, 3:49:41 PM9/3/15
to TiddlyWiki


Am Donnerstag, 3. September 2015 11:44:04 UTC+2 schrieb Jed Carty:
I like the idea but I don't think it is practical. To make the list all the text of all tiddlers would have to be searched. This search would probably happen every time the list refreshed which would probably be a big problem for the performance of the wiki.
 
 Isn't that true for backlink/reference lists, too? The difference is only the search pattern. For references it's the current tiddler name, for Marcels use case it's a <special>blabla</special> sequence. Or am I missing something?


 

HowardM

unread,
Sep 4, 2015, 1:13:59 AM9/4/15
to TiddlyWiki
Surely finding the marked up text is possible - the regexp filter could do that.   One option might be to modify this filter (or have a variant of the filter) so the output is the text string found rather than the title of the tiddler containing it.   Or would this not be feasible ?

Howard

Mat

unread,
Sep 4, 2015, 6:10:41 PM9/4/15
to TiddlyWiki
@Marcel, I made this which I believe is close to what you ask for. (I experimented with some stuff there but think version C is the best.)

(Just for the demo, it uses my SideEditor so it's easy to manipulate stuff. Not necessary for the actual concept. Note it does not work well on macros because every little change refreshes the TW thus loosing focus of the sideeditor.)

Thus;
  • apply macro <<special "....">> around the special part
  • Tag the relevant tiddlers some way to identify which tids are concerned and tag the "refined" tiddler.

Note that the ".tc-tagged-sometag" is most easily used with tags consisting of no-special characters. See docs for styling individual tiddlers.

The whole thing relies on CSS trickery though and I expect there to be limitations with this approach. The real way to do it would probably be in JS using perhaps an ID for the segment and then http://reference.sitepoint.com/javascript/Document/getElementById

<:-)

Jon

unread,
Sep 5, 2015, 5:52:49 PM9/5/15
to TiddlyWiki
That seems to work really well Mat and I'll make a lot of use of it.
Thanks
Jon

HowardM

unread,
Sep 6, 2015, 2:47:56 PM9/6/15
to TiddlyWiki

Mat that is brilliant.  Ideas like that should be linked into the main TW documentation - simple and very effective.  It shows that CSS is not just a way of tweaking the appearance of text - which I must admit was always my impression.


Howard




On Wednesday, September 2, 2015 at 10:26:02 AM UTC+1, Marcel Bauer wrote:

Mat

unread,
Sep 6, 2015, 4:25:50 PM9/6/15
to TiddlyWiki
On Sunday, September 6, 2015 at 8:47:56 PM UTC+2, HowardM wrote:

Mat that is brilliant.  Ideas like that should be linked into the main TW documentation - simple and very effective.  It shows that CSS is not just a way of tweaking the appearance of text - which I must admit was always my impression.

Tank you Jon and Howard.

I've been experimenting with CSS a lot these past weeks and find a lot of interesting stuff. But somehow, much of it feels like cheating. For instance, this particular solution is based on literally hiding the non-desired text. It is not really transcluding anything. I don't know, maybe this is valid... but it feels like painting over the moldy spots in the ceeling. 

That said, I am finding CSS to be much more powerful than I thought too. What is really cool is that you can really change things without actually overwriting code so it won't affect updates. 


<:-)

Marcel Bauer

unread,
Sep 7, 2015, 4:16:52 AM9/7/15
to TiddlyWiki
Wow thats awesome. Thanks a lot!!!!

Tobias Beer

unread,
Sep 18, 2015, 3:53:53 AM9/18/15
to tiddl...@googlegroups.com
Hi Mat,

Nice one. I've fiddled a bit around with it and added it here...

Text Excerpts @ tb5

Although, I am wondering a bit if this is not a suitable job for...

matchfilter @ eucaly-tw5

It would be great if he / or she could chime in and perhaps let us know if we can't use something a little more powerful like...

foo

<excerpt>
whatever the content
</excerpt>

bar

or even...

<excerpt note="some more info">
whatever the content
</excerpt>

Or can we do this using the regexp filter?
Ah, always makes me a little grumpy my lack of literacy when it comes to regexp. ^_^

Best wishes,

— tb

UBi

unread,
Sep 18, 2015, 6:07:27 AM9/18/15
to TiddlyWiki
As far as I understand the doc examples, the regexp filter operator can operate on arbitrary fields, but the result is still a list of tiddler names.
This usecase would require the filter mechanism to return the matching parts, or at least a part of them (capturing groups / back references).

Ideally both would be returned, so one could list the like so:

<$list filter="[regexp:text[<excerpt>(.*)</excerpt>]]">
  <<currentTiddler>>: <<regexp_match1>>
</$list>

Unfortunately, I have no idea how the <<regexp_match1>> part could be accomplished.
Reply all
Reply to author
Forward
0 new messages