[tw] Re: [TW5] How force evaluation to get a resulting string?

2016-02-28 Thread Eric Shulman
On Sunday, February 28, 2016 at 10:02:57 PM UTC-8, Mark S. wrote:
>
> Eric, you're seeing this as someone who can whip up a special filter any 
> time you need one. For the rest of us, how to make a filter isn't even 
> documented. This isn't a one time problem that Mat has with his particular 
> use case, it's a problem that comes up over and over whenever any one tries 
> to push the boundaries even slightly.  
>
For instance, AFAIK, there is no filter for comparison operations. 
> Reporting on tiddlers that are newer than some arbitrary date, or that have 
> an indexed field greater some number would be useful in many situations. I 
> put out a request for such a filter in July 2015 and there was interest ... 
> but no follow up. I don't want to nag anyone -- I want to be able to roll 
> my own solutions like it was possible with your InlineJavascriptPlugin. 
>

There are two issues here:

1) What is the best course of action when the functionality you want isn't 
*currently* provided by the core.  Some possible responses:
   * find a workaround using different core functionality
   * open an 'issue' on github and request the missing feature
   * write your own custom javascript macro, filter, widget, etc.

2) How can people with "limited" programming skills extend TW core to fit 
their particular use-cases.

   * You point to my InlineJavascriptPlugin as an acceptable way to "roll 
your own solution" (for TWClassic only).  However, this means that you are 
already able to write your own javascript code.  In which case, there's 
VERY little difference between using something like InlineJavascriptPlugin, 
and writing a TW5 javascript macro.  There's just a little bit of a 
different 'framework' that surrounds your custom code.

The easiest way to get started is to pick any javascript macro definition 
in the core, clone that tiddler, and then edit the definition to replace 
the existing code with your own custom code.  For example, the <> 
macro is a good one to start with:
   http://tiddlywiki.com/#%24%3A%2Fcore%2Fmodules%2Fmacros%2Fnow.js
Even without documentation, it's a very simple module, and it's fairly 
clear what the code is doing.

There are only four things you need to change:

1) set the title of the tiddler

2) give the macro a name:
exports.name = "MACRONAME"

3) define the names of any params
exports.params = [ {name: "PARAM1"}, {name: "PARAM2"} ];
note: if your macro uses no parameters, define an empty param array:
exports.params = [ ];

4) define the macro 'run' function, passing in the named params, which are 
used to generate text output that is returned for further processing 
depending on the calling context (e.g., rendering, use as a widget 
parameter, etc.)
exports.run = function(PARAM1,PARAM2) {
 ... your javascript code here ...
 return ...some computed text value...
};

That's it.  Just save-and-reload for the macro definition to take effect, 
and then you can write <> to invoke 
your own custom javascript macro.  WHEE!  What Fun!

enjoy,
-e

-- 
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/30043fb9-7d28-4bc9-bfc5-cef8c17336a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] How force evaluation to get a resulting string?

2016-02-28 Thread Jed Carty
I did make some greater than and less than filters for comparisons here 
. And for the 
original topic I ran into the same thing a while ago and made the 
action-storecount widget as part of my mathything plugin.

-- 
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/89a005ec-c86d-4438-9b3e-c03d2af16c88%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] How force evaluation to get a resulting string?

2016-02-28 Thread 'Mark S.' via TiddlyWiki
Eric, you're seeing this as someone who can whip up a special filter any 
time you need one. For the rest of us, how to make a filter isn't even 
documented. This isn't a one time problem that Mat has with his particular 
use case, it's a problem that comes up over and over whenever any one tries 
to push the boundaries even slightly.  For instance, AFAIK, there is no 
filter for comparison operations. Reporting on tiddlers that are newer than 
some arbitrary date, or that have an indexed field greater some number 
would be useful in many situations. I put out a request for such a filter 
in July 2015 and there was interest ... but no follow up. I don't want to 
nag anyone -- I want to be able to roll my own solutions like it was 
possible with your InlineJavascriptPlugin. 

Thanks!
Mark

