From 65dd7c6675a6e9ffa9418fe57aacdfe524598ab3 Mon Sep 17 00:00:00 2001 From: Stavros Korokithakis Date: Thu, 7 Jan 2021 22:51:04 +0200 Subject: [PATCH] Add "WIP" to the exclusion list --- joplinexport.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/joplinexport.py b/joplinexport.py index d271177..9dd669e 100755 --- a/joplinexport.py +++ b/joplinexport.py @@ -127,13 +127,18 @@ class JoplinExporter: dir = self.content_dir / slugify(folder_title) dir.mkdir(parents=True) contents = [] - for note_counter, note in enumerate( - sorted(self.notes[folder_id], key=lambda n: n.title) - ): - if contains_word("private", note.title): - print(f"Note is private, skipping: {folder_title} - {note.title}.") + note_counter = 0 + for note in sorted(self.notes[folder_id], key=lambda n: n.title): + if contains_word("private", note.title) or contains_word( + "wip", note.title + ): + print( + f"Note is unpublished, skipping: {folder_title} - {note.title}." + ) continue + print(f"Exporting {folder_title} - {note.title}...") + note_counter += 1 contents.append((note.title, note.get_url())) with (self.content_dir / (note.get_url() + ".md")).open( mode="w"