From 751d050c8f000b97d8d70a9059c970067686b6c2 Mon Sep 17 00:00:00 2001 From: Yuriy Date: Wed, 17 Jul 2024 00:17:00 -0400 Subject: [PATCH] added resume note beneath Welcome --- joplinexport | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/joplinexport b/joplinexport index 212e36e..f97ef84 100755 --- a/joplinexport +++ b/joplinexport @@ -50,6 +50,8 @@ class Folder: return slugify(self.title) def get_summary_line(self, level: int) -> str: + print(f"{self.title}'s level is: {level}") + # level = 1 """Get the appropriate summary file line for this folder.""" return ( (" " * (level - 1)) @@ -269,7 +271,6 @@ class JoplinExporter: """Write the SUMMARY.md that mdBook needs.""" # We construct a note tree by adding each note into its parent. note_tree: Dict[str, List[Union[Note, Folder]]] = defaultdict(list) - # The note tree is a list of notes with their parents: # [ # [parent1, parent2, note1] @@ -278,12 +279,16 @@ class JoplinExporter: # Then, we sort these by alphabetical order, and we're done. note_tree = [] introduction: Optional[Note] = None # The "introduction" note. + resume: Optional[Note] = None # The "resume" note. folders: List[Folder] = list for note_list in self.notes.values(): for note in note_list: if note.title == "Welcome": introduction = note continue + if note.title == "Resume": + resume = note + continue note_item = [note] item: Union[Folder, Note] = note while True: @@ -330,6 +335,8 @@ class JoplinExporter: # Special-case the introduction. if introduction: outfile.write(introduction.get_summary_line(0) + "\n") + if resume: + outfile.write(resume.get_summary_line(0) + "\n") print("\n".join(items)) outfile.write("\n".join(items))