On Sunday, February 28, 2016 at 8:31:25 PM UTC-8, Eric Shulman wrote:
>
> On Sunday, February 28, 2016 at 2:31:47 PM UTC-8, Mat wrote:
>>
>> Eric - thank you for a very informative and 'solving' reply! :-)
>> ...
>> It is depressing to realize that this basic problem is something that 
>> requires special js code and I therefore simply *cannot* solve myself 
>> (and this after hours and hours of trying different circumventions). 
>>
>
> It's not really "special js code".  The <$count> widget has much more 
> involved js code than this tiny filter does and certainly less code 
> than would be needed to extend the core macro processing to "evaluate" the 
> macro output and extract a return value from the result.  You should think 
> of the "count" filter as merely an add-on enhancement to the set of filters 
> you have available.
>
> The real problem you encountered is that the "count" filter isn't in the 
> standard core set of filters, so you were looking for a workaround based on 
> re-purposing existing features (i.e., the $count widget).  However, I think 
> what you are trying to "kill a fly with a sledgehammer."  You are proposing 
> that we radically extend the purpose and behavior of the macro mechanism on 
> a system-wide basis, just so you can re-use an existing widget in a way 
> that widgets aren't intended to be used.
>
> I'm also wondering how such an extended macro processor would handle 
> refresh events?  To "evaluate and return" macro content, the core 
> processing would need to generate a separate, temporary parse tree for the 
> macro content (after substitution of params and variables), extract the 
> "output value" from the tree and then discard the parse tree before 
> returning the extracted content.  The problem here is that without 
> preserving the parse tree, there's no way to know that there are widgets 
> *inside* the macro that need to be refreshed.
>
> In my opinion, this entire approach seems like it would be a "can of 
> worms", creating more problems than it solves.
>
> -e
>

-- 
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/c08f2b72-a842-466f-8857-9a56e664ef9b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] Button template

2016-02-28 Thread andrew harrison
No leading or trailing spaces. I can't use quotation marks if I want a
lookup. It seems I can't use <> for the tooltip or any defined
macro. The only thing that seems to work is a transclusion dictionary
lookup. I think I figured it out though. I still feel like something isn't
quite right with the lingo thing. But since I still don't understand how
lingo works I can't fully test it yet. Here is what I have now:

\define lingo-base() $:/language/format/
\define format(button)
<$button message="tm-$button$"
tooltip={{$:/language/format/hint##$button$}} aria-label=<> class=<>>
<$action-setfield $tiddler="$:/language/format/notify" $field="text"
$value=<>/>
<$action-sendmessage $message="tm-notify"
$param="$:/language/format/notify"/>
<$list filter="[prefix[yes]]">

<>


<$list filter="[prefix[yes]]">

<>



\end

On Sun, Feb 28, 2016 at 9:39 PM, Scott Simmons (Secret-HQ) <
goo...@secret-hq.com> wrote:

> H.  Is there a leading or trailing space in the dictionary tiddler
> causing problems?  Does the tooltip param have quotation marks that might
> be causing problems?
>
> --
> 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/4aaf8257-fda0-450d-b1ae-2eaa5eeda65b%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAL0r7zvTYSUddFzgD3so5OWrkeEzuTtsyF-smjiUzsd_UjHvZg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] Button template

2016-02-28 Thread Scott Simmons (Secret-HQ)
H.  Is there a leading or trailing space in the dictionary tiddler 
causing problems?  Does the tooltip param have quotation marks that might 
be causing problems?

-- 
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/4aaf8257-fda0-450d-b1ae-2eaa5eeda65b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] How force evaluation to get a resulting string?

2016-02-28 Thread Eric Shulman
On Sunday, February 28, 2016 at 2:31:47 PM UTC-8, Mat wrote:
>
> Eric - thank you for a very informative and 'solving' reply! :-)
> ...
> It is depressing to realize that this basic problem is something that 
> requires special js code and I therefore simply *cannot* solve myself 
> (and this after hours and hours of trying different circumventions). 
>

It's not really "special js code".  The <$count> widget has much more 
involved js code than this tiny filter does and certainly less code 
than would be needed to extend the core macro processing to "evaluate" the 
macro output and extract a return value from the result.  You should think 
of the "count" filter as merely an add-on enhancement to the set of filters 
you have available.

The real problem you encountered is that the "count" filter isn't in the 
standard core set of filters, so you were looking for a workaround based on 
re-purposing existing features (i.e., the $count widget).  However, I think 
what you are trying to "kill a fly with a sledgehammer."  You are proposing 
that we radically extend the purpose and behavior of the macro mechanism on 
a system-wide basis, just so you can re-use an existing widget in a way 
that widgets aren't intended to be used.

