From aa224afbdbb4d17ee7081a120307f742a7830bc1 Mon Sep 17 00:00:00 2001 From: Yuriy Date: Tue, 9 Jul 2024 01:34:31 -0400 Subject: [PATCH] loop through all folders and find notes that have a -blog- tag --- README.md | 8 ++++++++ book.toml | 2 +- joplinexport | 8 +++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index ab95647..f7ec133 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,7 @@ +# Joplin to mdbook Website Generator +Export your joplin notes into a [mdbook](https://rust-lang.github.io/mdBook/index.html) compatible format for easy website creation. + + @@ -9,6 +13,10 @@ - Instead of checking if a notebook/note is tagged with "private", instead checks if the notebook/note is tagged with "blog" + + + + Stavros' notes ============== diff --git a/book.toml b/book.toml index 13b5a22..26a040e 100644 --- a/book.toml +++ b/book.toml @@ -8,6 +8,6 @@ title = "Yuriy's Notes" [output.html] curly-quotes = true no-section-label = true -git-repository-url = "https://zinchuk.xyz" +git-repository-url = "https://git.zinchuk.xyz/yuriy/joplin-mdbooks-website" git-repository-icon = "fa-gitlab" additional-css = ["static/custom.css"] diff --git a/joplinexport b/joplinexport index 9b834a9..7e96208 100755 --- a/joplinexport +++ b/joplinexport @@ -192,7 +192,7 @@ class JoplinExporter: # Add the resource to the set of used resources, so we can only copy # the resources that are used. self.used_resources.add(resource_id) - return "content/resources/" + resource_id + resource.derived_ext + return "resources/" + resource_id + resource.derived_ext def copy_resources(self): """Copy all the used resources to the output directory.""" @@ -218,7 +218,9 @@ class JoplinExporter: } self.folders = { - id: folder for id, folder in self.folders.items() if folder.is_for_blog() + # id: folder for id, folder in self.folders.items() if folder.is_for_blog() + # For the moment, instead of checking if Folder is for blog, check all folders + id: folder for id, folder in self.folders.items() if True } # Get the tags by ID. @@ -255,7 +257,7 @@ class JoplinExporter: datetime.fromtimestamp(updated_time / 1000), tags=note_tags[id], ) - if note.is_for_blog(): + if not note.is_for_blog(): continue self.notes[note.folder.id].append(note)