Skip to content

Commit

Permalink
simplenote: add tag for pinned notes
Browse files Browse the repository at this point in the history
  • Loading branch information
marph91 committed Aug 11, 2024
1 parent 540e4db commit 1c43ac5
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/formats/simplenote.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ def convert(self, file_or_folder: Path):
note_links.append(
imf.NoteLink(str(link), linked_note_id, link.text)
)

tags = note_simplenote.get("tags", [])
if note_simplenote.get("pinned"):
tags.append("simplenote-pinned")

note_joplin = imf.Note(
{
"title": title.strip(),
Expand All @@ -47,9 +52,7 @@ def convert(self, file_or_folder: Path):
"source_application": self.format,
},
# Tags don't have a separate id. Just use the name as id.
tags=[
imf.Tag({"title": tag}) for tag in note_simplenote.get("tags", [])
],
tags=[imf.Tag({"title": tag}) for tag in tags],
note_links=note_links,
original_id=note_simplenote["id"],
)
Expand Down

0 comments on commit 1c43ac5

Please sign in to comment.