Skip to main content

md2tgmd is a Markdown to Telegram-specific-markdown converter.

Project description

md2tgmd

md2tgmd is a Markdown to Telegram-specific-markdown converter.

Install

pip install md2tgmd

Usage

from md2tgmd import escape

text = '''
# title

**bold**
```
# comment
print(qwer) # ferfe
ni1
```
# bn

# b

# Header
## Subheader

[1.0.0](http://version.com)
![1.0.0](http://version.com)

- item 1 -
    - item 1 -
    - item 1 -
* item 2 #
* item 3 ~

1. item 1
2. item 2

sudo apt install mesa-utils # 安装

```python

# comment
print("1.1\n")_
\subsubsection{1.1}
```
\subsubsection{1.1}

And simple text `with-ten`  `with+ten` + some - **symbols**. # `with-ten`里面的`-`不会被转义


```
print("Hello, World!") -
```

Cxy = abs (Pxy)**2/ (Pxx*Pyy)

`a`a-b-c`n`

`-a----++++`++a-b-c`-n-`
`[^``]*`a``b-c``d``
# pattern = r"`[^`]*`-([^`-]*)``
w`-a----`ccccc`-n-`bbbb``a
'''

print(escape(text))


'''
▎*title*

*bold*
```
\# comment
print\(qwer\) \# ferfe
ni1
```
▎*bn*

▎*b*

▎*Header*
▎*Subheader*

[1\.0\.0](http://version\.com)
[1\.0\.0](http://version\.com)


• item 1 \-

    • item 1 \-

    • item 1 \-

• item 2 \#

• item 3 \~


1\. item 1

2\. item 2

sudo apt install mesa\-utils \# 安装

```python

\# comment
print\("1\.1\\n"\)\_
\\subsubsection\{1\.1\}
```
\\subsubsection\{1\.1\}

And simple text `with-ten`  `with+ten` \+ some \- *symbols*\. \# `with-ten`里面的`-`不会被转义


```
print\("Hello, World\!"\) -
```

Cxy \= abs \(Pxy\)\*\*2/ \(Pxx\*Pyy\)

`a`a\-b\-c`n`

`-a----++++`\+\+a\-b\-c`-n-`
`\[^\`\`\]\*`a\`\`b\-c\`\`d\`\`
▎*pattern*
w`-a----`ccccc`-n-`bbbb\`\`a
'''

Reference

https://github.com/skoropadas/telegramify-markdown

License

This project is licensed under GPLv3, which means you are free to copy, distribute, and modify the software, as long as all modifications and derivative works are also released under the same license.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

md2tgmd-0.2.2.tar.gz (16.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

md2tgmd-0.2.2-py3-none-any.whl (16.6 kB view details)

Uploaded Python 3

File details

Details for the file md2tgmd-0.2.2.tar.gz.

File metadata

  • Download URL: md2tgmd-0.2.2.tar.gz
  • Upload date:
  • Size: 16.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for md2tgmd-0.2.2.tar.gz
Algorithm Hash digest
SHA256 1fc03da0705a8ff56a0c0bac2ce7fb3582b8c2243a1d1bf2c7e917f3f6621d5c
MD5 2801a9927c64a0cc9c5c46899cb44f7c
BLAKE2b-256 525b63a39a570ca87d4f292b78739335a0a976c4b299e1083a54d682188024a5

See more details on using hashes here.

File details

Details for the file md2tgmd-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: md2tgmd-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 16.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.0 CPython/3.12.3

File hashes

Hashes for md2tgmd-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3db721ac09928d9333a76e35e68df9613d5d1a65b8837122caffcbe1c1b98aff
MD5 8e4c0dc2861336d8a79d94fa870c2537
BLAKE2b-256 24a89d638c5c360f61105f9a08359371d5121156d1c10b111a2321aa30f90646

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page