From 52664dd96c52f017f554ef89fbf03730b4874172 Mon Sep 17 00:00:00 2001 From: Debanjum Singh Solanky Date: Tue, 3 Jan 2023 01:32:58 -0300 Subject: [PATCH] Allow recursive glob pattern (**) to add files to search index - Simplify configuring files to index For Obsidian/Org-Roam type systems with lots of small files in khoj.yml using `input-filter' --- src/processor/ledger/beancount_to_jsonl.py | 2 +- src/processor/markdown/markdown_to_jsonl.py | 2 +- src/processor/org_mode/org_to_jsonl.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/processor/ledger/beancount_to_jsonl.py b/src/processor/ledger/beancount_to_jsonl.py index 9f37df70..856dab57 100644 --- a/src/processor/ledger/beancount_to_jsonl.py +++ b/src/processor/ledger/beancount_to_jsonl.py @@ -77,7 +77,7 @@ class BeancountToJsonl(TextToJsonl): filtered_beancount_files = { filtered_file for beancount_file_filter in beancount_file_filters - for filtered_file in glob.glob(get_absolute_path(beancount_file_filter)) + for filtered_file in glob.glob(get_absolute_path(beancount_file_filter), recursive=True) } all_beancount_files = sorted(absolute_beancount_files | filtered_beancount_files) diff --git a/src/processor/markdown/markdown_to_jsonl.py b/src/processor/markdown/markdown_to_jsonl.py index 17482de5..82d860b8 100644 --- a/src/processor/markdown/markdown_to_jsonl.py +++ b/src/processor/markdown/markdown_to_jsonl.py @@ -75,7 +75,7 @@ class MarkdownToJsonl(TextToJsonl): filtered_markdown_files = { filtered_file for markdown_file_filter in markdown_file_filters - for filtered_file in glob.glob(get_absolute_path(markdown_file_filter)) + for filtered_file in glob.glob(get_absolute_path(markdown_file_filter), recursive=True) } all_markdown_files = sorted(absolute_markdown_files | filtered_markdown_files) diff --git a/src/processor/org_mode/org_to_jsonl.py b/src/processor/org_mode/org_to_jsonl.py index 313c9a3f..5ad68b77 100644 --- a/src/processor/org_mode/org_to_jsonl.py +++ b/src/processor/org_mode/org_to_jsonl.py @@ -83,7 +83,7 @@ class OrgToJsonl(TextToJsonl): filtered_org_files = { filtered_file for org_file_filter in org_file_filters - for filtered_file in glob.glob(get_absolute_path(org_file_filter)) + for filtered_file in glob.glob(get_absolute_path(org_file_filter), recursive=True) } all_org_files = sorted(absolute_org_files | filtered_org_files)