Use case or problem
Obsidian doesn’t have a specific inline embedding feature, let alone one which is seamless and allows arguments to manipulate the template’s final content when rendered. The Templater core plugin does a similar job of making note creation quicker and can definitely help a lot with taking coherent notes, but doesn’t solve the problem of having to update each occurrence of said template just so it doesn’t stick out like a sore thumb in some notes.
The problem is exponentially worse when you need to make continuous use of an icon and/or span tag in order to make it more visually appealing while you have many notes using the template. It becomes a tedious amount of work just to update every occurrence.
Proposed solution
What I want to do is use something like {{Health|20}}
for example and have it render as “ 20” while the text cursor is outside of the tag OR Read Mode is currently active. Every note could be used like a MWTemplate by using
{{NoteName}}
instead of [[NoteName]]
, so you don’t have to specify a specific folder where all notes are MWTemplates.
Since this feature would be aligned with Mediawiki’s Template system, that means it also includes the special formatting.
{{{1}}}
: Use the first parameter in the MWTemplate tag referencing this note.{{{1|text}}}
: Similar, except the input is remedied with a placeholder if no input is given.{{{var}}}
: Similar, except the input is coming from an explicitly defined variable (e.g:{{NoteName|var=hello world}}
).
{{#Switch:{{{1|good}}}|good=Good!|bad=Bad.|???}}
: Return a specific set of text when the input matches a phrase in this tag.{{#ifeq: {{{1|}}}|Cool|Very cool!|{{{1}}} ain't cool enough!}}
: Return a text if the input matches the expected phrase, otherwise return an alternate text.
If a phrase like {{title}} is found, it will not render as a MWTemplate. If the MWTemplate tag doesn’t lead to an existing note, it will appear as-is and dim purple much like normal note links.
Current workaround (optional)
Currently I have no means of a workaround besides running an entire local Mediawiki, which is not only extremely expensive on computer resources but also inconvenient for someone who just wants to take notes.