Skip to content
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

Is there any way the exported markdown files can have their "date created" set to the keep note's "date created" that is written in the files themselves? #43

Open
TylerDavidJames opened this issue May 11, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@TylerDavidJames
Copy link

Love the script, thanks so much for saving me days of work!
I like that I can add the date created and updated from the keep note to the end of the markdown file that it generates, but I'm wondering if there is any way to create a markdown file for each note that has customised metadata that says it was created on the date that the keep note it refers to was created. That way when you sort the exported markdown files in obsidian by date, you get the same view by most recently created notes that you see in keep's home page.
I don't know much about creating files with custom metadata, so this might not even be possible. I was just curious.

@djsudduth
Copy link
Owner

djsudduth commented May 12, 2022

Hmmmm.....interesting question. It is possible but not very easy - there are some python libraries that can modify the create date but doing this is tricky on multiple operating systems (windows, linux, mac). However, I could add a switch to sort and export notes by the Keep datetime order and delay the output so that notes are output in the markdown file create time order. In that case you could sort your Obsidian files in the same order as Keep even though they'd be the same export date.

I'm in the middle of refactoring the code right now - so this might be a while. But, after my changes, sorting by timestamps will be easier.

@TylerDavidJames
Copy link
Author

That sounds great too! I noticed that the sort by date option in obsidian did leave some of my more recently created keep notes futher away on the list than my earliest created ones, because they were all exported within 3 minutes or so, and I think it went through them in order. So I think there is a rough version of what you are envisioning already happening naturally just depending on how slow the notes export.

@djsudduth djsudduth added the enhancement New feature or request label Jul 7, 2022
@benooye
Copy link

benooye commented Mar 18, 2023

Hello, as a simple hack, in the function def keep_query_convert(keep, keepquery, opts)
Just modify the line:
for note in notes:
by the following one:
for note in reversed(notes):

It will create the Mardown files in the reverse order starting by the oldest ones and finish by the new ones
So in Obsidian you can sort by modified date and it will apears in the good order

Thanks a lot for the code it is very helpfull

@djsudduth
Copy link
Owner

@benooye - awesome! thx for the tip! I'm wondering if the speed of conversion sometimes doesn't keep them in reverse order - e.g. 10 md files with the same date/time stamp. What have you discovered? I was thinking of adding a file io change to set the md file date/time to the note create date/time.

@benooye
Copy link

benooye commented Mar 19, 2023

Dear @djsudduth, for me, when notes are created in reversed order, when I display them in Osbidian and sort them by modified date I have the proper order so it is ok for me.

To have a better handling of file date and file modification and reflect note creation and modifed date, it seems os.utime() function in Python should be able to do that
https://www.tutorialspoint.com/python/os_utime.htm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants