I’m looking for a way to create a folder with markdown files and canvases that link/diagram the relationships between fhe files.
The markdown files are created from XML which defines the relationships.
Things I have tried
I’ve studied the raw canvas file. I get everything structured except the id.
I tried using the file name without the extension - that failed.
I tried creating a uuid without dashes referencing an existing file - that failed.
It’s clear a valid uuid is required. It’s unclear where that uuid is created.
The question boils down to - how do you create valid uuid’s that can be used in a canvas file?
The “id” field is only a string which is required to be unique, but no structure is imposed on it. Even a string like “foobar” would be valid (tested). Of course a simple way of ensuring unicity is to generate one via some library (python comes with uuid module). But I guess you can also programatically generate autoincremental numbers and generate strings like “node-1”, “node-2”, etc.
I tried using the file name without the extension - that failed.
This is the way to go. The following mini-example shows how to create that file reference:
(Note that I made up the ids, in this case having some structural meaning instead of being random. As long as they are unique strings, they should work)
This is how this example it is rendered in Obsidian (assuming that files “First Note.md” and “Second Note.md” do exist in the vault, and have that content):