Hi all.
Loving this app so far.
Is there a way to easily export the whole database to an static website sort of like mkdocs?
Thanks!
It actually seems pretty easy (using your mkdocs example, note I've never used it before):
mkdocs.yaml file. Trilium does export the hierarchy in a json file, so it could be possible to organize it based on that. With a few notes in a few folders, I got a static mkdocs project running in like 10 minutes.
Sure, it's not automated, but that seems outside the scope of this project, considering it already has several export options.
Just few additions to what @zpar-ky said.
It's also possible to export directly to HTML which might avoid one extra step and also avoid possible conversion loss since Trilium actually uses HTML as storage format so no conversion is required.
I imagine it would not be difficult to create a script which would take a directory structure exported by Trilium and generate a website with tree navigation (out of the directory structure).
Possible issue is with internal note links which are "broken" in the export - they are targetting noteIds instead of relative paths. Fixing them would not be trivial - you would have to read the metadata JSON file to get correct paths etc.
I don't plan on adding such feature, mainly because there isn't really one size fits all solution for this ...
Hi @zadam and @zpar-ky
thank you for your replies.
I know I can export it to markdown or html but AFAIK or at least what I'm doing is manually right clicking a note to export it as markdown.
What I'm looking for is to issue a command that at output the tree layout as well as markdown rendered folders + images.
Is this possible?
The part on building up the mkdocs .yaml folder I could write a "parser" to that.
Regards,
If you select and right click on a folder with subfolders/notes and export, Trilium will export all subnotes, keeping the structure. If you're talking about running a command to do so, I'm not sure.
Currently the only way to initiate export is through UI.
If I wanted to automate this, then I would probably make a script which would directly connect to the database (SQLite) and extract the data I need into the format I need. The DB structure is quite simple ...
@zadam
Oh!! I didn't know that document.db file was an sqlite "object"!!!
Now I know how to do it. thank you.
@zpar-ky thank you for your suggestion too. for now imma do this as I was already running a script to convert the .tar generated to mkdocs markdown format. This ain't practical because I couldn't find a way to pass the authentication phase when trying to fetch from backend scripts.
Now seems that the sqlite approach is more feasible.
thank you all
Most helpful comment
@zadam
Oh!! I didn't know that document.db file was an sqlite "object"!!!
Now I know how to do it. thank you.
@zpar-ky thank you for your suggestion too. for now imma do this as I was already running a script to convert the .tar generated to mkdocs markdown format. This ain't practical because I couldn't find a way to pass the authentication phase when trying to fetch from backend scripts.
Now seems that the sqlite approach is more feasible.
thank you all