Update readme

This commit is contained in:
Marty Oehme 2021-04-30 16:46:03 +02:00
parent 3eccd67b21
commit f615dd0fbd
Signed by: Marty
GPG key ID: B7538B8F50A1C800

View file

@ -4,39 +4,27 @@ To develop / debug:
start neovim with `nvim --cmd "set rtp+=$(pwd)" .` to automatically load the files in project dir as if they were on path start neovim with `nvim --cmd "set rtp+=$(pwd)" .` to automatically load the files in project dir as if they were on path
next up:
[ ] fix link following:
* [x] empty space (e.g. in link text, or link itself) disrupts link regex search
* [x] line-end following breaks if cursor is in the MIDDLE of the link
* [x] extract anchor from link/string (anchor.lua)
* [x] probably stop hardcoding anchor regex, make an option
* [ ] implement custom anchor creation function to go with custom regex
* [ ] opening zettel should use generated link table for full filename anchor search
* [x] need a default zettel directory to look in
* [ ] link following order should be:
* [x] look up & follow anchor
* [ ] look for filename in current dir (or relative/absolute link loc)
* [ ] implement fallback to filename in any of zettel subdirs
## TODO: needed functionality ## TODO: needed functionality
* [ ] note creation (new anchor) * [ ] note creation (new anchor)
* [x] create anchor * [x] create anchor
* [ ] *unique* anchor creation * [ ] *unique* anchor creation
* [ ] implement custom anchor creation function to go with custom anchor regex
* [x] create link (md / wiki) * [x] create link (md / wiki)
* [ ] note listing (anchors / titles, no anchor) * [ ] note listing (anchors / titles, no anchor)
* [ ] list anchors * [ ] list anchors
* [ ] list filenames * [ ] list filenames
* [ ] link following (to existing anchor) * [x] link following (to existing anchor)
* [ ] fallback to filename if anchor invalid / not found * [x] fallback to filename if anchor invalid / not found
* [ ] link creation (to existing note) * [ ] link creation (to existing note)
* [ ] list existing * [ ] list existing
* [ ] create link (md / wiki) * [ ] create link (md / wiki)
* [ ] link switching (point to another existing note) * [ ] link switching (point to another existing note)
* [ ] note search (title / full-text) * [ ] note search (title / full-text)
* [ ] jump to zettel (open existing anchor) * [x] jump to zettel (open existing anchor)
* [ ] select by anchor * [x] select by anchor
* [ ] select by (fuzzy) title match * [x] select by link/title match
* [ ] Opt: select by fuzzy title match
* [ ] options * [ ] options
* [x] zettel anchor separator * [x] zettel anchor separator
* [x] zettel extension * [x] zettel extension
@ -46,6 +34,24 @@ next up:
* [ ] recursive dir lookup for zettel * [ ] recursive dir lookup for zettel
* [ ] zettel anchor regex * [ ] zettel anchor regex
## TODO: maintenance
* [ ] remove hard-coding of option vimnames in tests, now that we can dynamically change this through a single table
* anchor creation
* *must* be unique
* default: 10 digits, usually current date+time (YYMMDDHHmm)
* but, if multiple links created within one minute (or other circumstances), this would duplicate
* thus, duplicate-check before creating a new anchor
* if duplicated, generate first *non*-duplicated link (recursive?)
* try to move *backwards* through minutes not forward
* i.e. if 2030101200 exists move to 2030101159, 2030101158, ...
* if moving backwards, we do not take away id space from *future* note creation
* if moving forwards, every zettel created within a minute would delay next zettel creation *another* minute
* to decide: should zettel creation create a zettel in current working dir or at zettel root dir? or set by option?
* [ ] (CODE) switch -- comments to --- doc comments for function descriptions etc
## TODO: nice-to-haves ## TODO: nice-to-haves
* [ ] refactor parsers (md/wiki) to be tables of functions/regex in options, so e.g. valid link detection can call `options.parser.isValidLink(link)` or transformation `options.parser.styleLink(anchor, text)` * [ ] refactor parsers (md/wiki) to be tables of functions/regex in options, so e.g. valid link detection can call `options.parser.isValidLink(link)` or transformation `options.parser.styleLink(anchor, text)`
@ -67,29 +73,29 @@ next up:
* [ ] file/directory exception list for gathering files, which will be ignored * [ ] file/directory exception list for gathering files, which will be ignored
* [ ] 'strict' mode *only* matching and following valid anchor links * [ ] 'strict' mode *only* matching and following valid anchor links
## TODO: maintenance
* [ ] remove hard-coding of option vimnames in tests, now that we can dynamically change this through a single table
* anchor creation
* *must* be unique
* default: 10 digits, usually current date+time (YYMMDDHHmm)
* but, if multiple links created within one minute (or other circumstances), this would duplicate
* thus, duplicate-check before creating a new anchor
* if duplicated, generate first *non*-duplicated link (recursive?)
* try to move *backwards* through minutes not forward
* i.e. if 2030101200 exists move to 2030101159, 2030101158, ...
* if moving backwards, we do not take away id space from *future* note creation
* if moving forwards, every zettel created within a minute would delay next zettel creation *another* minute
* to decide: should zettel creation create a zettel in current working dir or at zettel root dir? or set by option?
* [ ] (CODE) switch -- comments to --- doc comments for function descriptions etc
## Options ## Options
atm: Options can currently be set via lua:
```lua
vim.g["zettel_extension"] = ".wiki"
``` ```
anchor_separator = vim.g["zettel_anchor_separator"] or vim.b["zettel_anchor_separator"] or "_",
zettel_extension = vim.g["zettel_extension"] or vim.b["zettel_extension"] or ".md", or via vimscript:
zettel_root = vim.g["zettel_root"] or vim.b["zettel_root"] or "~/documents/notes",
```vim
let g:zettel_extension = ".wiki"
``` ```
The functionality is the same. The plugin will look up options by precedence buffer > global > default.
```lua
anchor_separator = vim.b["zettel_anchor_separator"] or vim.g["zettel_anchor_separator"] or "_",
zettel_extension = vim.b["zettel_extension"] or vim.g["zettel_extension"] or ".md",
zettel_root = vim.b["zettel_root"] or vim.g["zettel_root"] or "~/documents/notes",
```
Since, as long as the api still changes rapidly,
a list of options would quickly be outdated,
what you can instead is to look into `options.lua`,
where at the top the currently effective options with their defaults and available values are defined.