nb icon indicating copy to clipboard operation
nb copied to clipboard

Archiving Files

Open enobrev opened this issue 3 years ago • 5 comments

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.

enobrev avatar Nov 11 '20 16:11 enobrev

+1'ing this. Is it currently supported?

hulloanson avatar Aug 29 '22 17:08 hulloanson

File archiving hasn't been implemented yet.

xwmx avatar Sep 01 '22 18:09 xwmx

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:

  1. Add a period (.) to the start of the file name and removing it for unarchiving
  2. Rename to *.archived.md for archiving and back to *.md for unarchiving
  3. Add archived: true as markdown front matter and remove all archived: true lines for unarchiving

hulloanson avatar Sep 05 '22 13:09 hulloanson

@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.

xwmx avatar Sep 06 '22 21:09 xwmx

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.

llagerlof avatar Sep 09 '22 12:09 llagerlof