Thank you Ton for the pointer. 
Thank you Eric for the detailed explanation and useful example workarounds. 

In my case I think that "Dummy" define pragma will do the job best till 
there is a better solution.

Many thanks!
Josiah

On Monday, 25 June 2018 19:09:20 UTC+2, Eric Shulman wrote:
>
> On Monday, June 25, 2018 at 8:51:03 AM UTC-7, @TiddlyTweeter wrote:
>>
>> I was really wondering whether there was a method of interspersing 
>> comments in the actual code. 
>>
>
> The pragma parsing syntax only allows whitespace *between* macro 
> definitions.  Thus, as you have noted, using HTML comments in-between the 
> macros does NOT work:
>
> <!-- comment before definition -->
> \define foo() bar
>
> However, when using a multi-line macro definition, you can use HTML 
> comments *inside* the macro itself:
> \define foo()
>    <-- comment inside definition -->
>    bar
> \end
>
> But... this won't work if the macro content is intended for use in other 
> TW syntax (e.g., as a parameter value in a widget call).
>
> One approach that DOES work, is to define dummy "comment()" macros, like 
> this:
> \define comment() notes about foo go here
> \define foo() bar
>
> \define comment() notes about mumble go here
> \define mumble() gronk
>
> and... for readability, you can use dashes as the comment macro names to 
> match the length of the macro being defined after it, like this:
> \define ---() notes about foo go here
> \define foo() bar
>
> \define ------() notes about mumble go here
> \define mumble() gronk
>
> I think the best long-term solution is to update the core pragma parsing 
> to allow HTML-style comments in between macros... but until then, the above 
> method does work today even though it's a bit ugly and awkward.
>
> 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 [email protected].
To post to this group, send email to [email protected].
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/213dc959-eaae-4517-9338-870ed31dded9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to