Skip to content

Commit

Permalink
✨ feat: add ContentTypes import and update README.md
Browse files Browse the repository at this point in the history
- Added ContentTypes to imports in __init__.py and relevant scripts.
- Updated README.md to include Mermaid Diagrams render support.
- Improved formatting for markdownify_case.py links.
  • Loading branch information
sudoskys committed Dec 13, 2024
1 parent 12d09bf commit 539b9db
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ for LLM responses, GitHub README files, and more.
ensure
its effectiveness.
- We also support Latex Visualization(escape) and Expanded Citation.
- Mermaid Diagrams render supported.

> [!NOTE]
> If you're interested, there's also a Node.js version of the library
Expand All @@ -40,10 +41,14 @@ pdm add telegramify-markdown
### 🤔 What you want to do?

- If you just want to send *static text* and don't want to worry about formatting,
check: **[playground/markdownify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/markdownify_case.py)**
check: *
*[playground/markdownify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/markdownify_case.py)
**

- If you are developing an *LLM application* and need to send potentially **super-long text**, please
check: **[playground/telegramify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/telegramify_case.py)**
check: *
*[playground/telegramify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/telegramify_case.py)
**

## 👀 Use case

Expand Down Expand Up @@ -139,7 +144,9 @@ print(converted)

### `telegramify_case`

please check: **[playground/telegramify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/telegramify_case.py)**
please check: *
*[playground/telegramify_case.py](https://github.com/sudoskys/telegramify-markdown/blob/main/playground/telegramify_case.py)
**

## 🔨 Supported Input

Expand Down
2 changes: 1 addition & 1 deletion playground/inspect_telegramify.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
from telebot import TeleBot

import telegramify_markdown
from telegramify_markdown.interpreters import ContentTypes
from telegramify_markdown.customize import markdown_symbol
from telegramify_markdown.type import ContentTypes

tips = """
telegramify_markdown.telegramify
Expand Down
2 changes: 1 addition & 1 deletion playground/telegramify_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from telebot import TeleBot

import telegramify_markdown
from telegramify_markdown.interpreters import ContentTypes
from telegramify_markdown.type import ContentTypes
from telegramify_markdown.customize import markdown_symbol

tips = """
Expand Down
3 changes: 2 additions & 1 deletion src/telegramify_markdown/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from .mermaid import render_mermaid
from .mime import get_filename
from .render import TelegramMarkdownRenderer, escape_markdown
from .type import Text, File, Photo
from .type import Text, File, Photo, ContentTypes

__all__ = [
"escape_markdown",
Expand All @@ -23,6 +23,7 @@
"telegramify",
"BaseInterpreter",
"Interpreters",
"ContentTypes",
]
latex_escape_helper = LatexToUnicodeHelper()

Expand Down

0 comments on commit 539b9db

Please sign in to comment.