Skip to content

Commit ecf1b00

Browse files
authored
Merge PR #9 from aviaryan/v2.1 [v2.1 release]
Make note formats configurable
2 parents ece5575 + caeb0a4 commit ecf1b00

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

DOCUMENTATION.markdown

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
:four: [Encrypting your notes](#en)
88
:five: [Note taking features](#nt)
99
:six: [Changing Notebook password](#cp)
10-
:seven: [Customizing which folders are encrypted](#custen)
10+
:seven: [Customizing which folders and files are encrypted](#custen)
1111
:eight: [Automatic git backups](#git)
1212
:nine: [FAQ](#faq)
1313

@@ -33,7 +33,7 @@ Then you extract the zip file and put the contents in a cloud synced or local fo
3333

3434
Done! You can now create any number of notes in that folder. For hierarchy, you can use folders and sub-folders.
3535

36-
Notes can be `txt` or `md` files and they will be encrypted with your password.
36+
Notes [by default](#custen), can be `txt` or `md` files and they will be encrypted with your password.
3737

3838
By default, only `diary` folder (if it exists) is encrypted. You can learn more about changing this setting [here](#custen).
3939

@@ -108,7 +108,7 @@ Then start `manager.py` again to re-encrypt your notes. This time you will be as
108108

109109

110110
<a name="custen"></a>
111-
## :seven: Customizing which folders are encrypted
111+
## :seven: Customizing which folders and files are encrypted
112112
:point_up_2: [[back to top](#docs)]
113113

114114
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
131131
}
132132
```
133133

134+
----
135+
136+
You can also change which files are to be considered as notes, and thus encrypted. For that, change the `note_extensions` setting.
137+
138+
```json
139+
{
140+
"note_extensions": [
141+
"txt",
142+
"md",
143+
"rst"
144+
]
145+
}
146+
```
147+
134148
**NOTE** - You should edit `settings.json` file only when the notebook is in a decrypted state. Changing it when notebook is encrypted can cause
135149
unintentional side-effects. `"is_encrypted": false` will be present in `settings.json` when notebook is decrypted.
136150

README.markdown

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VSCode Notebook :memo:
33
</h1>
44

5-
**v2.0**
5+
**v2.1**
66

77
VSCode Notebook is an attempt to use VSCode as a complete note taking application.
88
This is a VSCode port of the popular [SublimeNotebook](https://github.com/aviaryan/SublimeNotebook) project.

vscode_notebook/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
SETTINGS_PATH = 'vscode_notebook/settings.json'
2-
VERSION = 2.0
2+
VERSION = 2.1

vscode_notebook/cryptlib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ def decode(key, enc):
8585
def get_file_list():
8686
listFiles = []
8787
sts = Settings()
88+
exts = tuple(sts.json['note_extensions'])
8889
# loop through directory
8990
for dirpath, dnames, fnames in os.walk('./'):
9091
dirname = dirpath.replace('./', '', 1)
@@ -95,7 +96,7 @@ def get_file_list():
9596
if not sts.check_folder_private(dirname):
9697
continue
9798
for f in fnames:
98-
if not (f.endswith('.txt') or f.endswith('.md')):
99+
if not f.endswith(exts):
99100
continue
100101
listFiles.append(os.path.join(dirpath, f))
101102
# print(listFiles)

vscode_notebook/settings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class Settings:
1818
'version': VERSION,
1919
'do_git_backup': False,
2020
'git_push_interval_minutes': 1440,
21-
'last_git_push': 0
21+
'last_git_push': 0,
22+
'note_extensions': ['txt', 'md']
2223
}
2324
json = default_json.copy()
2425
where_star = 'public'

0 commit comments

Comments
 (0)