Skip to content

Commit

Permalink
Add RichMarkup mixin
Browse files Browse the repository at this point in the history
  • Loading branch information
glensc committed Jan 14, 2024
1 parent 4f7b95a commit 7690a29
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions plextraktsync/mixin/RichMarkup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from rich.markup import escape


class RichMarkup:
def markup_link(self, link: str, title: str):
return f"[link={link}]{self.markup_title(title)}[/]"

@staticmethod
def markup_title(title: str):
return f"[green]{escape(str(title))}[/]"

0 comments on commit 7690a29

Please sign in to comment.