diff --git a/README.md b/README.md index 8710098..69fd1db 100644 --- a/README.md +++ b/README.md @@ -43,6 +43,7 @@ Stats: https://pepy.tech/project/pystyle - Make boxes ✔️ - Hide and Show Cursor ✔️ - System Functions ✔️ + - Clickable link ✔️
diff --git a/pystyle/__init__.py b/pystyle/__init__.py index 0e9f173..208caba 100644 --- a/pystyle/__init__.py +++ b/pystyle/__init__.py @@ -989,6 +989,24 @@ def Arrow(icon: str = 'a', size: int = 2, number: int = 2, direction = 'right') return _arrow +class Link: + """ + 1 functions: + CreateLink() | make clickable link + """ + + def CreateLink(uri: str, label=None) -> str: + if label is None: + label = uri + + parameters = "" + + # OSC 8 ; params ; URI ST OSC 8 ;; ST + escape_mask = "\033]8;{};{}\033\\{}\033]8;;\033\\" + + return escape_mask.format(parameters, uri, label) + + Box = Banner System.Init()