Open icornelius opened 2 years ago
The relevant commit, setting counter
output, is d39210b39b49da6c4d8512b1312da1441fe423e6. See also 02de204aa5dd760d2385a1554c48853f4e3356e4.
A final newline should be written to the end of .counter.dat
, to facilitate display in the terminal (e.g., with cat
).
19895713194dfa849d36941513e7b9d5720a6b3c is sufficient because yaml.load
reads any existing json-encoded .counter.dat
on first invocation. There is no need for a dedicated one-time translation between formats, as yaml is a superset of json.
The
--counter
option assigns a serial number to new notes created with thezettel
command. Usage:The file
.counter.dat
maintains the count of zetteln written for each COUNTER. This is serialized in JSON.I suggest switching to YAML since that will introduce newlines in the file and simplify resolution of git merge conflicts in distributed projects. Alternatively, users could add
.counter.dat
to their.gitignore
. Then each local system would keep its own separate count, defeating the purpose of a counter.