LUA: How to properly format things?

Hi,

how can I properly format my outputs from LUA?

I’m aware of the “cssClasses” return statement and using “html” or “markdown” and display block or inline.

However, If I - for example - want to output a text fromattet as header1, it ends up looking like a “naked” HTML H1 formatting. All my styles used by silverbullet are basically ignored.

As far as I can see in a pages source, a “Silverbullet heading” is set as <div class="sb-line-h1 cm-line">... whereas my LUA output sits in <div class="cm-line">

Setting the return cssClasses to something gets inserted deeper in the tree.

So how can I use my styles used by silverbullet also from LUA?

Thanks!

Regards
Nico

By the way, similar seems to apply to output of (some?) PLUGS, e.g. the TOC plugin outputs does not fit my silverbullet styles by default, too (e.g. the header of my TOC does not look like my “normal” headers.

However, I found out, that they get different classes, so I copied my “normal” classes to similar style entries accordingly.

Thanks Nico

I really wish there was a way of styling markdown output in SilverBullet.

It would make a lot of things easier to achieve. I create widgets in Lua with widget.new but if I want them to be interpreted as templates with e.g. hook.top they need to return markdown, making the output very hard/impossible to style.

Nick