Updates
This commit is contained in:
parent
de582a5dbe
commit
6db5f4f20f
@ -183,6 +183,22 @@ class JoplinExporter:
|
|||||||
|
|
||||||
self.clean_content_dir()
|
self.clean_content_dir()
|
||||||
|
|
||||||
|
def is_private(note) -> bool:
|
||||||
|
"""
|
||||||
|
Check whether a note is private.
|
||||||
|
|
||||||
|
This function checks a note's title and tags and returns whether it
|
||||||
|
should be considered private or whether it should be published.
|
||||||
|
"""
|
||||||
|
hidden_keywords = ["private", "wip", "draft"]
|
||||||
|
for keyword in hidden_keywords:
|
||||||
|
if contains_word(keyword, note.title) or keyword in note.tags:
|
||||||
|
print(
|
||||||
|
f"Note is unpublished, skipping: {folder_title} - {note.title}."
|
||||||
|
)
|
||||||
|
return True
|
||||||
|
return False
|
||||||
|
|
||||||
for folder_counter, folder in enumerate(folder_list, start=1):
|
for folder_counter, folder in enumerate(folder_list, start=1):
|
||||||
folder_id, folder_title = folder
|
folder_id, folder_title = folder
|
||||||
dir = self.content_dir / slugify(folder_title)
|
dir = self.content_dir / slugify(folder_title)
|
||||||
@ -190,12 +206,7 @@ class JoplinExporter:
|
|||||||
contents = []
|
contents = []
|
||||||
note_counter = 0
|
note_counter = 0
|
||||||
for note in sorted(self.notes[folder_id], key=lambda n: n.title):
|
for note in sorted(self.notes[folder_id], key=lambda n: n.title):
|
||||||
if (
|
if is_private(note):
|
||||||
contains_word("private", note.title)
|
|
||||||
or contains_word("wip", note.title)
|
|
||||||
or "wip" in note.tags
|
|
||||||
or "private" in note.tags
|
|
||||||
):
|
|
||||||
print(
|
print(
|
||||||
f"Note is unpublished, skipping: {folder_title} - {note.title}."
|
f"Note is unpublished, skipping: {folder_title} - {note.title}."
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user