I don't know if anyone else builds things like I do - with a ton of dynamic tables and branched lookups, but I use this pattern all the time:
I don't know if anyone else builds things like I do - with a ton of dynamic tables and branched lookups, but I use this pattern all the time:\define macrotobuildfilter() ...<$wikify name="macrotobuildfilterwiki" text=<<macrotobuildfilter>>><table><$list filter=<<macrotobuildfilterwiki>>>...</$list></table></$wikfiy>That's just with one, but usually I have a few nested ones. In fact I'll go so far as to say that more than half of the time I use a macro, I have to wikify it before use as it's being used as a parameter for something else.
I've often thought of how great it would be to have that wikification done in the same step - maybe with triple brackets like <<<wikified macro>>> ? Similarities to the {{{...}}} notation in a way.
Is this possible? I see some other threads on additional parser rules, so thought it might be a good time to bring up.
--
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+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/a0aff5bb-2aa3-4bc0-8094-72cf07c550a8%40googlegroups.com.
One tip is to prepend the \rules pragma to the start of the text to be wikified and thus restrict the wikitext rules that will be recognised.
Hi Stobot
To unsubscribe from this group and stop receiving emails from it, send an email to tiddl...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/d16dfbae-0bb9-403b-abf7-129918ba3ea1%40googlegroups.com.
Here’s a simple example of using the wikify widget:
<$set name="text" value="This is ''bold'' and this is //italic//"><$wikify name="html" text=<<text>> output="html"><$text text=<<html>>/></$wikify></$set>And here’s the same example with the addition of adding the prefix:\define rules()\rules except italic\end<$set name="text" value="This is ''bold'' and this is //italic//"><$set name="text" value={{{ [<text>addprefix<rules>] }}}><$wikify name="html" text=<<text>> output="html"><$text text=<<html>>/></$wikify></$set></$set>Best wishesJeremy
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/d16dfbae-0bb9-403b-abf7-129918ba3ea1%40googlegroups.com.
The following is an outline of how I see this for a "view from a different mind", for you to keep in mind going forward.In all your examples of using wikify you tend to use it in the body of the wikitext, just in time, wrapping its own output.
I tend to run into difficulty using it any other way, such as a local or global macro, and when in your example there are "variables" in the source eg if your set included {{!!fieldname}} or $tooltip$ etc... in what is to be wikified.
It is clear we need to fill out the documentation Pragma and Wikify Widget, sometimes so people know this does not promise things it may "on the surface"
for examples Question that arise from the naivePragma
- When using a rule inside a define is it valid only within that macro?
- When using it at the top of the tiddler does it apply to the whole tiddler? including macros subsequently defined or referenced?
- Is using \import filter more efficient than global macros or the new view only macros tag
- Where are the rules documented? Are they a one for one match with these names $:/core/ui/ControlPanel/Parsing
I found the "undocumented "[wikiparserrules[]]" filter operator
Wikify
- With the Wikify widget is there a way for us to apply the pragma rules to the result?
- The Wikify Widget would benefit from examples and ideally through the various templates available already in the core, so people can generate and store tiddlers in alternate formats that already operate under export, save and other options.
- Storing the result of a wikify operation in the current wiki is also of substantial value (I would detail if asked)
Parsing is of substantial interest to many, so I hope eventually we can open this to users, especially to add our own markup.
I and mario have being looking at this with the leading dotparagraph and trailing spacespace. Of course such markup will not be universal when tiddlers are transferred but they can be made to "fail gracefully" when not defined.
The markup process provides the opportunity for authors and designers to enhance how they input information into a wiki, in effect allowing the development of other shorthand, custom shorthand can still be evaluated into html or text, copy and paste etc.. and exported as standard content.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/78d04c90-9ea0-4ea2-8f55-9da55d1ff776%40googlegroups.com.
Hi TonyThe following is an outline of how I see this for a "view from a different mind", for you to keep in mind going forward.In all your examples of using wikify you tend to use it in the body of the wikitext, just in time, wrapping its own output.The results of the wikify widget are indeed only available within the content of the widget.Can you show a counter example to help me understand what you mean?
I tend to run into difficulty using it any other way, such as a local or global macro, and when in your example there are "variables" in the source eg if your set included {{!!fieldname}} or $tooltip$ etc... in what is to be wikified.You’re saying that you can’t use the wikify widget within a macro? I’m not sure what you’re getting at here. Perhaps some examples would help?
It is clear we need to fill out the documentation Pragma and Wikify Widget, sometimes so people know this does not promise things it may "on the surface"Any help with that is welcome.
- Is using \import filter more efficient than global macros or the new view only macros tag
They’re all the same mechanism under the hood: the importvariables widget.
- Where are the rules documented? Are they a one for one match with these names $:/core/ui/ControlPanel/Parsing
The pragmas are documented here:
This mentions \rules and not much more. Is there more doco somewhere? That is why I ask are the rules what we see here $:/core/ui/ControlPanel/Parsing?
\rules for adjusting the set of rules used to parse the text
I found the "undocumented "[wikiparserrules[]]" filter operatorThat’s a filter operator, which are nothing to do with pragmas.
Well surely it does relate to the rules pragma, I thought this is a way to access all the defined rules, which are not documented in the \rules pragma or anywhere else.
\rules except table
Wikify
- With the Wikify widget is there a way for us to apply the pragma rules to the result?
That’s exactly what my example in my previous post showed.
- The Wikify Widget would benefit from examples and ideally through the various templates available already in the core, so people can generate and store tiddlers in alternate formats that already operate under export, save and other options.
What do you mean by “templates” here? What’s the connection between templates and the wikify widget? Reusing the existing export filters doesn’t have anything obvious to do with the wikify widget.
- Storing the result of a wikify operation in the current wiki is also of substantial value (I would detail if asked)
As you know, changes can only be made to the wiki via action widgets, are you experiencing difficulties doing that? Again, perhaps an illustration would help.
\define json-here()
<$wikify name=output text="""{{||$:/core/templates/json-tiddler}}""">
<$macrocall $name="copy-to-clipboard" src=<<output>>/>
</$wikify>
\end
<<json-here>>
<$button>
<$action-createtiddler $basetitle="Test" text=<<json-here>>/>
Go1
</$button>
<$button>
<$action-createtiddler $basetitle="Test" text={{||$:/core/templates/json-tiddler}}/>
Go2
</$button>Parsing is of substantial interest to many, so I hope eventually we can open this to users, especially to add our own markup.Beyond your desire to add custom markup without having to use JavaScript, what else is needed to open parsing to users?I and mario have being looking at this with the leading dotparagraph and trailing spacespace. Of course such markup will not be universal when tiddlers are transferred but they can be made to "fail gracefully" when not defined.