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

Deprecate date IDs and use regular link style #151

Closed
6 tasks done
srid opened this issue Apr 30, 2020 · 3 comments
Closed
6 tasks done

Deprecate date IDs and use regular link style #151

srid opened this issue Apr 30, 2020 · 3 comments
Assignees
Labels
proposal Proposal with exact spec yet to be fleshed out

Comments

@srid
Copy link
Owner

srid commented Apr 30, 2020

This resolves #148, as well as simplifies things a bit.

  1. Switch to using short random hash (eg: b6f044c8) as the default zettel filename. This is same as the current custom ID type (arbitrary length of alpha numeric letters with hyphens and underscores). Date ID will be supported, but won't be the default in neuron new.

    • Add random hash support
    • Make random hash the default
    • Migrate neuron.zettel.page IDs to be consistent? (cancelled; not to break URLs)
  2. Add an (optional) "date" metadata field to the zettels to indicate the creation date of the Zettel (populated by neuron new).

  3. Switch zettel link style to be like regular links, i.e, instead of the ID put the title as the link text (with ID not appearing at all, but only as hover text). It will look like this:

image

Since custom IDs can be of arbitrary length it makes little sense to try to visually emphasize them in the UI, hence no. 3.

@srid srid added the proposal Proposal with exact spec yet to be fleshed out label Apr 30, 2020
@srid srid self-assigned this Apr 30, 2020
srid added a commit that referenced this issue Apr 30, 2020
@srid srid pinned this issue Apr 30, 2020
srid added a commit that referenced this issue Apr 30, 2020
@felko
Copy link
Contributor

felko commented May 1, 2020

Here is a python script that might help the migration https://gist.github.com/felko/f71582747ea9bab8ef2f38e7730991b6. It replaces file names and links to zettels with date IDs with generated hashes, and adds a date field in the metadata of each zettel. Usage: python3.8 migrate.py source_zettelkasten_dir target_zettelkasten_dir

@srid
Copy link
Owner Author

srid commented May 1, 2020

I've adapted this script with a few changes:

  • Limit the script to zettels created with date ID only (so existing zettels using custom or hash ID are left alone)
  • Use creation date encoded in the date ID instead of filesystem stat (which would be inaccurate in git checkouts)
  • Delete original zettel as soon as the new one is successfully written. You can do a git add . afterwards and do a git status to see what's changed.

https://gist.github.com/srid/a1321d559fd1a5fe464bb20c1a536107

srid added a commit that referenced this issue May 1, 2020
@srid
Copy link
Owner Author

srid commented May 1, 2020

All done.

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