Where would I start if I want to utilize live preview in plugin?

I have an idea to use live preview for a plugin. Is there any plugin currently utilizing live preview?

For example with headings in live preview, when it’s not selected, you get the styled heading, but if you select the line, you get the pound symbol with the label of the heading.

Anyway to do something similar via a plugin? Take the line as input to then replace it with something else, but then when you select the line, you see the source.

1 Like

There are many plugins that enhance Live Preview.

You can use Decorations from CodeMirror 6, the underlying editor.

This is a reference plugin that shows how this is done:

2 Likes