Hi! I’ve just started using SilverBullet after migrating from Logseq last week - love what I’m seeing so far!
I’ve been trying to find a way to get really nice-looking TTRPG notes and statblocks inside SilverBullet (recently came across this thread around querying the Open5E API within SilverBullet which looks quite promising (not sure if it works with V2 or not)). I also know that it’s possible to specify a custom CSS class for a page using frontmatter, which can then be styled using custom space-style code.
My main question is: would it be possible to apply custom space-style to a particular statblock section of a page, or render a section of a custom-styled page within another page?
If I understand you correctly, something using tags comes to mind.
.sb-table-widget:has(.hashtag[data-tag-name="table-to-style"]) {
outline: red solid 5px;
}
If you now have a table
| A | B #table |
|---|---|
| 1 | 2 |
With the tag you specified you can style that table. You can also hide the tag using css. Tables without that tag don’t get styled. There are probably easier solutions, but this comes to mind right now.
If this doesn’t work maybe this API is of use to you. It’s a little lower level but you can just insert html with any style you want.
Excellent, thanks for that. The HTML API looks like it’ll do what i need. Is it possible to set up a page template (or slash command) with some boilerplate to make it easier to input data for multiple stat-blocks? Given it can’t be copy-pasted Markdown if I go down this route.
I meant to set different colors to highlighted text, for eg. ==#blue hello world== should be blue, and ==#yellow hello world== should be yellow. I did attempt this with modifying your solution but couldn’t make it work. I thought maybe you have some idea