diff --git a/DOCUMENTATION.markdown b/DOCUMENTATION.markdown index 451239e..c7a5264 100644 --- a/DOCUMENTATION.markdown +++ b/DOCUMENTATION.markdown @@ -7,7 +7,7 @@ :four: [Encrypting your notes](#en) :five: [Note taking features](#nt) :six: [Changing Notebook password](#cp) -:seven: [Customizing which folders are encrypted](#custen) +:seven: [Customizing which folders and files are encrypted](#custen) :eight: [Automatic git backups](#git) :nine: [FAQ](#faq) @@ -33,7 +33,7 @@ Then you extract the zip file and put the contents in a cloud synced or local fo 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. +Notes [by default](#custen), can be `txt` or `md` files and they will be encrypted with your password. By default, only `diary` folder (if it exists) is encrypted. You can learn more about changing this setting [here](#custen). @@ -108,7 +108,7 @@ Then start `manager.py` again to re-encrypt your notes. This time you will be as -## :seven: Customizing which folders are encrypted +## :seven: Customizing which folders and files are encrypted :point_up_2: [[back to top](#docs)] To customize which folders are encrypted, use the `settings.json` file in `vscode_notebook/` directory. @@ -131,6 +131,20 @@ You can also use the "*" symbol to select all folders. For example, in the follo } ``` +---- + +You can also change which files are to be considered as notes, and thus encrypted. For that, change the `note_extensions` setting. + +```json +{ + "note_extensions": [ + "txt", + "md", + "rst" + ] +} +``` + **NOTE** - You should edit `settings.json` file only when the notebook is in a decrypted state. Changing it when notebook is encrypted can cause unintentional side-effects. `"is_encrypted": false` will be present in `settings.json` when notebook is decrypted. diff --git a/README.markdown b/README.markdown index 0d7f2c7..9436321 100644 --- a/README.markdown +++ b/README.markdown @@ -2,7 +2,7 @@ VSCode Notebook :memo: -**v2.0** +**v2.1** VSCode Notebook is an attempt to use VSCode as a complete note taking application. This is a VSCode port of the popular [SublimeNotebook](https://github.com/aviaryan/SublimeNotebook) project. diff --git a/vscode_notebook/__init__.py b/vscode_notebook/__init__.py index ac9d577..2353ea0 100644 --- a/vscode_notebook/__init__.py +++ b/vscode_notebook/__init__.py @@ -1,2 +1,2 @@ SETTINGS_PATH = 'vscode_notebook/settings.json' -VERSION = 2.0 +VERSION = 2.1 diff --git a/vscode_notebook/cryptlib.py b/vscode_notebook/cryptlib.py index aac5d2d..9acd7cf 100644 --- a/vscode_notebook/cryptlib.py +++ b/vscode_notebook/cryptlib.py @@ -85,6 +85,7 @@ def decode(key, enc): def get_file_list(): listFiles = [] sts = Settings() + exts = tuple(sts.json['note_extensions']) # loop through directory for dirpath, dnames, fnames in os.walk('./'): dirname = dirpath.replace('./', '', 1) @@ -95,7 +96,7 @@ def get_file_list(): if not sts.check_folder_private(dirname): continue for f in fnames: - if not (f.endswith('.txt') or f.endswith('.md')): + if not f.endswith(exts): continue listFiles.append(os.path.join(dirpath, f)) # print(listFiles) diff --git a/vscode_notebook/settings.py b/vscode_notebook/settings.py index 772e9eb..69339a8 100644 --- a/vscode_notebook/settings.py +++ b/vscode_notebook/settings.py @@ -18,7 +18,8 @@ class Settings: 'version': VERSION, 'do_git_backup': False, 'git_push_interval_minutes': 1440, - 'last_git_push': 0 + 'last_git_push': 0, + 'note_extensions': ['txt', 'md'] } json = default_json.copy() where_star = 'public'