Closed gkthiruvathukal closed 6 years ago
Ja wohl!! I agree that we should not eliminate option of naming a file with the timestamp, so retaining that in a new form [--timestamp] is important.
But, having the ability to establish a name [--id] and then a sequence number for the creation of a series of zettels that have that name, but won't over-write each other through [--seq] is essential.
This would allow someone to specify through filename as zettels are created (individually or via for loops for batches) their importance in any project. For a paper/book outline, for instance you could specify that this set of zettels (cards) will be good for [--id Part-A-Section-1 --seq nnnn].
Although --now
and --now-id
are deprecated, it is still possible to emulate this functionality using --name timestamp
or --name id timestamp
/ --name timestamp id
. The id, seq, and timestamp can appear in any order in the resulting filename.
Based on recent meetings with @dbdennis, we are getting a bit more experience with using the tools for writing our actual book.
We like
--now
and--now-id
, but discovered that--now
can easily generate the same timestamp when you create two zettels in rapid succession (or even concurrently). While this is ok, there is a need to be able to append a sequence number when using a timestamp.There needs to be some care when designing this. When I think about it, we probably should not be computing the timestamp within the zettel command, since any two invocations of zettel will have potential for a different timestamp when run in succession.
I propose that we do away with
--now
and--now-id
. We'd replace this with--id
(for the label),--seq
N (for the number in the sequence), and--timestamp
(to include a timestamp if desired. If any of--id
,--seq
, or--timestamp
is omitted, they will not show up in the filename. The user can specify options (e.g.--naming-order id,seq
,--naming-separator "-"
) to indicate how to assemble the resulting filename. We don't want this to be too complicated, so there will be reasonable defaults so you only use these options when you need to do something crazy.So here are some examples:
zettel --id sir-charles --seq 1 --digits 2 --name-order seq:id --name-separator "_"
results in a file sir-charles_01.yaml
zettel --id sir-charles --seq 1 --digits 2 --name-order id,seq --name-separator "_"
results in a file 01_sir-charles.yaml
zettel --id sir-charles --seq 1 --digits 2 --name-order seq:id:timestamp --name-separator "_" --timestamp
results in a file 01_sir-charles._20180421093340.yaml
Note that using --name-order is not required but is aimed at giving the user control of the output filename. If you omit it, the default is to order first by id, then by sequence, then by timestamp, depending on which are present.