[tw] Re: TW5 - can't figure this transclusion/macro problem...
You are right! I overlooked that macrocall and ... are not identical. The documentation supports what you say under the MacroCallWidget tiddler: *The advantage of the widget form is that it allows macro parameters to be specified as widget attributes, thus allowing indirection and macro values to be set* Thanks again. The only thing that still seems weird about this form of indirection is that now the field holds the index of the dataTiddler (or dictionary), which just look like regular data. The {{}} transclusion syntax was making it clearer in my mind that the content was derived from elsewhere, maybe escaping it with ~ if what I really want is the text with the actual curly braces. Regards, Robert On Monday, September 22, 2014 2:26:46 AM UTC-4, Stephan Hradek wrote: Am Montag, 22. September 2014 06:10:42 UTC+2 schrieb rnaud: If you could still get to my questions about the $()$ syntax and the non-cascading transclusion, it would help me understand why your code works and mine does not. The $(...)$ is used to transclude variables set wit $set. You can also use ... instead, but I do not really understandd all of the implications. I simply stick to the rule: When I want something set with $set to be inserted, I use $(...)$. -- 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 http://groups.google.com/group/tiddlywiki. For more options, visit https://groups.google.com/d/optout.
[tw] Re: TW5 - can't figure this transclusion/macro problem...
Hi Stephan, thanks for the tip on using a data tiddler for the domains. I tried using your code, but it does not output the domain either when I place it in my file. The one more level of evaluation is what I was trying to get to by using what I described as macro helper. So I changed the template call from {{!!myTemplate}} to {{||myTemplate}}. Even in the template itself if I add the fields, it only outputs https://sampleserver./sample/path.html; and not https://sampleserver.domA.com/sample/path.html https://sampleserver./sample/path.html Can you explain a little more about the $(dom)$ syntax? I only see it in the Getting Started tiddler of tiddlywiki.com (http://tiddlywiki.com/static/GettingStarted.html), but can't see as part of the documentation. Also, I'd like to understand where my thinking is wrong about using {{!!domain}}. The documentation says (...)transcluded content behaves as if it were in the context of the transcluding tiddler. So if the implementation I attempted works within the tiddler titled Yet, the following works:, and if the template does not alter the context of the currnet tiddler, why does it not work when I'm using the template. Or put in a different way, when would one want {{!!domain}} to output {{!!domain}} instead of the transcluded content. Why is the transclusion not cascading? Thanks for anything you can share with me that will bring my comprehension to the next level. Regards, Robert Naud On Friday, September 19, 2014 4:07:27 AM UTC-4, Stephan Hradek wrote: The problem is: You need one more level of evaluation. Additionally I suggest to change your logic a bit. Why not create a tiddler MyDomains (or $:/MyDomains) as a data tiddlre like so: domain1:domA.com domain2:domB.com And then in the server tiddler simply name the domain name - don't use transclusion syntax: title:MySertver text:{{!!myTemplate}} domain:domain1 server:sampleserver and this would be the mytemplate (with local macros for illustration) \define link(protocol, server, path) $protocol$$server$.$(dom)$$path$ \end \define build(protocol:http://;, server, domain, path) $set name=dom value={{MyDomains##$domain$}} $macrocall $name=link protocol=$protocol$ server=$server$ path= $path$/ /$set \end $macrocall $name=build protocol=https://; domain={{!!domain}} server={{!!server}} path=/sample/path.html/ In build we first have one evaluation, setting the variable dom to the value stored in MyDomains under the index whose value we take from the field domain. In link we simply concatenate. -- 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 http://groups.google.com/group/tiddlywiki. For more options, visit https://groups.google.com/d/optout.
[tw] Re: TW5 - can't figure this transclusion/macro problem...
Apologies Stephan, your code does work. I replicated the setup with an error in the data dictionnary, having it be of type json instead of application/x-tiddler-dictionary. Thanks for your help. If you could still get to my questions about the $()$ syntax and the non-cascading transclusion, it would help me understand why your code works and mine does not. Looking forward to improving my skills and to the newly released 5.1.0 version (fresh out of beta). Thanks again, Robert Naud On Friday, September 19, 2014 4:07:27 AM UTC-4, Stephan Hradek wrote: The problem is: You need one more level of evaluation. Additionally I suggest to change your logic a bit. Why not create a tiddler MyDomains (or $:/MyDomains) as a data tiddlre like so: domain1:domA.com domain2:domB.com And then in the server tiddler simply name the domain name - don't use transclusion syntax: title:MySertver text:{{!!myTemplate}} domain:domain1 server:sampleserver and this would be the mytemplate (with local macros for illustration) \define link(protocol, server, path) $protocol$$server$.$(dom)$$path$ \end \define build(protocol:http://;, server, domain, path) $set name=dom value={{MyDomains##$domain$}} $macrocall $name=link protocol=$protocol$ server=$server$ path= $path$/ /$set \end $macrocall $name=build protocol=https://; domain={{!!domain}} server={{!!server}} path=/sample/path.html/ In build we first have one evaluation, setting the variable dom to the value stored in MyDomains under the index whose value we take from the field domain. In link we simply concatenate. -- 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 http://groups.google.com/group/tiddlywiki. For more options, visit https://groups.google.com/d/optout.
[tw] Re: [TW5] Disable automatic WikiLinks using \rules except wikilink?
Hi TheDiveO, I have a global macro that is using a \rules, but at first, I placed it above the \define and it was not working. I placed it right under and it works for me. Let me know if this behaves the way you expect. Regards, Robert On Friday, August 1, 2014 4:54:54 AM UTC-4, TheDiveO wrote: I know that it is possible to disable automatic WikiLinks by defining the following global macro: \define tw-wikilinks() no As of TW5 5.0.13 global macros work by tagging the Tiddler containing this macro definition as $:/tags/Macro. So far, so good. I would have expected that the same effect could also be achieved by disabling the wikilink parser rule in a global macro ... but this doesn't work: \rules except wikilink What is the reason that pragmas cannot be used in global macros tiddlers and that they don't get carried over into the view template? Best regards, -- TheDiveO -- 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 http://groups.google.com/group/tiddlywiki. For more options, visit https://groups.google.com/d/optout.