Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ Variables marked with * are required for running MD Notes properly, the others a
1. When set to `True` tag search only search with YMF.
2. When set to `False` tags will be searched the whole MD note.

* **Recursive Search** (`recursive_search`): Defines if the search should searching `path_to_notes` and it's subfolder or just the root folder.

* **Exact Match** (`exact_match`): Defines if the search should match the exact search term (`True`) or the string (`False`) in markdown notes.

**Note:** When exact match is set to `True` it is possible to enhance the search term with wildcards
Expand Down
10 changes: 8 additions & 2 deletions src/MyNotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ def __init__(self):
raise ModuleNotFoundError("Python version 3.7.0 or higher required!")
self.extension = self.__buildNotesExtension()
self.path = self.__buildNotesPath()
self.recursive_search = Tools.getEnvBool('recursive_search')
self.default_template = os.getenv('default_template')
self.template_tag = os.getenv('template_tag')
self.url_scheme = os.getenv('url_scheme')
Expand Down Expand Up @@ -380,8 +381,13 @@ def getFilesListSorted(self, reverse: bool = True) -> list:
err = 0
file_list = list()
try:
file_list = os.listdir(self.path)
# file_list = os.walk(self.path)
if self.recursive_search:
for root, _, files in os.walk(self.path):
for file in files:
file_list.append(os.path.join(root, file))
else:
file_list = os.listdir(self.path)

except OSError as e:
err = e.errno
pass
Expand Down