Leveraging the pattern used in [img[Motovun Jack.jpg]] and [ext[https://tiddlywiki.com]]

I was just looking at $image vs [img[urlortiddler] and [ext[url]] and observing there is no matching $external widget (This may result in another post). But this leads me to ask this question;

Could we find away to make use of a similar wikitext annotation like [img[urlortiddler] and [ext[url]] for users/designers to add custom code?

  • Maintaining the ability to pass parameters and or use the | to pass a second param as used for pretty links

Reasons;

  • We are often struggling to find ways for users to develop custom markup with most characters already used.
  • This is less verbose than <<>> and other forms
  • Perhaps except for the existing names img and ext there exists a very large set of names available, including the reuse of existing characters eg [*[]]
  • The empty form could be used [new[]]
  • Special editor toolbar buttons can be developed for this eg select “selection” then insert [new[selection]]
  • Allow a function/procedure to be called with this annotation and optionally override defaulted parameters such as [img width=32[]]

Questions

  • Could we use the [new] single braces form and how do we deal with this escaped.
  • @pmario could this me a way to incorporate features like we have in the “Custom markup” solution?
  • Could this contain multi line content?
  • Perhaps if the name of the “custom” rule does not exist [notexist[]] we could just display this as plain text so as to not cause an invisible issue in wikis without the custom rule?

Compelling examples?

Perhaps we could use this to craft anchors and anchor links to easily allow within tiddler internal references? eg !![anchor[Heading title]] and [int[Heading title]] (int for internal link) which would apply the tricks documented in Anchor Links using HTML

  • Note how the output is further wikified as in the anchor is a heading.
  • This would generate the ID in the right format with the prefix # or ##
  • This may be trivial to do by cloning prettyextlink.js (below)
  • We could provide an alternate to the $link widget for the same that handles these as well.

See here $:/core/modules/parsers/wikiparser/rules/prettyextlink.js and $:/core/modules/parsers/wikiparser/rules/image.js for fixed existing parser rules, but I am thinking could it be parametrized and defined rather than a single purpose parser?

There is a pending PR at GH: Feat: allow link to section mark by linonetwo · Pull Request #7744 · TiddlyWiki/TiddlyWiki5 · GitHub for this one
Demo: TiddlyWiki — a non-linear personal web notebook

1 Like