md2tgmd


Namemd2tgmd JSON
Version 0.3.9 PyPI version JSON
download
home_pageNone
Summarymd2tgmd is a Markdown to Telegram-specific-markdown converter.
upload_time2024-11-14 22:12:07
maintainerNone
docs_urlNone
authorNone
requires_pythonNone
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # md2tgmd

[English](README.md) | [Chinese](README_CN.md)

md2tgmd is a Markdown to [Telegram-specific-markdown](https://core.telegram.org/bots/api#formatting-options) converter.

## Feature

- Supports most of the specific Markdown syntax for Telegram, including: headings, bold, italic, strikethrough, code blocks, links, and quotes.
- Support the conversion of LaTeX formulas in Markdown to Unicode characters to improve the readability of mathematical formulas in Telegram.
- Support syntax highlighting for code blocks in Markdown.

## Install

```bash
pip install md2tgmd
```

## Usage

~~~python
From md2tgmd import escape

text = '''
# Title

\[ \\varphi(35) = 35 \\left(1 - \\frac{1}{5}\\right) \\left(1 - \\frac{1}{7}\\right) \]

**Bold**
```
# Comment
print(qwer) # ferfe
ni1
```
# bn

# b

# Title
## Subtitle

[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 # Install

```python

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

And simple text `with-ten`  `with+ten` + some - **symbols**. # `-` inside `with-ten` will not be escaped


```
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*

ϕ(35) = 35(1 - ⅕)(1 - 1/7)

*Bold*
```
\# Comment
print\(qwer\) \# ferfe
ni1
```
▎*bn*

▎*b*

▎*Title*
▎*Subtitle*

[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 \# Install

```python

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

And simple text `with-ten`  `with+ten` \+ some \- *symbols*\. \# `-` inside `with-ten` will not be escaped


```
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.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "md2tgmd",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/08/29/e9becd25439aa65ce03b3442c53da4a24b8270a7311d4d5e4878109c8cb0/md2tgmd-0.3.9.tar.gz",
    "platform": null,
    "description": "# md2tgmd\n\n[English](README.md) | [Chinese](README_CN.md)\n\nmd2tgmd is a Markdown to [Telegram-specific-markdown](https://core.telegram.org/bots/api#formatting-options) converter.\n\n## Feature\n\n- Supports most of the specific Markdown syntax for Telegram, including: headings, bold, italic, strikethrough, code blocks, links, and quotes.\n- Support the conversion of LaTeX formulas in Markdown to Unicode characters to improve the readability of mathematical formulas in Telegram.\n- Support syntax highlighting for code blocks in Markdown.\n\n## Install\n\n```bash\npip install md2tgmd\n```\n\n## Usage\n\n~~~python\nFrom md2tgmd import escape\n\ntext = '''\n# Title\n\n\\[ \\\\varphi(35) = 35 \\\\left(1 - \\\\frac{1}{5}\\\\right) \\\\left(1 - \\\\frac{1}{7}\\\\right) \\]\n\n**Bold**\n```\n# Comment\nprint(qwer) # ferfe\nni1\n```\n# bn\n\n# b\n\n# Title\n## Subtitle\n\n[1.0.0](http://version.com)\n![1.0.0](http://version.com)\n\n- Item 1 -\n    - Item 1 -\n    - Item 1 -\n* Item 2 #\n* Item 3 ~\n\n1. Item 1\n2. Item 2\n\nsudo apt install mesa-utils # Install\n\n```python\n\n# Comment\nprint(\"1.1\\n\")_\n\\subsubsection{1.1}\n```\n\\subsubsection{1.1}\n\nAnd simple text `with-ten`  `with+ten` + some - **symbols**. # `-` inside `with-ten` will not be escaped\n\n\n```\nprint(\"Hello, World!\") -\n```\n\nCxy = abs (Pxy)**2/ (Pxx*Pyy)\n\n`a`a-b-c`n`\n\n`-a----++++`++a-b-c`-n-`\n`[^``]*`a``b-c``d``\n# pattern = r\"`[^`]*`-([^`-]*)``\nw`-a----`ccccc`-n-`bbbb``a\n'''\n\nprint(escape(text))\n\n\n'''\n\u258e*Title*\n\n\u03d5(35) = 35(1 - \u2155)(1 - 1/7)\n\n*Bold*\n```\n\\# Comment\nprint\\(qwer\\) \\# ferfe\nni1\n```\n\u258e*bn*\n\n\u258e*b*\n\n\u258e*Title*\n\u258e*Subtitle*\n\n[1\\.0\\.0](http://version\\.com)\n[1\\.0\\.0](http://version\\.com)\n\n\n\u2022 Item 1 \\-\n\n    \u2022 Item 1 \\-\n\n    \u2022 Item 1 \\-\n\n\u2022 Item 2 \\#\n\n\u2022 Item 3 \\~\n\n\n1\\. Item 1\n\n2\\. Item 2\n\nsudo apt install mesa\\-utils \\# Install\n\n```python\n\n\\# Comment\nprint\\(\"1\\.1\\\\n\"\\)\\_\n\\\\subsubsection\\{1\\.1\\}\n```\n\\\\subsubsection\\{1\\.1\\}\n\nAnd simple text `with-ten`  `with+ten` \\+ some \\- *symbols*\\. \\# `-` inside `with-ten` will not be escaped\n\n\n```\nprint\\(\"Hello, World\\!\"\\) -\n```\n\nCxy \\= abs \\(Pxy\\)\\*\\*2/ \\(Pxx\\*Pyy\\)\n\n`a`a\\-b\\-c`n`\n\n`-a----++++`\\+\\+a\\-b\\-c`-n-`\n`\\[^\\`\\`\\]\\*`a\\`\\`b\\-c\\`\\`d\\`\\`\n\u258e*pattern*\nw`-a----`ccccc`-n-`bbbb\\`\\`a\n'''\n~~~\n\n## Reference\n\nhttps://github.com/skoropadas/telegramify-markdown\n\n\n## License\n\nThis 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.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "md2tgmd is a Markdown to Telegram-specific-markdown converter.",
    "version": "0.3.9",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "985411b1b324b9a20c11ecf7b6a054ce6c736d263b7200d3278db3d9977c789a",
                "md5": "8364719965a18c62eba9e364c957157a",
                "sha256": "30f49588f7dc6ef7bac63966096325210e33473d8175fda108cb623492ba648d"
            },
            "downloads": -1,
            "filename": "md2tgmd-0.3.9-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "8364719965a18c62eba9e364c957157a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 28144,
            "upload_time": "2024-11-14T22:12:06",
            "upload_time_iso_8601": "2024-11-14T22:12:06.323687Z",
            "url": "https://files.pythonhosted.org/packages/98/54/11b1b324b9a20c11ecf7b6a054ce6c736d263b7200d3278db3d9977c789a/md2tgmd-0.3.9-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0829e9becd25439aa65ce03b3442c53da4a24b8270a7311d4d5e4878109c8cb0",
                "md5": "50693bae9cf13a64115368dd1562db58",
                "sha256": "988c3410ff1486df355ae33f4a91ff3b7aa3a646f5fcc07a4993e6178cce3447"
            },
            "downloads": -1,
            "filename": "md2tgmd-0.3.9.tar.gz",
            "has_sig": false,
            "md5_digest": "50693bae9cf13a64115368dd1562db58",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 28756,
            "upload_time": "2024-11-14T22:12:07",
            "upload_time_iso_8601": "2024-11-14T22:12:07.174755Z",
            "url": "https://files.pythonhosted.org/packages/08/29/e9becd25439aa65ce03b3442c53da4a24b8270a7311d4d5e4878109c8cb0/md2tgmd-0.3.9.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-14 22:12:07",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "md2tgmd"
}
        
Elapsed time: 0.93230s