|
| 1 | +# Documentation |
| 2 | + |
| 3 | +## Table of Contents |
| 4 | + |
| 5 | +* [Requirements](#rq) |
| 6 | +* [Getting Started](#gs) |
| 7 | +* [Accessing your notes](#ac) |
| 8 | +* [Encrypting your notes](#en) |
| 9 | +* [Note taking features](#nt) |
| 10 | +* [Changing SublimeNotebook password](#cp) |
| 11 | +* [Customizing which folders are encrypted](#custen) |
| 12 | +* [Automatic git backups](#git) |
| 13 | +* [Setting up better Markdown highlighting in Sublime Text](#mdext) |
| 14 | +* [FAQ](#faq) |
| 15 | + |
| 16 | + |
| 17 | +<a name="rq"></a> |
| 18 | +## Requirements |
| 19 | + |
| 20 | +The requirements for using this tool are as follows. Make sure to have them installed before proceeding to the next section. |
| 21 | + |
| 22 | +* Sublime Text |
| 23 | +* Python 3 |
| 24 | +* [Optional] A cloud sync application setup (Dropbox, Google Drive, OneDrive etc) |
| 25 | + |
| 26 | + |
| 27 | +<a name="gs"></a> |
| 28 | +## Getting started |
| 29 | + |
| 30 | +The first step is downloading the release from https://github.com/aviaryan/SublimeNotebook/releases/latest. |
| 31 | + |
| 32 | +Then you extract the zip file and put the contents in a cloud synced or local folder of your choice. |
| 33 | + |
| 34 | +Done! You can now create any number of notes in that folder. For hierarchy, you can use folders and sub-folders. Notes can be txt or md files and they will be encrypted with your password. |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | +<a name="ac"></a> |
| 40 | +## Accessing your notes |
| 41 | + |
| 42 | +To access your notes, we will use the Projects feature of Sublime Text. |
| 43 | + |
| 44 | +Open Sublime Text and click on "Open Project" in the Project menu. |
| 45 | + |
| 46 | +Browse for the `notebook.sublime-project` file in the folder you downloaded and open it. Now open the Sidebar (View -> Sidebar). You will see all your notes presented there with the hierarchy. |
| 47 | + |
| 48 | +Whenever you want to open your Sublime Notebook, you can use the switch project shortcut (Cmd-Ctrl-P or Ctrl-Alt-P) and select `notebook.sublime-project` to switch to the Notebook project. |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | +<a name="en"></a> |
| 54 | +## Encrypting your notes |
| 55 | + |
| 56 | +To encrypt or decrypt notes, you use the `manager.py` file located in the notebook root. It runs in Python 3 and requires no additional dependencies. |
| 57 | +I recommend changing the first line of the file to point to your interpreter. |
| 58 | + |
| 59 | +```python |
| 60 | +#!/Users/aviaryan/miniconda3/bin/python |
| 61 | +``` |
| 62 | + |
| 63 | +To run `manager.py`, you can use the shortcut Ctrl-B (Cmd-B on OSX) to launch a terminal window in the `manager.py`'s directory. |
| 64 | + |
| 65 | +Then use `python manager.py` or `./manager.py` to run the script. |
| 66 | + |
| 67 | +When it runs for the first time, it will find the notes and ask you a password for encryption. |
| 68 | +After getting the password, it will encrypt all non-public notes using that password. |
| 69 | +In the subsequent runs, `manager.py` will work as an un-locker where it will ask password to decrypt the notes and then pause its execution. |
| 70 | +Now you can view and edit your notes and then later on encrypt them again by entering 'e' in the prompt. |
| 71 | + |
| 72 | + |
| 73 | + |
| 74 | + |
| 75 | +<a name="nt"></a> |
| 76 | +## Note taking features |
| 77 | + |
| 78 | +To search through all your notes, use the Sublime Text’s search in project feature (Ctrl-Shift-F or Cmd-Shift-F). |
| 79 | + |
| 80 | +You can use the Sublime Text sidebar to view your notes in a hierarchical fashion. |
| 81 | + |
| 82 | +Store the folder in Dropbox, Google Drive or Box to have it on all your computers (as well as secure a backup). |
| 83 | + |
| 84 | +The Python 3 script uses no extra dependencies so you can run the script out-of-the-box on any system that has Python installed (popular Linux distros and Macs for example have it by default). |
| 85 | + |
| 86 | + |
| 87 | +<a name="cp"></a> |
| 88 | +## Changing SublimeNotebook password |
| 89 | + |
| 90 | +To change password of your Sublime Notebook, decrypt your existing notes using old `manager.py`, then exit the script in decrypted state (using "d"). |
| 91 | + |
| 92 | +Then start `manager.py` again to re-encrypt your notes. This time you will be asked for a new password to encrypt your notes. |
| 93 | + |
| 94 | + |
| 95 | +<a name="custen"></a> |
| 96 | +## Customizing which folders are encrypted |
| 97 | + |
| 98 | +To customize which folders are encrypted, use the `settings.json` file in `sublime_notebook/` directory. |
| 99 | + |
| 100 | +1. "private_folders" are the one that are encrypted. |
| 101 | +2. "public_folders" are not encrypted. |
| 102 | + |
| 103 | +A folder by default is public if it is not included in either of them. |
| 104 | + |
| 105 | +You can also use the "*" symbol to select all folders. For example, in the following `settings.json` file, all folders except "web_links" are private(encrypted). |
| 106 | + |
| 107 | +```json |
| 108 | +{ |
| 109 | + "private_folders": [ |
| 110 | + "*" |
| 111 | + ], |
| 112 | + "public_folders": [ |
| 113 | + "web_links" |
| 114 | + ] |
| 115 | +} |
| 116 | +``` |
| 117 | + |
| 118 | +**NOTE** - You should edit `settings.json` file only when the notebook is in a decrypted state. Changing it when notebook is encrypted can cause |
| 119 | +unintentional side-effects. `"is_encrypted": false` will be present in `settings.json` when notebook is decrypted. |
| 120 | + |
| 121 | + |
| 122 | +<a name="git"></a> |
| 123 | +## Automatic git backups |
| 124 | + |
| 125 | +> This feature comes in handy for those who don't trust cloud data storage providers. You can even use this as a second backup for your data. I personally have auto git backups set up so that my notes are stored on both Dropbox and GitHub. |
| 126 | +
|
| 127 | +To enable git backups, enable the feature from `sublime_notebook/settings.json`. |
| 128 | + |
| 129 | +```json |
| 130 | +{ |
| 131 | + "do_git_backup": true, |
| 132 | +} |
| 133 | +``` |
| 134 | + |
| 135 | +Once this setting is enabled, you will have to make your notebook a git repository and set `notebookbackup` branch to the git remote you want to backup to. |
| 136 | +Start with an empty remote repository to avoid any conflicts. |
| 137 | + |
| 138 | +```sh |
| 139 | +# pwd is the directory with manager.py and sublime_notebook/ folder. |
| 140 | +$ git init |
| 141 | +$ git remote add notebookbackup <GIT_REMOTE_URL> |
| 142 | +# ^ ssh git url preferred |
| 143 | +``` |
| 144 | + |
| 145 | +The git backup will run when you re-encrypt after decrypting the notebook. |
| 146 | + |
| 147 | + |
| 148 | + |
| 149 | +To change how frequently git backup happens, change the `git_push_interval_minutes` value in `settings.json`. |
| 150 | + |
| 151 | +```js |
| 152 | +{ |
| 153 | + "git_push_interval_minutes": 1440, |
| 154 | +} |
| 155 | +``` |
| 156 | + |
| 157 | +1440 minutes means 24 hours i.e. 1 day. Set it to `0` to enable instant backups. |
| 158 | + |
| 159 | + |
| 160 | +<a name="mdext"></a> |
| 161 | +## Setting up better Markdown highlighting in Sublime Text |
| 162 | + |
| 163 | +* Install the packages from here. |
| 164 | + |
| 165 | + * [Sublime Markdown Extended](https://github.com/jonschlinkert/sublime-markdown-extended) |
| 166 | + * [Sublime Monokai Extended](https://github.com/jonschlinkert/sublime-monokai-extended) - companion to the first package. |
| 167 | + |
| 168 | +* Make Sublime Markdown Extended as default language for markdown. |
| 169 | + |
| 170 | +> Navigate through the following menus in Sublime Text: View -> Syntax -> Open all with current extension as... -> Markdown Extended |
| 171 | +
|
| 172 | +* Make Sublime Monokai Extended default theme for Markdown extended. Open `Settings - Syntax Specific` from preferences and update the file as follows. |
| 173 | + |
| 174 | +```js |
| 175 | +{ |
| 176 | + "color_scheme": "Packages/Monokai Extended/Monokai Extended.tmTheme", |
| 177 | + "extensions": |
| 178 | + [ |
| 179 | + "md" |
| 180 | + ] |
| 181 | +} |
| 182 | +``` |
| 183 | + |
| 184 | + |
| 185 | +<a name="faq"></a> |
| 186 | +## FAQ |
| 187 | + |
| 188 | +Only *.txt and *.md files are detected as notes. |
| 189 | + |
| 190 | +You don't need to be in decrypted state to create a new note. Even when in encrypted state, you can create a note. |
| 191 | +When manager.py starts decrypting the notes, this new file will be ignored and will be encrypted when it's time to encrypt. |
0 commit comments