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/518a152c-323d-4152-91e6-d7d64d488a75%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to