[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-04-05 Thread Stephan Hradek
As usual:


   1. Drag & Drop the link 
    
   into your tiddlywiki.
   2. Import the library (link)
   3. Go to Settings ($:/ControlPanel)
   4. Click on Plugins
   5. Get more plugins
   6. Open my plugin library
   7. install
   


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/bdb652d3-9aaf-49b5-b904-ef6c528117ed%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-04-05 Thread @TiddlyTweeter
I can't find your plugin library???

On Thursday, 5 April 2018 16:23:05 UTC+2, Stephan Hradek wrote:
>
>
>
> Am Dienstag, 3. April 2018 16:30:43 UTC+2 schrieb Mat:
>>
>> @Stephan
>>
>> Any news on this? Is your plugin created? Really looking forward to it 
>> and I think it will be very useful :-)
>>
>> https://skeeve.github.io/tw5-plugins/ 
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/4698934c-9f50-4028-92b5-79b9d68719d8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-04-05 Thread Stephan Hradek


Am Dienstag, 3. April 2018 16:30:43 UTC+2 schrieb Mat:
>
> @Stephan
>
> Any news on this? Is your plugin created? Really looking forward to it and 
> I think it will be very useful :-)
>
> https://skeeve.github.io/tw5-plugins/ 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/55c1b06a-6abf-47fd-b57a-0dd5f489fbcb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-04-05 Thread Stephan Hradek
In case someone is interested: https://skeeve.github.io/tw5-plugins/

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/9c8b8339-66e3-4e82-9150-bd7dcb2c5168%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-04-03 Thread 'Mark S.' via TiddlyWiki
The code in the PR I submitted does as you specify in your examples, except 
that in the last example returning the title if nothing is found would be a 
non-sequitur, and should probably be done through some other mechanism.

Jed's code is probably better and does more, but I've attached mine for 
what it's worth. Drag and drop into your tw, save, reload (back-up is good 
too). Remember to use regexps (with an "s" on the end) and not regexp.

-- Mark



On Monday, February 12, 2018 at 5:38:49 AM UTC-8, Stephan Hradek wrote:
>
>
>
> Am Montag, 12. Februar 2018 11:36:42 UTC+1 schrieb PMario:
>>
>>
>> There is a second PR: https://github.com/Jermolene/TiddlyWiki5/pull/2963 
>> which may be similar. ... +1 this one too!
>>
>> Especially that one looks pretty similar to my code, but seems to do 
> something differently.
>
> Haven't figured out how to completely see that code and include it in my 
> TW to try & test it.
>
> Example of how mine would work:
>
> Exampletiddler contains
> Auf der Mauer, auf der Lauer sitzt 'ne kleine Wanze
>
> First example regexp:
> <$list filter="[regexp:text[auf der (\w+)]]"/>
>
> will return "Lauer" - as "auf" doesn't match "Auf"
>
> Second example regexp:
> <$list filter="[regexp:text[(?i)auf der (\w+)]]"/>
>
> will return "Mauer" - as "auf" now matches "Auf" and we didn't use global 
> search
>
> Third example regexp:
> <$list filter="[regexp:text[(?gi)auf der (\w+)]]"/>
>
> will return "Mauer" and "Lauer" - as we did a case-insensitive global 
> search
>
> Last Example
> <$list filter="[regexp:text[(?i)auf der \w+]]"/>
>
> will return "Exampletiddler" - as we have no capturing group and so the 
> title is returned.
>
>
>
>
>
>
>

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/dd126dd9-72af-44a7-bca0-87b3362f0989%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


$__core_modules_filters_regexps.js.json
Description: application/json


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-04-03 Thread Mat
@Stephan

Any news on this? Is your plugin created? Really looking forward to it and 
I think it will be very useful :-)

<:-)

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/6db4c6d2-c731-47b2-a4bb-afedd4948adb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-24 Thread Stephan Hradek


Am Samstag, 24. Februar 2018 17:40:08 UTC+1 schrieb Mat:
>
>
> What would you say - would your pick operator enable these things?
>
> I'm not sure as I'm missing context and examples for all your keywords.

Anyhow: I intend to offer a plugin soon. So you can check yourself. 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/c881afb2-9e42-4e5c-8d9a-7ae6296bef17%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-24 Thread Mat
[jumping in from holidays so brief]

Stephan, I believe this could be very useful! I made the Cherrypicker 
 plugin a long time ago and I'm 
guessing your solution would make for a much better solution than mine to 
accomplish things, including the ones not yet possible with Cherrypicker 
like:


   - *text summaries* - use marks for highlighting in text and get neat 
   summaries elsewhere
   - *attention notifications* - @bobWow!
   - *hashtags* - #twittlywiki
   - *element extractor* - treat(!) markup or code "identifiers" as cherry 
   marks to get code aggregations, e.g...
  - *CSS* definition overviews, e.g all tc-tiddler-xx {..}
 - ...to e.g identify "last call" overwrites
  - *Macro* index - list all macros and show which tids define them
  - *HTML* elements, e.g all  or #id...
   
