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

Allow title as Zettel IDs #399

Closed
3 tasks done
srid opened this issue Sep 15, 2020 · 5 comments
Closed
3 tasks done

Allow title as Zettel IDs #399

srid opened this issue Sep 15, 2020 · 5 comments
Assignees
Labels
proposal Proposal with exact spec yet to be fleshed out
Milestone

Comments

@srid
Copy link
Owner

srid commented Sep 15, 2020

Allow arbitrary text in Zettel IDs, so that people can use title in place of some cryptic identifier. For example,

Most “storage-oriented” notes will never be useful again. [[Most people take only transient notes]].

So we allow whitespace, as well as any other character (except [ and ]) that can be used in filenames on macOS and Linux.

A couple of changes will be needed on top of this:

  • Generated pages should use a more "clean" URL, however. So the link in the above example should map to Most_people_take_only_transient_notes.html.
  • Now that title is allowed in ID - if the note has no level-1 heading, use that ID as its rendered title (instead of extracting the first paragraph snippet).

Wouldn't this make the title "static"? Yes, but users can use a refactoring tool to "rename" (for eg: vscode-memo provides one) the references in one-click. Though, this would invalidate the previously published URLs. If that's important, then users should use random IDs along with a custom title in the note, which would still be supported. The documentation should mention this tradeoff clearly.

Parts

  • Allow whitespace in IDs; slugifying where appropriate (Allow whitespace in Zettel ID #404)
  • Treat title IDs as the title to fallback to when one is not specified
  • Allow punctuation marks and other letters
@srid srid added the proposal Proposal with exact spec yet to be fleshed out label Sep 15, 2020
@srid srid added this to the 1.0 milestone Sep 15, 2020
@srid
Copy link
Owner Author

srid commented Sep 15, 2020

This adds a bit to the future-proof property. You can open the .md files on any computer, without neuron installed or the generated site available, and still be able to make sense of the plain-text note by reading it on its own.

@srid
Copy link
Owner Author

srid commented Sep 15, 2020

users can use a refactoring tool to "rename"

Perhaps neuron should provide such a refactoring tool (neuron rename).

@srid srid pinned this issue Sep 15, 2020
@srid srid mentioned this issue Sep 17, 2020
3 tasks
@srid srid self-assigned this Sep 18, 2020
srid added a commit that referenced this issue Sep 18, 2020
srid added a commit that referenced this issue Sep 18, 2020
@srid
Copy link
Owner Author

srid commented Sep 18, 2020

Done, and documented at https://neuron.zettel.page/id.html - as well as deployed to Cerveau.

@srid srid closed this as completed Sep 18, 2020
@fiatjaf
Copy link
Contributor

fiatjaf commented Sep 18, 2020

I was going to suggest a rename tool a while ago but I thought some perl regex would do the job.

But now I think a rename tool that keeps the previous name cached somewhere (in the own zettel attributes as an alias, for example) and then gets generated as a redirect link in the site's HTML.

@srid
Copy link
Owner Author

srid commented Sep 18, 2020

VScode gif demo of title ID in action: https://neuron.zettel.page/editor.html#vscode

@srid srid unpinned this issue Sep 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
proposal Proposal with exact spec yet to be fleshed out
Projects
None yet
Development

No branches or pull requests

2 participants