Replies: 3 comments
-
The transclude widget doesn't create a DOM element by design. So by default there is no clickable element that could be used to create an "open xxx" link. There is a discussion at Talk https://talk.tiddlywiki.org/t/is-there-a-way-to-make-the-transclude-collapse/1176/6?u=pmario ... where Eric shows a possibility to "fold" a transclusion. A similar approach can be used to create an "edit transclusion" button. .... IMO this is plugin territory and not part of the core. |
Beta Was this translation helpful? Give feedback.
-
TLDR; The intro of the custom-markup plugin can be found at: https://talk.tiddlywiki.org/t/intro-the-custom-markup-plugin-beta/1219?u=pmario Especially the Videos are important, since the docs is relatively sparse atm. Feedback: https://talk.tiddlywiki.org/c/plugins/custom-markup/14 I did create the "experimental" custom-makup plugin for exactly that purpose to be used with tiddlywiki syntax. ... I wanted to have a possibility to write code block eg: like this:
Where the full code that is involved looks like this:
Examples are: https://wikilabs.github.io/editions/custom-markup/#test-.clip-macro:test-.clip-macro%20.example-macro |
Beta Was this translation helpful? Give feedback.
-
Thanks @linonetwo
I think you are referring to the highlight.js plugin, which overwrites the core That mechanism is indeed not very flexible or extensible. We could re-engineer the codeblock widget to have some extensibility hooks. For example, the codeblock widget could use the hook mechanism to allow plugins to modify the generate HTML of the widget, and the highlight plugin could use that mechanism.
As @pmario points out, the transclude widget doesn't generate any DOM nodes at present. If it did generate DOM elements then there would be a problem with broken HTML nesting rules. Nonetheless, in most cases things would mostly work.
I don't think there is the possibility of a single universal mechanism. Instead, widgets need to be constructed to be explicitly extensible. As an aside, I've been exploring for a while a related idea for replacing widgets: to be able to locally map a specific widget invocation into a macro invocation. For example:
|
Beta Was this translation helpful? Give feedback.
-
We have two separate plugin that modified codeblock widget (result of markdown codeblock syntax). We dont want to use macro to generate modified codeblock widget each eime.
Also, I want to add an edit source button to the transclude widget, if it is used to transclude a user tiddler instead of a system tiddler.
Do you know what is the correct way to extend tw core built in widgets?
Beta Was this translation helpful? Give feedback.
All reactions