Skip to content

Commit

Permalink
Merge PR #9 from aviaryan/v2.1 [v2.1 release]
Browse files Browse the repository at this point in the history
Make note formats configurable
aviaryan authored May 2, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
2 parents ece5575 + caeb0a4 commit ecf1b00
Showing 5 changed files with 23 additions and 7 deletions.
20 changes: 17 additions & 3 deletions DOCUMENTATION.markdown
Original file line number Diff line number Diff line change
@@ -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


<a name="custen"></a>
## :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.

2 changes: 1 addition & 1 deletion README.markdown
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@
VSCode Notebook :memo:
</h1>

**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.
2 changes: 1 addition & 1 deletion vscode_notebook/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
SETTINGS_PATH = 'vscode_notebook/settings.json'
VERSION = 2.0
VERSION = 2.1
3 changes: 2 additions & 1 deletion vscode_notebook/cryptlib.py
Original file line number Diff line number Diff line change
@@ -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)
3 changes: 2 additions & 1 deletion vscode_notebook/settings.py
Original file line number Diff line number Diff line change
@@ -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'

0 comments on commit ecf1b00

Please sign in to comment.