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

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

Open
jvanz opened this issue Sep 10, 2022 · 6 comments
Open

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

jvanz opened this issue Sep 10, 2022 · 6 comments
Labels
enhancement New feature or request

Comments

@jvanz
Copy link
Collaborator

jvanz commented Sep 10, 2022

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
Copy link

jamesx4 commented Sep 10, 2022

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
Copy link
Collaborator

Eforen commented Sep 10, 2022

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.

  • Option that defaults true in the settings to include id in the frontmatter
  • Option that defaults true in the settings to include title in the frontmatter
  • Dropdown option for file naming (ID only, ID+Title, Title) Defaults to ID+Title

The dropdown would be seperate from the optional seperator.

Ideally we would also have the following:

  • Option that defaults false in the settings to include parrent_id in the frontmatter
  • Option that defaults false in the settings to include root_id in the frontmatter

@Eforen
Copy link
Collaborator

Eforen commented Sep 10, 2022

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

@jamesx4
Copy link

jamesx4 commented Sep 10, 2022

@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
Copy link
Collaborator

Eforen commented Sep 10, 2022

@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
Copy link

jamesx4 commented Sep 11, 2022

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.

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

No branches or pull requests

3 participants