felko / neuron-mode

An emacs mode for editing Zettelkasten notes with neuron
GNU General Public License v3.0
118 stars 21 forks source link

Allow creating new zettels with a custom id #37

Closed anka-213 closed 4 years ago

anka-213 commented 4 years ago

I would love if you could customize which type of id you want to use with the neuron-new-zettel command, so you either use --id-hash, --id-date or --id <something> depending on a setting.

felko commented 4 years ago

Good call, --id-hash and --id-date are easy, not sure what you meant by --id <something>, since the ID shouldn't be fixed to some constant value. However, I can add a setting that prompts the ID when creating the zettel.

anka-213 commented 4 years ago

Yes, that was exactly what I meant. <something> is whatever the user plugs in when running the command. Great!

felko commented 4 years ago

Should be working now, thanks for the suggestion. However the IDs considered as valid by neuron are only alphanumeric strings (and dashes) which might be a little restrictive if we want in the future to add more complicated logic to the generation of the ID, which might be useful when also working with Obsidian or Zettlr (in particular, one could want the titles to appear in the zettel filename).

srid commented 4 years ago

However the IDs considered as valid by neuron are only alphanumeric strings (and dashes)

That was a conservative choice made for no particular reason than being conservative (from the Markdown parser perspective). I mean, would this have to be a valid link? Hello [[ world. The answer to universe ]] life and everything is 42?

anka-213 commented 4 years ago

However the IDs considered as valid by neuron are only alphanumeric strings (and dashes) which might be a little restrictive

I think neuron also allows underscores, which it seems like (unless I misread the code) your check forbids.

felko commented 4 years ago

Fixed, thanks.