silverbulletmd / silverbullet

The knowledge tinkerer's notebook
https://silverbullet.md
MIT License
2.36k stars 169 forks source link

Block-level granularity? #766

Open drawtheliner opened 7 months ago

drawtheliner commented 7 months ago

(See Edit below)

It currently seems like the .md page is the smallest unit of content.

Are there any plans on having this be more granular, down to blocks (as in individual paragraphs, or bullet points)?

This would allow querying on block level, as well as transclusion.

Edit: after further reading and testing it seems SB is indeed quite granular, allowing attributes for (and querying of) paragraphs and bullet items. I'm still not sure if there's a way to query both at the same time (the way I organize my content, there's no distinction between a paragraph and a bullet item, in terms of the data model) - will do some more tests.

zefhemel commented 7 months ago

Indeed, indexing happens at various levels. There's no way to inheritance like queries right now. How do you intend to use this? What types of queries would you hope to write?

drawtheliner commented 7 months ago

There's no way to inheritance like queries right now.

Sorry I couldn't understand the sentence above..

What types of queries would you hope to write?

The same ones you'd do on any page.

I currently use RemNote, which is a block (or paragraph) based outliner, where there is no distinction between page and blocks. It's possible to zoom into any block, which makes its contents show on top like a title, and all the children on bottom as content. So any block is also potentially a page. It's very elegant and powerful.

By the way, Remnote also allows hiding bullets, which essentially looks like a normal text editor. That way you get all the benefits of an outliner, but with the same functionalities of a normal text editor.

PS: As much as I love this simplicity and flexibility of Remnote, it's not open source and therefore I depend on them to implement the things I want. With Silverbullet I'm ver excited that it's possible to code in my own features and behaviours (even with my basic coding skills)

zefhemel commented 7 months ago

Ok, the constraint we have right now is that you have to select the "tag" you want to query, there's no way to query all objects in the index. I could actually add that, and it wouldn't even be that hard, I'm just a bit concerned about performance because there's a lot in there.

So right now you have to choose, either you query e.g. paragraph where ... or item where but there's no paragraph or item where. A way around this is to manually add the same tag to both your paragraph and item items, e.g.:

This is a paragraph #block

* And this an item #block

After which you could query using block where... but yeah, you'd have to manually add that #block to everything.

drawtheliner commented 7 months ago

there's no "paragraph or item where"

Would be great if that would be possible (either that, or have the word "block" be usable as meaning both paragraph and item).

After which you could query using block where... but yeah, you'd have to manually add that #block to everything.

Yeah that would be too much...

What I'd really like to do is have all my content as bullets (to mimic what I have in Remnote), so in theory targeting items would be enough. But I haven't explored Silverbullet enough yet to know if there are restrictions when working within nested items (ie. things that only work in normal paragraph).