[tw] Re: Substring of tiddler name

2017-04-18 Thread James
Is that possible to restrict the number of character to be listed from the content instead of title? On Wednesday, 22 March 2017 15:54:22 UTC+8, PMario wrote: > > Hi Steve > > You need to use fileds as described in the code header > > title: $:/substring_from_to > type: application/javascript

[tw] Re: Substring of tiddler name

2017-03-22 Thread PMario
Hi Steve You need to use fileds as described in the code header title: $:/substring_from_to type: application/javascript module-type: macro save and reload, to activate the macro. -m -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To

[tw] Re: Substring of tiddler name

2017-03-21 Thread Steven Schneider
Hello The Bo: Thanks for the code. It looks like is should work... But, in tiddlywiki.com, I 1 - Created a new tiddler with these fields: title: $:/substring_from_to type: application/javascript module-type: macro tag: $:/tags/Macro text: copied all lines provided 2 - Created a new tiddler

[tw] Re: Substring of tiddler name

2017-03-20 Thread PMario
Hi Steve, Substring can be solved with a macro as "The Bo" did. ... If we needed more complicated patterns, something that has been discussed at: https://groups.google.com/forum/#!topic/tiddlywikidev/qSNdKIZWNrc ... would be needed. -m -- You received this message because you are

[tw] Re: Substring of tiddler name

2017-03-20 Thread The Bo
Hey, you could try it with a "substring" macro like this: /*\ title: $:/substring_from_to type: application/javascript module-type: macro A macro to get certain characters from a string. \*/ (function(){ /*jslint node: true, browser: true */ /*global $tw: false */ "use strict"; /*

[tw] Re: Substring of tiddler name

2017-03-18 Thread Mat
Steve, be sure to look around at Grand TWizard Tobias Beers stuff from time to time. I'm pretty sure he has created filter operators that can do what you ask for. <:-) -- You received this message because you are subscribed to the Google Groups "TiddlyWiki"

[tw] Re: Substring of tiddler name

2017-03-17 Thread Steven Schneider
It seems there isn't such a function in TW core. But, is it possible (for someone who knows how to do it) to write a substring js macro. The javascript is this: var str = "Hello world!"; var res = str.substring(x, y); so <$macrocall $name="substring" string="Hello,World" x="1" y="5"/> would

[tw] Re: Substring of tiddler name

2017-03-17 Thread stevesuny
hmm. Mario, thanks! This works sort of But I don't know the prefix - I have a list of 50+ tiddlers with unique digit patterns as part of the tiddler names. I need to extract the prefix. Is there a substring function in TW that can operate on a variable? Like,

[tw] Re: Substring of tiddler name

2017-03-17 Thread PMario
global macro like this: \define myLink(prefix) <$set name="digit-pattern" value="^$prefix$"> <$list filter="[regexp:title]" emptyMessage="no match"><$link to=<> >$prefix$ \end usage: <> The only problem is, if there are several matches. ... It doesn't look good then. have fun! mario

[tw] Re: Substring of tiddler name

2017-03-17 Thread stevesuny
oops, splitBefore[W] was a placeholder; it would be splitbefore[regexp[A-Z]] On Friday, March 17, 2017 at 5:37:17 PM UTC-4, stevesuny wrote: > > Yes, number string is unique. > > I've been working with the regexp, but can't quite get it to work... > > This is what I've got: > > <$set

[tw] Re: Substring of tiddler name

2017-03-17 Thread stevesuny
Yes, number string is unique. I've been working with the regexp, but can't quite get it to work... This is what I've got: <$set name="digit-pattern" value="[0-9]{2} [0-9]{2}">||> this is the unique pattern that begins each tiddler <$list filter="[regexp:title]">

[tw] Re: Substring of tiddler name

2017-03-17 Thread PMario
Hi Steve, Is your number prefix unique? So there is only one tiddler that matches? It would be possible to create a regexp filter - list - link - macro -m -- You received this message because you are subscribed to the Google Groups "TiddlyWiki" group. To unsubscribe from this group and