I'm also wondering how such an extended macro processor would handle 
refresh events?  To "evaluate and return" macro content, the core 
processing would need to generate a separate, temporary parse tree for the 
macro content (after substitution of params and variables), extract the 
"output value" from the tree and then discard the parse tree before 
returning the extracted content.  The problem here is that without 
preserving the parse tree, there's no way to know that there are widgets 
*inside* the macro that need to be refreshed.

In my opinion, this entire approach seems like it would be a "can of 
worms", creating more problems than it solves.

-e

-- 
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/6f12ee89-d06c-4ca5-b933-3a71e7c66eeb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] Button template

2016-02-28 Thread andrew harrison
Um, well, I thought it was almost perfect. After I tested it a bit I still
have a slight problem. The tooltip comes up as
"{{$:/language/format/hint##bold}}" instead of "make the selected text
bold" from the dictionary tiddler. Any more suggestions?

On Sun, Feb 28, 2016 at 4:17 AM, Scott Simmons (Secret-HQ) <
goo...@secret-hq.com> wrote:

> Awesome!
>
> (Did you get a chance to check out my tab source button solution in the
> other thread?
> https://groups.google.com/d/msg/tiddlywiki/UAHlzJrZB5c/1aAswfeaHAAJ )
>
> --
> 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/94bfee94-1351-4161-9e5a-5af9dece6bef%40googlegroups.com
> 
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CAL0r7zvG7GxjFFkXQGgp3grkNrJyEezoSxzfFdx%2BCuYZZV4-kQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: doesn't work, how to ignore syntax?

2016-02-28 Thread Scott Simmons (Secret-HQ)
Hi, Shay —

The only trick I know of is this one:

<$text text="""<$macrocall name="something" />''This'' is my //apparently// 
__wikified__text.""" />

You could write a macro that would make it a little easier, like so:

\define nowiki(text)
<$text text="""$text$""" />
\end

... so that you could write this in tiddlers:

<''This'' is my //apparently// 
__wikified__text.""">>


-- 
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/0c9c5eb3-bacd-48d8-b68e-8c795538b275%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: doesn't work, how to ignore syntax?

2016-02-28 Thread Shay Shaked
Eric, 

 doesn't work in TW5. I tried it on other, simpler line of text. No 
affect. I am then left wondering how to ignore syntax in TW5?

On Saturday, February 27, 2016 at 1:38:30 PM UTC-5, Eric Shulman wrote:
>
> On Saturday, February 27, 2016 at 10:26:29 AM UTC-8, Shay Shaked wrote:
>>
>> Eric, still doesn't work: 
>>
>>
>> 
>>
>> Try adding a newline after the closing .  If that doesn't help, 
> try progressively removing bits of your content to see if any of it is 
> interferring in some strange way.  I'd try it myself, but you only posted 
> snapshots of the content, so I can't copy/paste it into a live TW to 
> experiment.
>
> -e
>

-- 
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/51ce1406-cae1-4fc0-9e1d-d61c2f5120d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Interview about TiddlyWiki with Changelog podcast #196

2016-02-28 Thread David Gifford
heh heh Jeremy the blue background of your new photo makes you look like 
you are in one of the squares from the Brady Bunch intro. :-)

Dave

On Saturday, February 27, 2016 at 1:54:02 AM UTC-6, Jeremy Ruston wrote:
>
> I took part in a wide-ranging interview for the Changelog podcast which 
> has just been published: 
>
> https://changelog.com/196/ 
>
> I haven’t had a chance to listen since the recording a couple of weeks 
> ago, but I enjoyed it a lot and hopefully there’s some interesting stuff in 
> there. 
>
> 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+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/20d13cc7-4540-4232-a351-9d812dc48c53%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] How force evaluation to get a resulting string?

2016-02-28 Thread Scott Simmons (Secret-HQ)
Hi, Mat —

Tobias's setvars plugin may be able to come to your rescue here.  With it 
installed you could write something like this:

\define c() <$count filter="[prefix[New]]"/>

<$setvars _count=<> count="count">
<$button>
<$action-setfield result=<> result2=<>/>
x



Setvars uses underscore-prefixed "attributes" to capture dynamic content 
and then sets "variables" using combinations of the specified attributes. 
 (You can also set variables directly if they're text strings, but I use it 
regularly to capture wikified output and set it as a variable to use in 
something that follows.)

Here, _count=<> gets the wikified output of your <> macrocall, and 
count="count" sets the variable count (which you refer to with macrocall 
<> within the scope of the current instance of <$setvars>) to be 
that text string.

You could also use <$setvars> to build out the entire <$action-setfield> 
widget string:

\define c() <$count filter="[prefix[New]]"/>

<$setvars
  _count=<>
  button-action="""\<$action-setfield result="\ count \" result2="\ count \
"/>\"""
>
<$button>
<>
x



The backslashes set off literal text in a variable declaration and spaces, 
so the variable button-action here is being built from literal strings and 
variables (well, one variable here: count).

You can get setvars here:
https://tobibeer.github.io/tw5-plugins/#setvars

It's one of those plugins I sometimes think might be worth incorporating 
into the core, if only because I use it for virtually *everything*.

-- 
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/cce38b12-537f-451e-b777-34953b3a0d26%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: TiddlyWiki for recipes

2016-02-28 Thread Andy Pastuszak
Tobias,

This looks very nice.  Any plans to keep working on this?

Andy

On Saturday, November 21, 2015 at 10:28:13 AM UTC-5, Tobias Beer wrote:
>
> Hi Peter,
>
> Doesn't have all your bells and whistles (yet),
> but perhaps a good starting point...
>
> http://tobibeer.github.io/me/cook
>
> Best wishes,
>
> — tb
>

-- 
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/60689a33-90f6-460b-a0fb-f1e3981d8f63%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Custom search-macro

2016-02-28 Thread magev958
Hi, in http://contextplugin.tiddlyspot.com the context-search appear only 
after 4 letters are typed. How would I go about to create a custom search 
with this behavior? I'm trying to 
adapt http://spangenhelm.github.io/TW5-EnhancedSearchResults/, showing only 
the results from "text"-field and "caption"-field in a sidebar-tab. 

/Magnus

-- 
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/7d3aa92a-57d9-4849-9dd4-4c2e7e1fb639%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Interview about TiddlyWiki with Changelog podcast #196

2016-02-28 Thread Alex Hough
The mysterious FND... Moving in mysterious ways..


Alex

On Saturday, 27 February 2016, Jeremy Ruston 
wrote:

> I took part in a wide-ranging interview for the Changelog podcast which
> has just been published:
>
> https://changelog.com/196/
>
> I haven’t had a chance to listen since the recording a couple of weeks
> ago, but I enjoyed it a lot and hopefully there’s some interesting stuff in
> there.
>
> 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+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/0DE6187C-25A2-42BE-8EA9-41DAD00D7338%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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/CALc1hYdTmoAdvN9G2S0edvSnPdx8R6hiBEDjHJ9Hq7oQ_uzZYg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] How force evaluation to get a resulting string?

