Incorporate feedback

This commit is contained in:
Stavros Korokithakis 2021-12-13 03:02:33 +02:00
parent f5af1ea569
commit 58420a7ed8
No known key found for this signature in database
GPG Key ID: 26EA345ECD4C2A63

View File

@ -304,6 +304,7 @@ class JoplinExporter:
with (self.content_dir / "SUMMARY.md").open("w") as outfile: with (self.content_dir / "SUMMARY.md").open("w") as outfile:
outfile.write("# Summary\n\n") outfile.write("# Summary\n\n")
# Special-case the introduction. # Special-case the introduction.
if introduction:
outfile.write(introduction.get_summary_line(0) + "\n") outfile.write(introduction.get_summary_line(0) + "\n")
outfile.write("\n".join(items)) outfile.write("\n".join(items))
@ -318,12 +319,12 @@ class JoplinExporter:
for folder in folder_list: for folder in folder_list:
contents = [] contents = []
dir = self.content_dir / folder.get_url() dir = self.content_dir / folder.get_url()
dir.mkdir(parents=True) dir.mkdir(parents=True, exist_ok=True)
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):
print(f"Exporting {folder.title} - {note.title}...") print(f"Exporting {folder.title} - {note.title}...")
contents.append((note.title, f"{note.get_url()}.html")) contents.append((note.title, f"{note.get_url()}.html"))
with (self.content_dir / (note.get_url() + ".md")).open( with (self.content_dir / (note.get_url() + ".md")).open(
mode="w" mode="w", encoding="utf-8"
) as outfile: ) as outfile:
outfile.write( outfile.write(
f"""# {note.title} f"""# {note.title}