[TW5] Reference first X characters in a tiddler title?

126 vistas
Ir al primer mensaje no leído

Matthew Petty

no leída,
28 abr 2016, 3:29:59 a.m.28/4/2016
para TiddlyWiki
Is there a way to reference the first 4 characters in a tiddler title?
For example: <<list-links "[prefix<first 4 chars of currentTiddler>]">>
This would help with my journals, which are named YYYY MM DD etc, but would also be very useful elsewhere.

As an extension, it could be used to set year, month and day fields for these journal tiddlers, rather than relying on the title for this information.

-Matthew


Mark S.

no leída,
28 abr 2016, 12:31:03 p.m.28/4/2016
para TiddlyWiki
I'm trying to understand exactly what you want. Perhaps an example of input data and output results would be helpful?

The way you've written it, it looks like you want the filter, selecting the tiddlers, to change on the fly according to the already selected/listed tiddler. This gets you into a loop, which can't be right. Possibly what you really want is some sort of grouping?

Good luck!
Mark

Matthew Petty

no leída,
28 abr 2016, 4:10:04 p.m.28/4/2016
para TiddlyWiki

So if I was in a tiddler called "Home improvements", and wanted to return a list of tiddlers with the prefix "Home", I could do this:

<<list-links "[prefix[Home]]">>

But I want to be able to put the list-links command in a skeleton or a macro, so that I don't need to hard-code it.

The first step would be to be able to have a command that returns the first X characters of a field. Then that field could be the current tiddler's title. Then that could be used as the required prefix.


--
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/I-52qmdbEJw/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 https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/9d39917e-5caa-49a6-b925-c5e6812f4334%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mark S.

no leída,
28 abr 2016, 5:14:19 p.m.28/4/2016
para TiddlyWiki
Ok, you can try this, but be sure to backup your TW!

Drag and drop the attached file into your TW. Save and reload.

I've included at test tiddler, but the syntax for usage is:

<$set name="size" value="4">
<<list-links "[prefix
<curstart>]">>
</$set>

You have to set a variable "size" for this to work because TW filter operators will not accept variable parameters.

If you are editing, the preview will show you (in this example) everything that starts with "Draf" because the title of an edited tiddler is "Draft of ..." I suppose I could make a work-around for that, but it would only work in English.

Have fun. Be careful.
Mark
curstart_v1.json

stevesuny

no leída,
19 mar 2017, 5:41:37 p.m.19/3/2017
para TiddlyWiki
Hi, I realize this is old -- but -- did anyone ever try it? I've loaded it, but don't see anything actually happening...Thanks! //steve.
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos