nb
nb copied to clipboard
Archiving Files
Forgive me if this is already possible, but as far as I can tell from the docs only notebooks can be archived. It would be really helpful to be able to archive files as well.
I imagine it could be done by adding a period to the beginning of the name of the file and then checking for that period during ls
and other related methods.
+1'ing this. Is it currently supported?
File archiving hasn't been implemented yet.
Would you mind me implementing this feature? Currently I move notes to a notebook called archive
but then they would all I fell in love with nb the moment I saw it and would like to contribute.
Here are some ideas if you are up for it:
- Add a period (
.
) to the start of the file name and removing it for unarchiving - Rename to
*.archived.md
for archiving and back to*.md
for unarchiving - Add
archived: true
as markdown front matter and remove allarchived: true
lines for unarchiving
@hulloanson Those are all interesting potential approaches. My initial inclination is toward adding a .
to the filename. There are edge cases to consider, such as archiving an item with the same name as an existing dot file, such archiving a folder named git
.
I am interested on archiving my notes too, keeping archived items accessible. Sometimes I want to remove a note from nb ls
, but without deleting it.
Some ideas:
$ nb archive 2 # archive note 2. This note doesn't appear on nb ls anymore
$ nb ls # list all but archived
$ nb ls --include-archived # list all including archived
$ nb ls --only-archived # list only archived
Or something like that.