Disable Wikilinks Using Rules Pragma Does not Work with Transclude Widget

Also raised here: Disable wikilink with rules pragma does not work with transclusion widget · Discussion #6712 · Jermolene/TiddlyWiki5 (github.com)

To disable wikilinks locally in a tiddler, one can use \rules except wikilink for example

\rules except wikilink

This ''is''  [[HelloThere]] and https://tiddlywiki.com

and this is also HelloThere

This is transclusion <$transclude tiddler="HelloThere" field=title/>

But thhe last line produces wikilink! Why $transclude does not respect the rules pragma here? How disable wikilinks generated by $transclude in this tiddler?

@Mohammad this may be a gap, but maybe not, by design.

But first

  • When the transclude includes the field it imports the field and NOTHING else so no pragma
  • why transclude the title when you don’t want it as a link?
  • you already know the title “HelloTHere”
  • you could do ~HelloTHere or <$text text= etc…

If however you used <$transclude tiddler="HelloThere"/> ie no field then my answer would be the following;

but presumably if you did transclude something containing \rules except wikilink it should logically apply ONLY to the transclusion.

What if you use the Import variables widget or import pragma?

  • I believe if you import your “to be transcluded tiddler” it will only see the pragma there in
    • The widget will apply the rules within the widgets open an close
    • The import pragma will apply it to the whole tiddler (including those transcluded)

So you could

<$importvariables filter="HelloThere">
<$transclude tiddler="HelloThere" field=title/>
</$importvariables>

To get the result I think you were expecting.

The question is not to transclude title, but in the actual code, the $trabsclude is used to transclude different fields and you need TW wikification here! My question is in a tiddler wikilink is disabled using pragma, the $transclude output does not respect it! How to address this issue?

As you’ve noted, the \rules except wikilink pragma only applies to the current tiddler (and not any transcluded content). To completely disable ALL wikilinks in the current tiddler AND any transcluded content, use

\define tv-wikilinks() no

Also, if you only want to disable wikilinks for a specific portion of the current tiddler (and any transcluded content), you can use:

<$let tv-wikilinks="no">
... your content with <$transclude> widgets
</$let>

reference: https://tiddlywiki.com/#tv-wikilinks%20Variable

enjoy,
-e

5 Likes

Works the best! I actually use this in Refnotes where the BibTeX entries are displayed through ViewTemplates and one does not like to wikify some CamelCase in Abstract or Title, Authors fields.

1 Like