Dyldog / luhman-obsidian-plugin

GNU General Public License v3.0
61 stars 18 forks source link

[FEATURE] Store the IDs in the YALM front matter #34

Open jvanz opened 2 years ago

jvanz commented 2 years ago

Requested Feature

Instead of using the ID as the file names. Allow the users define their own title and store the ID in the YAML front matter. This way the file name will make sense and it give the user a better experience when linking notes.

Solution

Create a configuration that allow the users to define if they want the ID in the file name. With the user wants the ID in the file name the ID will be store in the YAML front matter and in the file name. Otherwise, the ID will be store only in the YAML front matter.

All navigation commands will be based on the ID from the YAML front matter.

Maybe we can use dataview plugin to find the files necessary to our commands.

jamesx4 commented 2 years ago

Yes, breaking out the ID in the frontmatter is useful. I currently do this in a zettel template using templater:

id: <% tp.file.title.split(" ")[0] %> title: <% tp.file.title.split(" ").splice(1).join(' ') %>

Note, I use a space as the separator between ID and title. If that were a settings option I'd use it.

Eforen commented 2 years ago

I would be happy to see a PR for this as long as its a config option. This does I believe kinda tie into #13 though I would not mind seeing a PR for this before #13. just make sure that its an optional thing, unless you just want to add that to the frontmatter I would be okay with that but would prefer an option.

So what I would want to see in a PR as the best option.

The dropdown would be seperate from the optional seperator.

Ideally we would also have the following:

Eforen commented 2 years ago

Another thing to note is that dataview can be used with the filenames currently. Though it is admittedly advanced usage needed.

jamesx4 commented 2 years ago

@jvanz I actually like having the ID in the filename, helps me see the context in the File Explorer easier, but that's just me. I still see break out the ID in the frontmatter so I can do interesting things with Dataview.

Eforen commented 2 years ago

@jvanz I actually like having the ID in the filename, helps me see the context in the File Explorer easier, but that's just me. I still see break out the ID in the frontmatter so I can do interesting things with Dataview.

I feel the exact same way that's why I want it as an option that defaults to having the ID in the file name but also have an option to have it in the Frontmater

jamesx4 commented 2 years ago

When I break out the ID in frontmatter it's using a "uid" property, not aliases. It seems to work best to add the title to the aliases so when you link to that note from another note it can use the alias and not show the "uid" from the filename in the displayed link.

I like how you have it layed out in the PR suggestion above including the parent_id and root_id options in the frontmatter. Might be worth including whether that title goes in a title property or an aliases property. I think the latter would be very useful which is what #33 is about.