How can I import my notes from Dendron to Logseq?

Dendron is a note taking app in the form of a VS Code extension.
Since it’s no longer actively developed, I want to migrate to Logseq.

My efforts

I used a script from From Dendron to Logseq (archive) to transform my files.

However, every line in the frontmatter is now a page?
That’s odd; and annoying, as now all pages have a connection to several pages:

  • id
  • old_title (I modifies the script to preserve the old titles)
  • desc
  • updated
  • created
  • traitIds

Logseq thinks that all of those are pages.

Fixing Links

How can I port the Dendron-specific link syntax?
It supports a way off linking to a specific part of other pages, anywhere in the text.
How can I replicate this in Logseq?

Porting Jourals

Logseq is focused on daily journals, as is Dendron.
How can I port the “special” pages to be “special” journal pages in Logseq too?


Any help is off course always appreciated,
Friendly greetings,
Tanja :blush: :cherry_blossom:

I now have some more clues:

  1. If I use a named Dendron link like this: [[yesterday|2024-02-25]], I need to convert it like so: [yesterday]([[2024-02-25]])
  2. It thinks every line in frontmatter is a page title
  3. Dendron has note references, which ca anchor to any part of the page by inserting spacial anchors

Solutions

I used VS Code to find & replace:

  1. From \[\[(.+?)\|(.+?)\]\] to [$1]([[$2]]) to port the named Dendron links
  2. From (---\nid: (.|\n)+?---\n) to <!--\n$1-->\n\n to comment out the frontmatter

Unsolved problems

  1. The syntax for block references in Logseq is ((65dbe6ca-f417-45d4-8a0e-3c4e66e9e053)) where the UUID between the braces is the UUID of the logseq block.

I don’t know how I would convert the source

Some note text here ^1f1egthix10t

and the reference

![[dendron.topic.note-reference.sample#^1f1egthix10t]]

To the correct ((uuid goes here))


Any ideas?

For now, I’ll simply discard the special Dendron anchors:

Workaround for problem 3

I once again used VS code to search & replace:

  1. From \^[a-z0-9]{12}$ (note the leading space before the backslash, it isn’t rendered) to “” (empty string) to get rid of the special Dendron anchors within the contnet
  2. From #\^[a-z0-9]{12}(:#\^[a-z0-9]{12})? to “” (empty string) to remove the special Dendron anchors from the links

Note that this is a lossy conversion, as I do not know a way of calculating the UUID a block would get in Logseq to put it between double braces: ((uuid-unknown))


Does anyone know how this would work?

Furthermore, I applied:

  • From - \[ \] to - TODO
  • From - \[x\] to - DONE

to handle TODOs