This script converts Markdown-formatted text into a Telegram-compatible format. It automatically transforms various Markdown formatting elements, such as headers, bold, italic, strikethrough, spoilers, underline, links, and inline code, into their corresponding Telegram formatting tags. The script also adds emojis before different header levels and inserts empty lines between paragraphs to improve readability.
This tool is particularly useful for those who frequently work with Markdown documentation and want to quickly share it on Telegram while preserving most of the original formatting. Instead of manually altering the syntax for each formatting element, users can simply copy their Markdown text, run this script, and have the formatted version ready to paste directly into a Telegram chat, saving time and effort.
Type of change
[Х] New script command
Dependencies / Requirements
The script relies on the following built-in Python libraries for its functionality on macOS:
re: This library is used for regular expressions, which are essential for searching and replacing Markdown formatting elements with their Telegram counterparts.
subprocess: This library is used to interact with the macOS clipboard through the pbpaste and pbcopy command-line utilities. It allows the script to read Markdown text from the clipboard and write the converted text back to the clipboard.
No additional third-party libraries are required, as the script utilizes the built-in re and subprocess libraries, making it easy to set up and use on macOS systems with Python installed.
Description
This script converts Markdown-formatted text into a Telegram-compatible format. It automatically transforms various Markdown formatting elements, such as headers, bold, italic, strikethrough, spoilers, underline, links, and inline code, into their corresponding Telegram formatting tags. The script also adds emojis before different header levels and inserts empty lines between paragraphs to improve readability.
This tool is particularly useful for those who frequently work with Markdown documentation and want to quickly share it on Telegram while preserving most of the original formatting. Instead of manually altering the syntax for each formatting element, users can simply copy their Markdown text, run this script, and have the formatted version ready to paste directly into a Telegram chat, saving time and effort.
Type of change
Dependencies / Requirements
The script relies on the following built-in Python libraries for its functionality on macOS:
re
: This library is used for regular expressions, which are essential for searching and replacing Markdown formatting elements with their Telegram counterparts.subprocess
: This library is used to interact with the macOS clipboard through thepbpaste
andpbcopy
command-line utilities. It allows the script to read Markdown text from the clipboard and write the converted text back to the clipboard.No additional third-party libraries are required, as the script utilizes the built-in
re
andsubprocess
libraries, making it easy to set up and use on macOS systems with Python installed.Checklist