2016-02-28 Thread Mat
Eric - thank you for a very informative and 'solving' reply! :-)

Note for anyone copying the solution; there is a missing ">" in that last 
code, i.e it should be; 

<$set name="c" filter="[prefix[New]count[]]">
...

General thoughts on the matter:

It is depressing to realize that this basic problem is something that 
requires special js code and I therefore simply *cannot* solve myself (and 
this after hours and hours of trying different circumventions). So - in 
spite of Eric explaining that:

As noted above, the "evaluation" of the macro results depends entirely on 
> the context into which it is returned: the macro content *might* be 
> rendered (and thus, "wikified"), or it might be used as the value of a 
> widget parameter, or perhaps saved as-is to a tiddler field, etc.
>

...AFAICT it would still be very useful with some kind of "assuming" 
wikifying implementations for this that evaluates straight off and presents 
the same ouput string as would be presented on the screen. For example the 
macro in the original question above is un-ambiguous, isn't it? The 
evaluation command could perhaps be a "macro wrap" or a maybe a parameter 
like;

\define eval foo() ... 

or 

\define(e) foo() ... 

Maybe even alternative parameters to specify what kinds of content should 
be evaluated (parameter substitution, internal macro calls, internal 
widgets...)

Thoughts?

Again, thank you Eric for your reply above!!!

<:-)


-- 
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/850d4266-4c7d-4594-8675-b1766018107a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] How force evaluation to get a resulting string?

