Macro and wikify widget problem.

109 views
Skip to first unread message

Sergio Aleman

unread,
Feb 17, 2020, 8:01:51 PM2/17/20
to TiddlyWikiDev
Hi everybody,
I have a problem with a macro and wikify widget.
I have done a macro to get all tiddlers that have a tag with the same name as the title tiddler of the tiddler that execute the macro.

this is the code:

\define myMacro()
<$list filter="[tag[$(currentTiddler)$]sort[content-index]]">
!{{!!title}}
{{!!text}}
</$list>
\end


I used the output of the macro in a wikify widget to get the output I want.

<$wikify name="snapshot" text="<<myMacro>>" output="html">
<<snapshot>>
</$wikify>

The problem is that when a tiddler has a "monospace block format" and this block has a line that starts with a double slash(//), the output of wikify widget is wrong.

I created a tiddlyspot tiddlywiki to show you the problem. (http://prueba2020.tiddlyspot.com/)

The tiddler with wikify widget in which you could see the problem (http://prueba2020.tiddlyspot.com/#TiddlerLevel1%20wrong)
The tiddler with the result I expected.(http://prueba2020.tiddlyspot.com/#TiddlerLevel1%20ok)

Thanks in advance.

TonyM

unread,
Feb 18, 2020, 5:35:17 PM2/18/20
to TiddlyWikiDev
Sergio,

There is a little trick here, If you provide a blank line after the list widget opens the content will be treated as a block mode
\define myMacro()
<$list filter="[tag[$(currentTiddler)$]sort[content-index]]">

!{{!!title}}
{{!!text}}
</$list>
\end


However before I remembered that little detail I thought perhaps if when displaying the tiddler, you use the transclude (Current tiddler text) instead so you can specify mode=block

\define myMacro()
<$list filter="[tag[$(currentTiddler)$]]">
<h2>__{{!!title}}__</h2>
<$transclude mode=block/
>
</$list>
\end

However this version will use the caption field before the title if it exists.
\define myMacro()
<$list filter="[tag[$(currentTiddler)$]]">
<h2><$link> {{{ [all[current]get[caption]] ~[all[current]get[title]] }}} </$link></h2>
<$transclude mode=block/>
</$list>
\end

Regards
Tony

TonyM

unread,
Feb 18, 2020, 6:13:08 PM2/18/20
to TiddlyWikiDev
All,

This is a re-occurring issue for users.

As demonstrated in my solutions to this issue you can see that the standard solution is the absence of something, a blank line, however to confuse matters if you use html such as the h2 tag it is no longer an issue. When there are too many exceptions it is hard to remember the rule, especially when the rule is use "nothing".

I wonder if the list widget provided a parameter to force block or inline mode on its content or permitted a keyword one could provide in the place of the blank line it would be easier to document for example;

\define myMacro()
<$list filter="[tag[$(currentTiddler)$]sort[content-index]]">
blockmode

!{{!!title}}
{{!!text}}
</$list>
\end

The documentation can thus say if the content of the list widget begins with blockmode the content will be displayed in block mode, needed to get some wikitext to display correctly. Alternatively you can use a blank line.

Regards
Tony

Sergio Aleman

unread,
Feb 18, 2020, 7:45:20 PM2/18/20
to TiddlyWikiDev
Tony,
thank you for your effort, but non of your possible solution fix the problem.

As you can see in http://prueba2020.tiddlyspot.com/#TiddlerLevel1%20wrong , the TiddlerLevel2.3 is inside code block of tiddler TiddlerLevel2.2.
It doesn´t matter if I use h2 tags or transclude widget in the macro.

Thanks again.

Sergio Aleman

unread,
Feb 18, 2020, 7:53:42 PM2/18/20
to TiddlyWikiDev
The password of the wiki http://prueba2020.tiddlyspot.com/  is testtest.
you can freely modify the wiki to do some tests.

Regards.

TonyM

unread,
Feb 20, 2020, 4:16:58 AM2/20/20
to TiddlyWikiDev
In tiddler 2.2 the // is not closed if you include another the result looks correct.

// is not a valid comment it is the italics wiki text.

Regards
Tony

TonyM

unread,
Feb 25, 2020, 11:15:22 PM2/25/20
to TiddlyWikiDev
Sergio,

You have left this thread pinned, please unpin and respond to our suggestons.

Thanks
Tony

On Tuesday, February 18, 2020 at 12:01:51 PM UTC+11, Sergio Aleman wrote:

Eric Shulman

unread,
Feb 26, 2020, 12:21:44 AM2/26/20
to TiddlyWikiDev
On Tuesday, February 25, 2020 at 8:15:22 PM UTC-8, TonyM wrote:
You have left this thread pinned, please unpin and respond to our suggestons.

As with the TiddlyWiki Group, I have changed the "moderation" settings so only owner/manager can "pin" a topic.

I have also removed the pin from this topic.

-e
 
Reply all
Reply to author
Forward
0 new messages