|
| 1 | +# Managing Notebooks |
| 2 | + |
| 3 | +## DEFAULT and USE notebook pointers |
| 4 | + |
| 5 | +By default *notes* will use the notebook pointed to by the 'USE' |
| 6 | +symlink. |
| 7 | + |
| 8 | +Running the command *notes config* will display both the contents of |
| 9 | +the 'config' file and also where the USE and DEFAULT links are pointing |
| 10 | +to. |
| 11 | + |
| 12 | +The DEFAULT notebook pointer is the notebook that notes will change the |
| 13 | +USE pointer to if no argument is supplied to the *notebook use* |
| 14 | +command. |
| 15 | + |
| 16 | +This allows you to temporarily switch to another notebook easily: |
| 17 | + |
| 18 | +```shell |
| 19 | +$ notebook use work |
| 20 | + |
| 21 | +... change the working notebook to 'work' |
| 22 | + |
| 23 | +$ note add work project |
| 24 | + |
| 25 | +... notes adds a note called 'work_project' to the 'work' notebook |
| 26 | + |
| 27 | +$ notebook use |
| 28 | + |
| 29 | +... notes switches back to the DEFAULT notebook pointer (initially |
| 30 | +'notes') |
| 31 | + |
| 32 | +``` |
| 33 | + |
| 34 | + |
| 35 | +## Notebooks Commands |
| 36 | + |
| 37 | +The *notes init* command creates your first notebook called *notes*. It |
| 38 | +also creates two pointers called 'DEFAULT' and 'USE'. Initially they |
| 39 | +will point to the initial notebook *notes*. |
| 40 | + |
| 41 | +If you want to use multiple notebooks you should create as many as you |
| 42 | +need using the *notebook add* command (see below). |
| 43 | + |
| 44 | +You should choose which one will be your main notebook and use |
| 45 | +*notebook default* to point DEFAULT to this notebook. You can then set |
| 46 | +the USE pointer (using *notebook use* command) to move between the |
| 47 | +notebooks each time you want to use a different notebook. You can |
| 48 | +return to your DEFAULT notebook at any time by issuing the *notebook |
| 49 | +use* without any notebook name. |
| 50 | + |
| 51 | +Any note book names specified in either the command line OR when |
| 52 | +prompted (for rename and copy operations) will be scanned for spaces |
| 53 | +and then the spaces replaced with underscores. So if you enter |
| 54 | +*notebook add my new notebook* you will create 'my_new_notebook'. |
| 55 | + |
| 56 | + |
| 57 | +### Sub-command default |
| 58 | + |
| 59 | +This command is used to set the DEFAULT notebook. |
| 60 | + |
| 61 | +```shell |
| 62 | +$ notes default work notebook |
| 63 | +``` |
| 64 | + |
| 65 | +This sets the DEFAULT notebook to 'work_notebook/' |
| 66 | + |
| 67 | + |
| 68 | +### Sub-command use |
| 69 | + |
| 70 | +The 'USE' pointer points to the notebook currently in use. You can |
| 71 | +change this at any time by issuing the *notebook use* command: |
| 72 | + |
| 73 | +```shell |
| 74 | +$ notebook use work notebook |
| 75 | +``` |
| 76 | + |
| 77 | +This command sets the current notebook to 'work_notebook'. All *notes* |
| 78 | +commands will then operate on this notebook. |
| 79 | + |
| 80 | +To switch issue another *notebook use* command specifying the next |
| 81 | +notebook to use. |
| 82 | + |
| 83 | +If you omit the notebook then *notebook* will set the 'USE' notebook to |
| 84 | +whatever the 'DEFAULT' notebook is set to allowing you to quick go back |
| 85 | +and forth between your DEFAULT notebook and any number of current 'USE' |
| 86 | +notebooks. |
| 87 | + |
| 88 | + |
| 89 | +### Sub-command list | ls |
| 90 | + |
| 91 | +This will list all of the notebooks that you have created together with |
| 92 | +the initial notebook *notes* created by *notes init*. |
| 93 | + |
| 94 | + |
| 95 | +### Sub-command add | insert |
| 96 | + |
| 97 | +You can have as many notebooks as you wish. To add a notebook simply |
| 98 | +issue the command: |
| 99 | + |
| 100 | +```shell |
| 101 | +$ notes add work notebook |
| 102 | +``` |
| 103 | + |
| 104 | +This command will create a new notebook 'work_notebook'. The current |
| 105 | +notebook will remain unchanged and you will need to issue the command |
| 106 | +*notebook use work notebook* to switch to this notebook. |
| 107 | + |
| 108 | + |
| 109 | +### Sub-command rename | mv |
| 110 | + |
| 111 | +This sub-command is used to rename an existing notebook. |
| 112 | + |
| 113 | +```shell |
| 114 | +$ notebook rename original notebook name |
| 115 | +``` |
| 116 | + |
| 117 | +The notebook 'original_notebook_name.gpg' will be renamed. The user |
| 118 | +will be prompted to enter a new name for the notebook and the |
| 119 | +containing directory (relating to the notebook name) is renamed. |
| 120 | + |
| 121 | + |
| 122 | +### Sub-command copy | cp |
| 123 | + |
| 124 | +You may duplicate a notebook together with all the containing notes: |
| 125 | + |
| 126 | +```shell |
| 127 | +$ notebook copy original notebook |
| 128 | +``` |
| 129 | + |
| 130 | +This command will copy 'original_notebook.gpg' to a new notebook. The |
| 131 | +user will be prompted for a new notebook name. All notes within the |
| 132 | +original notebook will be copied to the new notebook without decrypting |
| 133 | +the notes first. |
| 134 | + |
| 135 | + |
| 136 | +### Sub-command delete | rm |
| 137 | + |
| 138 | +To delete a specific notebook: |
| 139 | + |
| 140 | +```shell |
| 141 | +$ notebook rm my work notes |
| 142 | +``` |
| 143 | + |
| 144 | +This command will delete the notebook 'my_work_notes'. |
| 145 | + |
0 commit comments