2016-02-28 Thread Eric Shulman
On Sunday, February 28, 2016 at 10:18:37 AM UTC-8, Mat wrote:
>
> It just seem so fundamental and it has popped up before... but I can't 
> find any solution:
>

Your confusion stems from the fact that, despite the ability to have 
parameters, macros are not "functions" in the usual sense.

Macros don't "run" their content and "return the output".  A macro is 
simply a text substitution mechanism, and the ONLY action it performs is to 
replace any embedded parameters and/or variables -- the $param$ and 
$(variable)$ syntax -- and then return the modified content for further 
handling by the calling context. Other than this replacement processing, 
macros *never* "evaluate" (aka, "wikify") their output; that is *always* 
the responsibility of the context in which the macro is invoked.

The stored result (regardless if using a direct macro call or via the set 
> variable) gives the result to be a copy of the literal macro string rather 
> than the *evaluated *macro result.
>
> \define c() <$count filter="[prefix[New]]"/>
>
> <$set name="c2" value=<>>
> <$button>
> <$action-setfield result=<> result2=<>/>
> x
> 
> 
>
> What can be done? Couldn't there be some generic macro parameter to state 
> if the return value should be the evaluated result?
>

As noted above, the "evaluation" of the macro results depends entirely on 
the context into which it is returned: the macro content *might* be 
rendered (and thus, "wikified"), or it might be used as the value of a 
widget parameter, or perhaps saved as-is to a tiddler field, etc.

The immediate problem here is that you are trying to use the $count widget 
to get a value that you want to store in a variable.  This won't work, 
because the $count widgets job is to simply display the total number of 
items in the filter result.  Thus, while it produces rendered output, it 
doesn't actually "return" a value that can be stored.

What you really need is a [count[]] *filter*... then, you could use the 
$set widget to store the results of the filter.

Here's the code for a simple "count" filter:
/*\
title: filters/count.js
type: application/javascript
module-type: filteroperator
author: EricShulman
description: Filter operator for getting the number of items in a list
\*/
(function(){
/*jslint node: true, browser: true */
/*global $tw: false */
"use strict";

exports.count = function(source,operator,options)
   { var c=0; source(function(tiddler,title) { c++; }); return [c.toString
()]; };

})();

Put the above code into the text field of a tiddler, and set fields
   type="application/javascript"
and
   module-type="filteroperator"
Then save-and-reload for the new filter to be available.

Here's how you would use it:
<$set name="c" filter="[prefix[New]count[]]"
   <$button> X
  <$action-setfield result=<>/>
   


enjoy,
-e

-- 
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/3167eaa4-a67a-4e0c-8f22-9940f4e896cf%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: Has anyone used Tiddlywiki as a recipe manager?

2016-02-28 Thread 'Mark S.' via TiddlyWiki
There was a conversation about this a couple months ago. Search the forum 
for "recipes" and sort by date.

I have about a half dozen recipes. I do it the simple way and just tag a 
recipe with "Recipes". I find that recipes come in too many formats to be 
too concerned about standardization. Maybe if I had hundreds I would feel 
differently.

Mark

On Sunday, February 28, 2016 at 4:09:39 AM UTC-8, Andy Pastuszak wrote:
>
> I'm trying to find a good cross platform recipe manager, and it seems like 
> TW would fit the bill.
>
> Andy
>

-- 
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/bc5eb4f4-639c-4445-8c65-6dc5db87c17f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] [TW5] How force evaluation to get a resulting string?

2016-02-28 Thread Mat
It just seem so fundamental and it has popped up before... but I can't find 
any solution:

The stored result (regardless if using a direct macro call or via the set 
variable) gives the result to be a copy of the literal macro string rather 
than the *evaluated *macro result.

\define c() <$count filter="[prefix[New]]"/>

<$set name="c2" value=<>>
<$button>
<$action-setfield result=<> result2=<>/>
x



What can be done? Couldn't there be some generic macro parameter to state 
if the return value should be the evaluated result?

Ideas?

<:-)

-- 
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/af8894dc-7fa0-44f4-a14a-49d27f515dea%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: TW5 copy and paste button

2016-02-28 Thread Tobias Beer
Hi Andrew,
 

> Is there a way to create a button to copy and paste between tiddlers?
>
> so that if i have selected text within a tiddler clicking the button would 
> enter that text into a new tiddler
>

