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

Google Keep: unnecessary alias #65

Closed
NomarCub opened this issue Aug 12, 2023 · 10 comments
Closed

Google Keep: unnecessary alias #65

NomarCub opened this issue Aug 12, 2023 · 10 comments

Comments

@NomarCub
Copy link

Aliases should only be used when the title would be an invalid file name, otherwise it's just duplicated information. Now every note with a title has one.
Notes that don't have a title in Keep get a date title, but no alias, which is also weird.

@NomarCub NomarCub changed the title Keep: unnecessary alias Google Keep: unnecessary alias Aug 12, 2023
@lishid
Copy link
Collaborator

lishid commented Aug 12, 2023

@daledesilva I am not sure I understand the purpose of using keepJson.title.split('\n') for aliases. Can notes have multiple titles?

@lishid lishid closed this as completed in 81a46d3 Aug 12, 2023
@NomarCub
Copy link
Author

Notes can have titles that are more than one line long, but I only noticed that accidentally.
The data then looks like this: "title": "line one\nline two",. It can even have trailing newlines.

@lishid
Copy link
Collaborator

lishid commented Aug 12, 2023

For "line one\nline two", what does the filename become?

@NomarCub
Copy link
Author

With 1.1.0, it's line one_line two
The alias becomes line one line two

@lishid
Copy link
Collaborator

lishid commented Aug 12, 2023

Hmm ok, so we should probably ignore the title field altogether? What do you think @daledesilva?

@NomarCub
Copy link
Author

Definitely don't ignore the title, at least for file names. Notes can even be only a title. I don't think many people use multi line titles, you'd have to know and press shit enter, or a normal enter would take you to the note content when you input it. (Or you can just copy text there that has more lines.)
I think it's fine as is, collapsing multi line titles with a single space, and keeping the file name with underscores.

@lishid
Copy link
Collaborator

lishid commented Aug 12, 2023

The file name is created from what Keep exports as file names in the zip. If it's always some combination of flattened "title" field then it would make sense to ignore.

@NomarCub
Copy link
Author

I think that's what it is, yes, and if there's no title, it's the date instead. But I would not ignore it, unless you have some better mechanism for creating a file name or title. It makes a lot of sense to me, to have the OS friendly file name, and if it differs from the original, have an alias field with the original title with special characters if there were any.

@lishid
Copy link
Collaborator

lishid commented Aug 12, 2023

Ok so it makes sense to alias to line one and line two, which is the current behavior.

@daledesilva
Copy link
Contributor

daledesilva commented Aug 12, 2023

Agree with all of this. That was my thinking when I did it.

To reiterate

  • Notes can often just be a title.
  • The obsidian note name is just what keep exported as filename so it's already sanitised.
  • Because the original title can have any character or even line breaks, the filename can be different, so the original title is added as an alias.
  • To prevent multi line aliases, new line chars are replaced with spaces.

Note, on the original ticket question...
I considered checking whether the title matched the filename and only adding the alias if different, but I decided to just keep it simple and consistent for every note. Which could definitely be reconsidered if necessary.

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

No branches or pull requests

3 participants