I guess that\define journalButton()...\enddefines a macro -- and that <<journalButton>> evaluates the macro
I suppose that<$button tooltip={{$:/language/Buttons/NewJournal/Hint}}...transcludes the value of the the hint when thewhen the macro is evaluated (or is it when the macro is defined)
<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} >
...
</$button>
I'm also not sure about what $set does - seems to manipulate some variables.
I'm unsure as the lifetime of this journalButton object - I think(don't know) that this tiddler is dynamically evaluatedwhen activated - but do the definitions outlive the activation?
Are their any good write ups of the syntax and semantics of thetiddler language? - and some annotated examples - line by linedetailed explanations. There seem to be hundreds of documentsdescribing simple translusion -- the {{Insert Me}} and[[Insert Me]] kind of stuff - I get that - but the next step is confusing me.
Hi Joe.You have much, and good, documentation at tiddlywiki.com(I'm curious, for constructive purposes: How come you have not seen this?)
Some specific questions of yours:I guess that\define journalButton()...\enddefines a macro -- and that <<journalButton>> evaluates the macroCorrect. And something like <<foo bar "baz frotz">> would be a macro foo with the two parameter values bar and baz frotzYou must not insert space right after the "<<".
I suppose that<$button tooltip={{$:/language/Buttons/NewJournal/Hint}}...transcludes the value of the the hint when thewhen the macro is evaluated (or is it when the macro is defined)Well, more correctly it should be<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} >
...
</$button>Yes, the parameter named tooltip does in this case take a transcluded value as argument, i.e whatever is inside that hint tiddler.
<$xxx>...</$xxx> are widget calls whereas <<yyy ...>> are macro calls. Widgets are more fundamental, comparable to html markup and are defined with javascript. Macros are higher level and typically defined in wikitext using the /define pragma.
I'm also not sure about what $set does - seems to manipulate some variables.
I'm unsure as the lifetime of this journalButton object - I think(don't know) that this tiddler is dynamically evaluatedwhen activated - but do the definitions outlive the activation?Yes definitions, i.e macros, 'live on' locally. But/and if you tag the tiddler with "$:/tags/Macro" you make the macros global.
Are their any good write ups of the syntax and semantics of thetiddler language? - and some annotated examples - line by linedetailed explanations. There seem to be hundreds of documentsdescribing simple translusion -- the {{Insert Me}} and[[Insert Me]] kind of stuff - I get that - but the next step is confusing me.Again, tiddlywiki.com is the best source for docs. But when you say "hundreds of docs" maybe you've already seen this? Again, if you haven't it would be valuable to know why.
Tobias has a great site that may be of use: http://tobibeer.github.io/tb5/#WelcomeThere are also other individual initiatives but none that I can refer to off the cuff.I get the impression that you're knowledgable enough to read wikitext code though. If you have specific snippets you need explanations for, i.e where you cannot simply use tiddlywiki.com to look up e.g <$set> (i.e the SetWidget) then you're more than welcome to post it on the boards. At this basic level I'd probably recommend posting on the main board where you have more readers.
All best and warmly welcome to TW!!!
<:-)
And a followup question.- I searched for semantics evaluation etc. but no hits.Is there a description of how a tiddler gets turned into HTML?If I were to implement this I'd be thinkingtokenize -> parse -> transform -> renderAfter parsing I'd get an abstract syntax tree (AST1) representing the tiddler.I'd evaluate this to produce a second AST representing (abstracted HTML)then I'd render this.Is it done like this?It would be very helpful to see the AST1 after parsing (if this is the way it was done)Of course it might be implemented by some other means (like directly manipulating theDOM) during parsing.
And a followup question.- I searched for semantics evaluation etc. but no hits.Is there a description of how a tiddler gets turned into HTML?If I were to implement this I'd be thinkingtokenize -> parse -> transform -> renderAfter parsing I'd get an abstract syntax tree (AST1) representing the tiddler.I'd evaluate this to produce a second AST representing (abstracted HTML)then I'd render this.Is it done like this?It would be very helpful to see the AST1 after parsing (if this is the way it was done)Of course it might be implemented by some other means (like directly manipulating theDOM) during parsing.Hi Joe,Have a look at the "Tools for exploring the internals of TiddlyWiki" in the ControlPanel under Plugins - get more plugins - open plugin library
that gives you new insight looks in the preview panel like "parse tree" or "widget tree"
you can then choose them in the dropdown beneath the "eye" button in the editor toolbar
Simon
I'm trying to understand how to program the TW - right now what I'm doingis reading the source of individual tiddlers and guessing what thecode means.This is a rather time consuming process, and unsatisfactory, to theextent that if something works, I'm not sure if it works because Iaccidentally got it right or by design.
...
I found this code: (it's as is and unformatted since Idon't know when I can add white space or even line feeds)\define journalButton()<$button tooltip={{$:/language/Buttons/NewJournal/Hint}} aria-label={{$:/language/Buttons/NewJournal/Caption}} class=<<tv-config-toolbar-class>>>
Parsing the wiki-syntax has 2 modes:
- Inline-mode which is used for eg: ''bold'' or //italic// and
- Block-mode which is used for eg: paragraphs, bullet lists, numbered lists and so on.