What would you say - would your pick operator enable these things?

<:-)

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/418ca67a-080f-494d-adbc-a85b95dca6e7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-19 Thread Stephan Hradek


Am Mittwoch, 14. Februar 2018 15:06:00 UTC+1 schrieb @TiddlyTweeter:
>
> Ciao Stephen
>
> I don't understand the mechanics. But IF what you mean is that we could 
> extract (say) every web-address in text or fields in a whole TW to a list 
> I'm all for it.
>

Yes, we could. Rought idea, using the new ":value" suffix for "each":

<$list filter="[pick[(?g)(https?://^\S+)]each:value[][">


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/01c41215-f6a5-4955-ace2-cc72a439b76f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-14 Thread @TiddlyTweeter
Ciao Stephen

I don't understand the mechanics. But IF what you mean is that we could 
extract (say) every web-address in text or fields in a whole TW to a list 
I'm all for it.

For example: In my use-case it would allow me to then pass that list to a 
link-checker.

Josiah

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/61000b5d-36cb-4576-b14d-d19ed7bb2abd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-12 Thread Stephan Hradek


Am Montag, 12. Februar 2018 17:24:48 UTC+1 schrieb PMario:
>
> Is it possible to have several capturing groups?
>

I think I found a good solution.


   1. filter "pick:field[regexp]"
   Will pick every captured group as a new tiddler. If there is no group it 
   acts exactly like regexp
   2. filter "pickgroups:field[regexp]"
   Will capture every group into one tiddler, joined with character \x00, 
   thus making it usable by
   3. widget "splitgroups"
   which will split the <> at character \x00 into a set of 
   variables, possibly "sweetened" by some text

Examples

Exampletiddler contains
Auf der Mauer, auf der Lauer sitzt 'ne kleine Wanze

First example
<$list filter="[pick:text[auf der (\w+)]]"/>

will return "Lauer" - as "auf" doesn't match "Auf"

Second example
<$list filter="[pick:text[(?i)auf der (\w+)]]"/>

will return "Mauer" - as "auf" now matches "Auf" and we didn't use global 
search

Third example
<$list filter="[pick:text[(?gi)auf der (\w+)]]"/>

will return "Mauer" and "Lauer" - as we did a case-insensitive global search

Fourth example
<$list filter="[pick:text[(?i)auf der \w+]]"/>

will return "Exampletiddler" - as we have no capturing group and so the 
title is returned.

Fifth example
<$list filter="[pick:text[(?i)(auf der) (\w+)]]"/>

will return "Auf der", "Mauer", "auf der" and "Lauer". Each one as a 
seperate tiddler

Sixth example
<$list filter="[pickgroups:text[(?i)(auf der) (\w+)]]">

<$splitgroups a="a: $1" b="b: $2">
<>, <>



will return

"a: Auf der, b: Mauer"
and
"a: auf der, b: Lauer"


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/ce106a6a-07d6-4c13-9a97-3424d7c8ba91%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-12 Thread Stephan Hradek


Am Montag, 12. Februar 2018 17:24:48 UTC+1 schrieb PMario:
>
> On Monday, February 12, 2018 at 2:38:49 PM UTC+1, Stephan Hradek wrote:
>>
>> Last Example
>> <$list filter="[regexp:text[(?i)auf der \w+]]"/>
>>
>> will return "Exampletiddler" - as we have no capturing group and so the 
>> title is returned.
>>
>
> Is it possible to have several capturing groups?
>
> Yes

But now that you ask it… Esch group will be a seperate tiddler, so the 
connection, that they belong to the same source tiddler, is lost. This is 
(was) fine for my usecase, but now that I think about it… 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/b77793fd-1115-47e0-a8f0-7c83e2914666%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-12 Thread PMario
On Monday, February 12, 2018 at 2:38:49 PM UTC+1, Stephan Hradek wrote:
>
> Last Example
> <$list filter="[regexp:text[(?i)auf der \w+]]"/>
>
> will return "Exampletiddler" - as we have no capturing group and so the 
> title is returned.
>

Is it possible to have several capturing groups?

