(zettel (meta (back "00001003300000 00001004010000 00001006020000 00001012054600 00001012080500") (backward "00001003300000 00001004010000 00001006020000 00001012054600 00001012080500") (box-name "manual") (created "20210126175322") (forward "00001004011400 00001004011600 00001004050000 00001005090000") (modified "20260727185211") (published "20260727185211") (role "manual") (syntax "zmk") (tags "#configuration #manual #zettelstore") (title "Zettelstore boxes")) (rights read) (content "" "Zettelstore must store its zettel somewhere.\nIn most cases you want to store your zettel as files in a directory.\nUnder certain circumstances you may want to store your zettel elsewhere.\n\nAn example is the [[predefined zettel|00001005090000]] that come with Zettelstore.\nThey are stored within the software itself.\nIn another situation you may want to store your zettel in volatile memory, e.g. if you want to provide a sandbox for experimenting.\n\nTo cope with these (and more) situations, you configure Zettelstore to use one or more __boxes__.\nThis is done using the ''box-uri-X'' keys of the [[startup configuration|00001004010000#box-uri-X]] (X is a number).\nBoxes are specified using special [[URIs|https://en.wikipedia.org/wiki/Uniform_Resource_Identifier]], similar to web addresses.\n\nThe following box URIs are supported:\n\n; [!dir|''dir://DIR'']\n: Specifies a directory where zettel files are stored.\n ''DIR'' specifies the path to the directory.\n You can use a relative file path, such as ''./zettel'' (→ URI is ''dir://./zettel''), but in most cases an absolute file path is recommended, e.g. ''/home/user/zettel''.\n\n The directory must exist before starting Zettelstore[^There is one exception: when Zettelstore is [[started without any parameter|00001004050000]], e.g. via double-clicking its icon, a directory called ''./zettel'' will be created.].\n\n It is possible to [[configure|00001004011400]] a directory box.\n; [!file|''file:FILE.zip'' or ''file:///path/to/file.zip'']\n: Specifies a ZIP file that contains files that store zettel.\n You can create such a ZIP file, if you zip a directory full of zettel files.\n\n This box is always read-only.\n; [!mem|''mem:'']\n: Stores zettel in volatile memory.\n If you stop Zettelstore, all changes are lost.\n To limit usage of volatile memory, you should [[configure|00001004011600]] this type of box, although the default values might be appropriate for your use case.\n\nAll boxes that you configure via the ''box-uri-X'' keys form a chain of boxes.\nWhen Zettelstore retrieves a zettel, a search starts in the box specified with the ''box-uri-1'' key, then ''box-uri-2'' and so on.\nIf a zettel is created or changed, it is always stored in the box specified with the ''box-uri-1'' key.\nThis allows you to overwrite zettel from other boxes, e.g. the predefined zettel.\n\nEvery box has a unique \"\"name\"\".\nThe name of a box can be assigned if you set the URI query parameter ''name'' to its desired value.\nIt is an error if you give the same name twice.\nIf no query parameter ''name'' is given, Zettelstore checks whether the URI scheme can be used as a unique name.\nAs a last resort, a name is calculated by the URI position, and optionally made unique by adding the value of another counter.\n\nIf you use the ''mem:'' box, where zettel are stored in volatile memory, it only makes sense if you configure it as ''box-uri-1''.\nSuch a box will be empty when Zettelstore starts, and only the first box will receive updates.\nYou must ensure that your computer has enough RAM to store all zettel."))