-
-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Import markdown files with frontmatter yaml? #24
Comments
Yes, it's possible to set the meta info as
You may need to change the source code little bit to clean up the yaml part from the note content itself. |
Thanks for the hint @Nriver . I ended up modifying the Would you be interested in integrating it? If so, I can clean it up a little and maybe make it optional too, and create a pr. Do you know if it's possible to change the created and updated timestamps for a note? I didn't see an option for it in |
PR is welcomed. As far as I know, changing the timestamps by ETAPI is not supported yet. Maybe you can create a feature request for that. |
One more question @Nriver, while testing this I noticed markdown files that link to other markdown files end up getting the 2nd markdown file uploaded as an attachment child note. Is this intentional? Looking at the code, I'm not sure what the best way to change that to link to another regular note (instead of file attachment) would be since trilium might not have the note you're linking to (yet) |
The file upload is introduced because of this issue #5. I implement the feature in this way 99d2197. The use case I thought about was file attachment like I never used link to another md file because the link is quite difficult to maintain as you have to manually input the relative path. And the md file may get move around or renamed which will make the link invalid. The only way I can think about to fix this is to maitain a big dict of {note_id: note_path, ...} while uploading the markdowns. Then make another iterate of all the uploaded note contents to fix the internal links. |
Thanks for creating this library! I've only just started testing out Trilium, but I'm liking it so far. One of the things I'd like to do is import all of my old notes from Joplin and Obsidian.
I used a script similar to the one in the README but noticed yaml frontmatter doesn't get preserved. For example, a joplin exported note like this:
Gets turned into this (when viewing the source of the trilium note):
Is it possible (and does it make sense) to convert that yaml frontmatter and turn it into attributes on the note? For my example, I think it'd get turned into something like
#latitude=xx.xx #longitude=-yy.yy #altitude=101
.I've used https://pypi.org/project/python-frontmatter/ in the past and it worked okay. I haven't looked much at the code here or the trilium api, but I might try to take a look this weekend if I continue w/ trilium.
The text was updated successfully, but these errors were encountered: