That is absolutely possible, Obsidian can do that, and I find there can be improment to the ob’s way, so I design it in How to deal with wikitext like widget, macro in WYSIWYG editor?
And my part-time dev time is limited, so I choose to write it based on reactjs, which makes it impossible to be lightweight, @saqimtiaz but I think it is OK, because I use my 100MB TidGi desktop app everyday…Size is not the case on a desktop app.
And when publishing my wiki to github pages blog platform, I will automatically remove all unnecessary plugins, makes my blog lightweight enough for my readers.
This is how I make my wiki powerful on local, and relatively lightweight when online.