mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
pyrofork: docs: text-formatting: Move up HTML section
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
4926eda4c5
commit
149dd4a708
1 changed files with 68 additions and 68 deletions
|
|
@ -44,68 +44,6 @@ list of the basic styles currently supported by Pyrofork.
|
||||||
fixed-width
|
fixed-width
|
||||||
code block
|
code block
|
||||||
|
|
||||||
Markdown Style
|
|
||||||
--------------
|
|
||||||
|
|
||||||
.. warning::
|
|
||||||
|
|
||||||
The Markdown style is not recommended for complex text formatting.
|
|
||||||
If you want to use complex text formatting such as nested entities, overlapping entities use the HTML style instead.
|
|
||||||
|
|
||||||
|
|
||||||
To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the *parse_mode* parameter when using
|
|
||||||
:meth:`~pyrogram.Client.send_message`. Use the following syntax in your message:
|
|
||||||
|
|
||||||
.. code-block:: text
|
|
||||||
|
|
||||||
**bold**
|
|
||||||
|
|
||||||
__italic__
|
|
||||||
|
|
||||||
--underline--
|
|
||||||
|
|
||||||
~~strike~~
|
|
||||||
|
|
||||||
||spoiler||
|
|
||||||
|
|
||||||
[text URL](https://pyrogram.org/)
|
|
||||||
|
|
||||||
[text user mention](tg://user?id=123456789)
|
|
||||||
|
|
||||||
`inline fixed-width code`
|
|
||||||
|
|
||||||
```
|
|
||||||
pre-formatted
|
|
||||||
fixed-width
|
|
||||||
code block
|
|
||||||
```
|
|
||||||
|
|
||||||
> Quoted text
|
|
||||||
|
|
||||||
**Example**:
|
|
||||||
|
|
||||||
.. code-block:: python
|
|
||||||
|
|
||||||
from pyrogram import enums
|
|
||||||
|
|
||||||
await app.send_message(
|
|
||||||
"me",
|
|
||||||
(
|
|
||||||
"**bold**, "
|
|
||||||
"__italic__, "
|
|
||||||
"--underline--, "
|
|
||||||
"~~strike~~, "
|
|
||||||
"||spoiler||, "
|
|
||||||
"[URL](https://pyrogram.org), "
|
|
||||||
"`code`, "
|
|
||||||
"```"
|
|
||||||
"for i in range(10):\n"
|
|
||||||
" print(i)"
|
|
||||||
"```"
|
|
||||||
),
|
|
||||||
parse_mode=enums.ParseMode.MARKDOWN
|
|
||||||
)
|
|
||||||
|
|
||||||
HTML Style
|
HTML Style
|
||||||
----------
|
----------
|
||||||
|
|
||||||
|
|
@ -184,6 +122,68 @@ To strictly use this mode, pass :obj:`~pyrogram.enums.HTML` to the *parse_mode*
|
||||||
|
|
||||||
<my text>
|
<my text>
|
||||||
|
|
||||||
|
Markdown Style
|
||||||
|
--------------
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
The Markdown style is not recommended for complex text formatting.
|
||||||
|
If you want to use complex text formatting such as nested entities, overlapping entities use the HTML style instead.
|
||||||
|
|
||||||
|
|
||||||
|
To strictly use this mode, pass :obj:`~pyrogram.enums.ParseMode.MARKDOWN` to the *parse_mode* parameter when using
|
||||||
|
:meth:`~pyrogram.Client.send_message`. Use the following syntax in your message:
|
||||||
|
|
||||||
|
.. code-block:: text
|
||||||
|
|
||||||
|
**bold**
|
||||||
|
|
||||||
|
__italic__
|
||||||
|
|
||||||
|
--underline--
|
||||||
|
|
||||||
|
~~strike~~
|
||||||
|
|
||||||
|
||spoiler||
|
||||||
|
|
||||||
|
[text URL](https://pyrogram.org/)
|
||||||
|
|
||||||
|
[text user mention](tg://user?id=123456789)
|
||||||
|
|
||||||
|
`inline fixed-width code`
|
||||||
|
|
||||||
|
```
|
||||||
|
pre-formatted
|
||||||
|
fixed-width
|
||||||
|
code block
|
||||||
|
```
|
||||||
|
|
||||||
|
> Quoted text
|
||||||
|
|
||||||
|
**Example**:
|
||||||
|
|
||||||
|
.. code-block:: python
|
||||||
|
|
||||||
|
from pyrogram import enums
|
||||||
|
|
||||||
|
await app.send_message(
|
||||||
|
"me",
|
||||||
|
(
|
||||||
|
"**bold**, "
|
||||||
|
"__italic__, "
|
||||||
|
"--underline--, "
|
||||||
|
"~~strike~~, "
|
||||||
|
"||spoiler||, "
|
||||||
|
"[URL](https://pyrogram.org), "
|
||||||
|
"`code`, "
|
||||||
|
"```"
|
||||||
|
"for i in range(10):\n"
|
||||||
|
" print(i)"
|
||||||
|
"```"
|
||||||
|
),
|
||||||
|
parse_mode=enums.ParseMode.MARKDOWN
|
||||||
|
)
|
||||||
|
|
||||||
Different Styles
|
Different Styles
|
||||||
----------------
|
----------------
|
||||||
|
|
||||||
|
|
@ -236,18 +236,18 @@ strike` styles, and you can still combine both Markdown and HTML together.
|
||||||
|
|
||||||
Here there are some example texts you can try sending:
|
Here there are some example texts you can try sending:
|
||||||
|
|
||||||
**Markdown (Not Recommended)**:
|
|
||||||
|
|
||||||
- ``**bold, --underline--**``
|
|
||||||
- ``**bold __italic --underline ~~strike~~--__**``
|
|
||||||
- ``**bold __and** italic__``
|
|
||||||
|
|
||||||
**HTML**:
|
**HTML**:
|
||||||
|
|
||||||
- ``<b>bold, <u>underline</u></b>``
|
- ``<b>bold, <u>underline</u></b>``
|
||||||
- ``<b>bold <i>italic <u>underline <s>strike</s></u></i></b>``
|
- ``<b>bold <i>italic <u>underline <s>strike</s></u></i></b>``
|
||||||
- ``<b>bold <i>and</b> italic</i>``
|
- ``<b>bold <i>and</b> italic</i>``
|
||||||
|
|
||||||
|
**Markdown (Not Recommended)**:
|
||||||
|
|
||||||
|
- ``**bold, --underline--**``
|
||||||
|
- ``**bold __italic --underline ~~strike~~--__**``
|
||||||
|
- ``**bold __and** italic__``
|
||||||
|
|
||||||
**Combined**:
|
**Combined**:
|
||||||
|
|
||||||
- ``--you can combine <i>HTML</i> with **Markdown**--``
|
- ``--you can combine <i>HTML</i> with **Markdown**--``
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue