Skip to content

Commit b1234df

Browse files
authored
Merge pull request #21 from aviaryan/v2.1
v2.1
2 parents 96433c6 + 91219bb commit b1234df

File tree

5 files changed

+23
-7
lines changed

5 files changed

+23
-7
lines changed

README.markdown

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

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

77
Sublime Notebook is an attempt to use Sublime Text as a complete note taking application.
88

sublime_notebook/__init__.py

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

sublime_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)

sublime_notebook/docs/README.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 SublimeNotebook 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: [Setting up better Markdown highlighting in Sublime Text](#mdext)
1313
:keycap_ten: [FAQ](#faq)
@@ -34,7 +34,7 @@ Then you extract the zip file and put the contents in a cloud synced or local fo
3434

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

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

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

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

110110

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

115115
To customize which folders are encrypted, use the `settings.json` file in `sublime_notebook/` directory.
@@ -132,6 +132,20 @@ You can also use the "*" symbol to select all folders. For example, in the follo
132132
}
133133
```
134134

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

sublime_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)