What's wrong with:


   1. CTRL+X to cut
   2. + button to create a new tiddler (this is your button)
   3. enter title
   4. select text field
   5. CTRL+V to paste
   
?

After all, you do want to enter a new title.

Or would you be working on mobile and your text-editing commands are barely 
accessible?

Best wishes,

Tobias.

-- 
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/07c1a1f0-3bbc-471f-9ad8-72d0d54a12e8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Has anyone used Tiddlywiki as a recipe manager?

2016-02-28 Thread Andy Pastuszak
I'm trying to find a good cross platform recipe manager, and it seems like TW 
would fit the bill.

Andy

-- 
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/129eded1-9ebe-4f3b-85cf-63fa598cb070%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [TW5] importing/saving emails in TW

2016-02-28 Thread BJ
This works if you use tiddlyclip (setup to paste html) after you 'print' 
step

-bj
On Friday, February 26, 2016 at 2:04:22 PM UTC, HC Haase wrote:
>
> Hello
> The problem is I have a mail (from gmail) with images in it that I need to 
> save in my TW.
>
> To save mails I normally press print > get the source from the print 
> version > paste into TW > save as html.
>
> But this mail have pictures (base64 in the source) that don't get 
> recognised in html tiddlers. 
>
> So the question is: 
> Is there a better way to import/copy mails with pictures to TW?
>
> and
>
> am I maybe doing this in a silly way? is there a better way to save emails?
>
>
>
> EDIT: I also tried to print the email as pdf and import the pdf to TW. 
> However it only gives me binary googly goo in the tiddler
>
>

-- 
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/1be7e0ae-8e2b-4739-bbd0-8ce210a6bbda%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [tw] Re: [TW5] Button template

2016-02-28 Thread Scott Simmons (Secret-HQ)
Awesome!

(Did you get a chance to check out my tab source button solution in the 
other thread?  
https://groups.google.com/d/msg/tiddlywiki/UAHlzJrZB5c/1aAswfeaHAAJ )

-- 
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/94bfee94-1351-4161-9e5a-5af9dece6bef%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] [TW5] Navigator History and Substories

2016-02-28 Thread Scott Simmons (Secret-HQ)
Hi, all —

I've started leaving history out of my <$navigator> widget calls when creating 
substories .  It doesn't seem 
to deprive me of any functionality when it comes to substories and avoids 
the creation of a few extraneous tiddlers.  Assuming I don't plan on using 
storyview="pop" , is it O.K. to 
forego the creation of a history tiddler when defining a substory?

-- 
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/7d0d4e9a-1e4d-4abf-b16f-cafa6193abc8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[tw] Re: [tw5] Tiddlyclip plugin release - create clips of webpages

2016-02-28 Thread BJ
Hi Charles,
I'm glad you like tiddlyclip. 

At the moment I only use a desktop pc where tiddlyclip (with tiddlywiki) is 
my main notes tool. I have not looked at how to make tiddlyclip work with 
android (yet) as I do not use a tablet, but needless to say there will be 
some work before tiddlyclip is working on a smartphone.

All the best

BJ
On Sunday, February 28, 2016 at 12:00:39 AM UTC, Charles Ridout wrote:
>
> I recently found TiddlyClip. It is what I have been looking for. My issue 
> is using Tiddlyclip
> on my Android tablet. I am unable to "dock to my Tiddlywiki" since 
> Android/Firefox does not appear
> to support Right-Click like on the desktop.
>
> Any thoughts or suggestions will be appreciated.
>
> Great tool!
>
> Charles
>
> On Tuesday, September 9, 2014 at 9:16:24 AM UTC-4, BJ wrote:
>>
>> I am creating a plugin and browser addon that allows clips of web pages 
>> to be collected into a tiddlywiki. It is now functional but still in 
>> development. 
>> As it is still in development, and it modifies the contents of 
>> tiddlywikis, it is possible that the data within a tiddlywiki could be 
>> destroyed if there is a bug - it is therefore RECOMMENDED at present that 
>> tiddlyclip is only used  for experimentation in a separate tiddlywiki. The 
>> plugin along with its documentation can be found here:
>>
>> Note that I have only used the plugin and firefox addon  on ubuntu 12.04.
>> Feedback always welcomed!
>> Cheers
>>
>> BJ
>>
>

-- 
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/b6a31922-7bd8-4010-9313-d6d8b0845968%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.