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

Evernote links and GUIDs are not populated for untitled notes #609

Closed
mezzode opened this issue Feb 22, 2024 · 12 comments
Closed

Evernote links and GUIDs are not populated for untitled notes #609

mezzode opened this issue Feb 22, 2024 · 12 comments

Comments

@mezzode
Copy link
Contributor

mezzode commented Feb 22, 2024

When untitled notes are converted, the {evernotelink} block is just output as <YARLE_EVERNOTE_LINK_PLACEHOLDER> and the {evernoteguid} block is output as <YARLE_EVERNOTE_GUID_PLACEHOLDER>

@akosbalasko
Copy link
Owner

Hi @mezzode ,
Could you pls send me your configuration?
Thanks a lot!

@mezzode
Copy link
Contributor Author

mezzode commented Feb 25, 2024

@akosbalasko This is the config, without paths

{
  "isMetadataNeeded": true,
  "isNotebookNameNeeded": false,
  "isZettelkastenNeeded": false,
  "useZettelIdAsFilename": false,
  "plainTextNotesOnly": false,
  "skipLocation": true,
  "skipCreationTime": true,
  "skipUpdateTime": true,
  "skipSourceUrl": true,
  "skipWebClips": false,
  "skipTags": true,
  "useHashTags": true,
  "outputFormat": "ObsidianMD",
  "taskOutputFormat": "ObsidianMD",
  "skipEnexFileNameFromOutputPath": false,
  "keepMDCharactersOfENNotes": false,
  "monospaceIsCodeBlock": false,
  "keepOriginalHtml": true,
  "resourcesDir": "_resources",
  "trimStartingTabs": false,
  "convertPlainHtmlNewlines": false,
  "encryptionPasswords": [
    ""
  ],
  "nestedTags": {},
  "logseqSettings": {
    "journalNotes": false
  },
  "obsidianSettings": {
    "omitLinkDisplayName": false
  },
  "dateFormat": "YYYY-MM-DD HH:mm",
  "keepImageSize": "ObsidianMD",
  "keepOriginalAmountOfNewlines": true,
  "addExtensionToInternalLinks": false,
  "generateNakedUrls": true,
  "urlEncodeFileNamesAndLinks": false,
  "haveEnexLevelResources": false,
  "haveGlobalResources": false,
  "useUniqueUnknownFileNames": true,
  "useLevenshteinForLinks": false,
  "sanitizeResourceNameSpaces": false,
  "replacementChar": "_",
  "replacementCharacterMap": {
    "<": "_",
    ">": "_",
    ":": "_",
    "\"": "_",
    "/": "_",
    "\\": "_",
    "|": "_",
    "?": "_",
    "*": "_"
  }
}

And this is the template I've been using:

---
{created-at-block}date created:  {created-at}{end-created-at-block}
{updated-at-block}date modified: {updated-at}{end-updated-at-block}
{source-url-block}evernote source url: {source-url}{end-source-url-block}
{notebook-block}evernote notebook: {notebook}{end-notebook-block}
{evernotelink-block}evernote link: {evernotelink}{end-evernotelink-block}
{evernoteguid-block}evernote guid: {evernoteguid}{end-evernoteguid-block}

{tags-block}
tags: {tags-array}
{end-tags-block}
---

{title-block}# {title}{end-title-block}
{link-to-original-block}{link-to-original}{end-link-to-original-block}

{content-block}{content}{end-content-block}

@akosbalasko
Copy link
Owner

Hi @mezzode ,
Thanks for the info. A short question that may lead to a workaround: could you pls create Table of Content note and include it into the exported enex file? (Just select all notes, copy links, then create a new note named "Table of Contents" and paste the links there)
Thanks!

@mezzode
Copy link
Contributor Author

mezzode commented Feb 25, 2024

I already created a Table of Contents note and the fields do get correctly populated for named notes, but for notes which are untitled the fields are just the placeholders

@akosbalasko
Copy link
Owner

Hi @mezzode ,
Okay, thanks for the info, now I can reproduce the problem. The main issue is that in ToC if you add multiple Untitled notes, all of them are shown as Untitled, you have no clue which is which. What do you think, what would be the better solution:

  1. simply remove the guid/en-link tags from the generated note,
  2. put all of the untitled notes' links/ guids into every note?

@mezzode
Copy link
Contributor Author

mezzode commented Feb 27, 2024

Hmm between those two options, 2 is probably better since that way we don't lose any information.

I do wonder whether there's a way to use the auto-generated titles though, in Evernote untitled notes do display part of the first line as a title, and these are also used for the internal links in the ToC. It would be good if Yarle could add the matching title when converting untitled notes, that way the GUIDs can be directly matched. Updating the titles would actually also help with #478

@akosbalasko
Copy link
Owner

Yesterday temporarily I implemented opt 1, because it was far more straightforward than opt2.
The problem is that Evernote fails to keep valid information in Enex. Namely, if a note has no title, in the UI it is shown as "Untitled", and in the TOC it is shown as "Untitled" as a link, but in the Enex file it has a title called "Untitled Note". As the indirect linking is based on the text that is used in links (like what is in the ToC), it fails to identify the note itself.
The same stands for GUID, as the guid is not stored within the note, just in the ToC, there is no way to use it to connect them.
Opt2 is doable but it requires much effort, and I'm not sure that it is worth doing.

So the current solution works only if the notebook contains uniqually titled notes.

The only way, that came to my mind is to forget Enex as it is and use Evernote API to get the notebooks/notes and everything, but it requires much much effort to do, and now I'd focus on the target side like enabling direct import to Notion or Mem.

@mezzode
Copy link
Contributor Author

mezzode commented Feb 28, 2024

Actually in the current version of Evernote they all seem to be shown in the UI with a generated title based on the first line of text in the note, and this generated title is also used for the links in the ToC. So it should be possible to match untitled notes to their GUID by generating a title from their first lines then using that to match them to their link in the ToC?

@akosbalasko
Copy link
Owner

@mezzode oh, really? I should be a brand new thing, or at least newer than my client, let me update my Evernote and check it. Yes, it would definitely solve the problems, thanks for raising my attention to this change!

@akosbalasko
Copy link
Owner

oookay, I updated the client, and the first line of the note is added as title only if I click into the title field. If I do not set title field into focus, it remains untitled. And as it has title from now, it won't be recognized as untitled, so it would be converted as a normal title, if we assume that the title is unique.

@akosbalasko
Copy link
Owner

So I think it doesn't solve the issue, I'd close this one as the opt1 is implemented and released, and then I'd open a different issue to put references for all of the notes that have the same name.

@mezzode
Copy link
Contributor Author

mezzode commented Feb 29, 2024

Hmm that's strange, it looks like they might have updated the behavior since for my older Untitled notes while they do show the generated title in Evernote and the ToC, when I export them in the exported .enex their title is left as "Untitled Note" meaning they aren't getting properly matched to the ToC. Whereas for brand new notes the behavior is as you describe. I can provide screenshots and the corresponding .enex files if that would help show you this

I think the solution would be to update the titles in the case where they're being left as "Untitled Note" to make sure we can properly match them like for newer notes since their titles aren't being updated on Evernote's side

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

2 participants