Document Explorer for Silverbullet

[UPDATE - new features ] - Ver. 1.1.0

  • added New Page button to add a new Page to the currently opened Folder:

    image

  • because it was a very requested feature, I decided to add Batch Rename/Delete/Copy/Paste functions.

    • use Ctrl+Click (Win) / Cmd+Click (Mac), to select the Files you want to include in the batch
    • use the Context Menu to Copy/Cut/Rename/Delete the selected files
    • Navigate to the Folder you want to Copy/Move the files to, and use the Paste here Context Menu option.

:warning: Know Limitations and Warnings

  • The Built-In Rename function in Silverbullet has couple of limitation affecting the Backlinks, when renaming multiple files at once:
    • :red_exclamation_mark::warning: You need to confirm the files one by one when Cut & Pasting or when batch Rename multiple files, because DocumentExplorer uses the built-in Rename function from Silverbullet, which will also update the backlinks inside the pages.
    • :red_exclamation_mark::warning: When renaming a folder with multiple files in it, the Backlinks are not correctly updated
    • recommandation: instead of Renaming the folder, use batch-cut/paste on the files
    • :red_exclamation_mark::warning: Silverbullet - BUG when renaming files with a ")" in its name the backlinks will malform

I can install it, but I can't start, I get the error:

.../Library/Mr-xRed/UnifiedAdvancedPanelControl.js is missing.

Somehow, I managed to get it working after all. I couldn't delete it using the Library Manager. So I deleted the file from the file system. And somehow, I was able to install it properly after all.

Hi! Any idea what could cause DE to not load properly? I do not have any other plugins/libraries enabled. Does this require some configuration to work properly? I have tried different browsers and restarting the server.
The picture is taken from left sidebar.

it should work out of the box. the question is how did you installed DocEx? did you installed it through the library manager? or you just copy pasted the .md file only? from the iomage you are showing it seems that the .css and .js file is isnt loaded. meaning it could be either a file permission issue on your side, or the files don't exist. If you installed it through the Library Manager it should automatically install the dependencies as well, can you check/confirm if you have folowing files "/Library/Mr-xRed/" with the correct r/x permissions:

  • UnifiedFloating.js
  • docex_styles.css
  • lucide-icons.svg
  • hybrid-cursor.svg
  • AdvancedPanelControls.md

I had a similar issue for the longest time, and it turned out the cause was Cloudfare. Two things I changed around the same time that solved this was removing caching and removing rocketloader for the silverbullet domain

that could be a third option when connecting through cloudflare, or maybe accessing silverbullet as offline-PWA, the CSS/JS files are never cached (if you explicitly don't chose the option to) it doesnt load those files, so only the pure HTML is loaded and the CSS/JS isn't applied to DocEx.

I used the Library Manager. Based on the reverse proxy's logs it seems DocEx does not support running under URL prefix. It started working when I moved it to its own sub domain.

I added the config option to set a custom "urlPrefix" for DocEx too if you run your silverbullet instance with a certain "SB_URL_PREFIX" variable. Set this to the same value you set your "SB_URL_PREFIX" variable.

can you please update to version 1.1.1 and try it out with and confirm that this works for you now?

Hi! Now it works under URL prefix, thanks! But some of the functionality is gone. The widget (or whatever it is called) that has buttons to close/expand/collapse/etc, the panel, is missing. Also resizing the panel does not work. Those work if URL prefix is not in use.

:thinking:

Sounds like an issue with the AdvancePanelControl module. There are not many people using SB_URL_PREFIX (including myself), so that´s why i never thought of this being a problem.
I will look into it and try to come up with an universal solution.

Hello.
Thanks for your fix.
It works, but same feedback as @x64nop .

Before you fixed, my workaround was to replace .fs by notes/.fs (/notes is my SB_URL_PREFIX)

cd space/Library/Mr-xRed/
grep -RIl '/\.fs/' . | xargs sed -i.bak 's#/\.fs/#/notes/.fs/#g'

Those 2 files were impacted:

So probably you may "just" add the url prefix in AdvancedPanelControl too.
With the grep, everything was working as expected, also the resize, the expand / collapse....

Thanks for your work !

Thanks for the tip @gri38 ! I managed to find the problem in the AdvancedPanelControl file. js.import for the UnifiedAdvancedPanelControl.js was failing. I added the prefix and all the missing functionality came back.

already pushed the fix for both: DocEx and AdvancedPanelControl.

I found that I can simply get the SB_URL_PREFIX directly in Lua using:

local urlPrefix = system.getURLPrefix()

so don't even need the new urlPrefix variable in DocumentExplorer config, so I removed it.

it now should work out of the box no special urlPrefix config necessary.

Please update to Version 1.1.2 & confirm that both works for both of you @x64nop / @gri38 ?

Works for me! Thanks a lot! :smiley:

It also works for me. I’m always the last one :wink:
Thanks a lot !

[Update Ver. 1.2.0]

I know, it's long overdue.

  • I've had a little time to tinker with Document Explorer and to fix the broken keyboard navigation. In tree view left/right keys collapse/expand the folders

  • Also added the toggle-autoload button in the toolbar which is handy for Images/pdf's to autoload during navigation. so basically if you have a folder with images/pdf's and navigate using the up/down/left/right arrow keys, the item under the cursor is loaded automatically in the document viewer so it gives a gallery navigation feel to it.

Update the library and try out the new features :wink:

Here is a short demo:

Just a quick note to say thank you for this brilliant plugin, much appreciated

A bit of a head's up @Mr.Red

I'm doing a significant redo of the "picker" UIs at the moment in SB core. Previous versions were always flat list (page picker, document picker, tag picker), but I'm also adding tree-based versions for some of these where it makes sense. There will also be a "persistent" file tree version of this, which means SilverBullet will effectively have a file tree built in soon. Look and feel will be quite different, and of course it's optional so you can simply not enable it and stick with the document explorer.

No intention to take @Mr.Red 's thunder here, I really appreciate the effort put into this library and it serves a lot of people well and everybody can continue to use it of course, but I think a "native" file tree was long over due and saw an opportunity to do something and to combine it with some other ideas that follow after (like bringing back full text search) which will come probably later. I hope this will land on edge somewhere this week, but we'll see.

Don't worry about "taking thunder" :joy: @zef
I think this is a great direction for SilverBullet. I built DocEx library mostly to serve my own needs, so having a native treeview for everyone that offers even more capabilities is a huge plus.
If it makes things more powerful for everyone to have these features baked in the core, then it's definitely the right move!