I come from Notion, and one of the features that i most use is the toggle header (aka folding), in which i can insert content with a title (header) and toggle it at will for more readability.
Is there anything like this on SB? I noticed that there’s an “outline: fold” command, but it’s not really readable and not clickable…
I can probably invest some time in developing this, but wanted to be sure that i didn’t missed it.
This is a huge point for me too. I’m currently splitting my knowledgebase where I need one to be self hosted / private. I really want to use silverbullet. But for the life of me I can’t get used to non outliners (this is no silberbullet critique). Folding headers would help a lot with the transition.
(I think there is also a bug that you can’t collapse images with the current shortcut implementation)
I think so, you can listen to the editor:pageLoaded event, retrieve the current cursor position with editor.getCursor() move the cursor to position 0 with editor.moveCursor and then run the editor.fold() syscall, and then move the cursor back to the original position. that should do it. You can even do this in Space Script, no need for a plug.
Oh my god how crazy is Silverbullet? Incredible! This totally works. I am so happy that Silverbullet is that scriptable. Also thank you for already writing this script. When I got the mail notification I already was happy to read in the preview that it’s possible. Now I found time looking into the forum and you already wrote the script and made it public here. Thank you so much for your help and your time! (=
Edit: Besides: I see no scroll jumping or so. At least on my system here the site loads and the frontmatter is folded already. It does not even flicker or similar. Wonderful!