-m 

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/96b9d19e-7e06-4b82-a9c5-8958a709ab71%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-12 Thread Stephan Hradek
I tried to follow https://tiddlywiki.com/dev/ in order to create a new 
filter module plugin, but I cannot even see (with console.log) that it is 
actually use :(

What did I do wrong?

$:/plugins/skeeve/filter-pick

{
"tiddlers": {
"$:/plugins/skeeve/filter-pick/pick.js": {
"created": "20180212142125038",
"text": "/*\\\ntitle: 
$:/plugins/skeeve/filter-pick/pick.js\ntype: 
application/javascript\nmodule-type: filteroperator\n\nFilter operator for 
regexp matching and picking out capturing 
groups\n\n\\*/\n(function(){\n\n/*jslint node: true, browser: true 
*/\n/*global $tw: false */\n\"use strict\";\n\n/*\nExport our filter 
function\n*/\nexports.pick = function(source,operator,options) {\n\tvar 
results = [],\n\t\tfieldname = (operator.suffix || 
\"title\").toLowerCase(),\n\t\tregexpString, regexp, flags = \"\", 
match,\n\t\tgetFieldString = function(tiddler,title) {\n\t\t\tif(tiddler) 
{\n\t\t\t\treturn tiddler.getFieldString(fieldname);\n\t\t\t} else 
if(fieldname === \"title\") {\n\t\t\t\treturn title;\n\t\t\t} else 
{\n\t\t\t\treturn null;\n\t\t\t}\n\t\t};\n\t// Process flags and construct 
regexp\n\tregexpString = operator.operand;\n\tmatch = 
/^\\(\\?([gim]+)\\)/.exec(regexpString);\n\tif(match) {\n\t\tflags = 
match[1];\n\t\tregexpString = regexpString.substr(match[0].length);\n\t} 
else {\n\t\tmatch = /\\(\\?([gim]+)\\)$/.exec(regexpString);\n\t\tif(match) 
{\n\t\t\tflags = match[1];\n\t\t\tregexpString = 
regexpString.substr(0,regexpString.length - 
match[0].length);\n\t\t}\n\t}\n\tvar global= flags.indexOf('g') > 
-1;\n\ttry {\n\t\tregexp = new RegExp(regexpString,flags);\n\t} catch(e) 
{\n\t\treturn [\"\" + e];\n\t}\n\t// Process the incoming 
tiddlers\n\tif(operator.prefix === \"!\") 
{\n\t\tsource(function(tiddler,title) {\n\t\t\tvar text = 
getFieldString(tiddler,title);\n\t\t\tif(text !== null) 
{\n\t\t\t\tif(!regexp.exec(text)) 
{\n\t\t\t\t\tresults.push(title);\n\t\t\t\t}\n\t\t\t}\n\t\t});\n\t} else 
{\n\t\tsource(function(tiddler,title) {\n\t\t\tvar text = 
getFieldString(tiddler,title);\n\t\t\tif(text !== null) {\n\t\t\t\tvar 
m;\n\t\t\t\twhile (m = regexp.exec(text)) {\n\t\t\t\t\tif (m.length == 1) 
{\n\t\t\t\t\t\tresults.push(title);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\tconsole.log(m);\n\t\t\t\t\tfor
 
(var i=1; i



nothing is logged at all.


-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/b18eda88-b96a-4a72-9c58-18552e19105b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-12 Thread Stephan Hradek


Am Montag, 12. Februar 2018 11:36:42 UTC+1 schrieb PMario:
>
>
> There is a second PR: https://github.com/Jermolene/TiddlyWiki5/pull/2963 
> which may be similar. ... +1 this one too!
>
> Especially that one looks pretty similar to my code, but seems to do 
something differently.

Haven't figured out how to completely see that code and include it in my TW 
to try & test it.

Example of how mine would work:

Exampletiddler contains
Auf der Mauer, auf der Lauer sitzt 'ne kleine Wanze

First example regexp:
<$list filter="[regexp:text[auf der (\w+)]]"/>

will return "Lauer" - as "auf" doesn't match "Auf"

Second example regexp:
<$list filter="[regexp:text[(?i)auf der (\w+)]]"/>

will return "Mauer" - as "auf" now matches "Auf" and we didn't use global 
search

Third example regexp:
<$list filter="[regexp:text[(?gi)auf der (\w+)]]"/>

will return "Mauer" and "Lauer" - as we did a case-insensitive global search

Last Example
<$list filter="[regexp:text[(?i)auf der \w+]]"/>

will return "Exampletiddler" - as we have no capturing group and so the 
title is returned.






-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/eff9ea24-3f8d-4424-baab-2c333a1cbd57%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] enhance regexp or new filter "pick"

2018-02-12 Thread PMario
Hi Stephan,

I'm not sure, but imo this pending PR 
https://github.com/Jermolene/TiddlyWiki5/pull/3003  does a similar thing. 
... So it would be nice to +1 the PR and eventually check your code, if the 
functionality could be merged, or if it really is a new operator. 

There is a second PR: https://github.com/Jermolene/TiddlyWiki5/pull/2963 
which may be similar. ... +1 this one too!

-m

-- 
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+unsubscr...@googlegroups.com.
To post to this group, send email to tiddlywiki@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/9281ce58-c607-438a-8438-e2c9292ddd00%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.