Help for sending markup
PyLily has added support for rich text and color both in its user interface and
in messages that users send to one another. If enabled, PyLily allows text
styles to be put in square brackets when entering messages. For example, sending
a message of "Here's some [bold]important[/bold] information" would render the
word "important" in bold text. This can also be abbreviated to
"[b]important[/]". Here's a list of common styles supported:
"bold" or "b" for bold text.
"italic" or "i" for italic text.
"reverse" or "r" for text with foreground and background reversed.
"strike" or "s" for text with a line through it.
"underline" or "u" for underlined text.
Foreground and background colors can also be set. Text styling is implemented
using the Python "rich" library. For full details on the available colors and
styles, see https://rich.readthedocs.io/en/stable/style.html. Also, see
https://rich.readthedocs.io/en/stable/markup.html for some additional details on
the bracket syntax.
Markup can also be used to include inline images in messages, info, and memos.
To include an image, use "img source" in square brackets, where source is either
a memo name or absolute URL. See "/help sending inline_images" for more details.
To make simple text markup more natural and easy to enter, PyLily defaults to
supporting an "enhanced" markup mode which uses matching pairs of punctuation to
select from the available text styles. Specifically, the following short cuts
can be used:
*bold* for bold text.
/italic/ for italic text.
~reverse~ for reverse text.
-strike- for strike-through text.
_underline_ for underlined text.
To avoid false positives, there are some restrictions on when this punctuation
triggers a style change. However, if you're having trouble, you can always fall
back to the more explicit square bracket syntax.
If you need to enter one of the above sequences and you don't want it to be
treated as markup, surround the text in backquotes (e.g. `*literal asterisks*`)
or add a backslash in front of the punctuation you want to remain literal.
So, the above example could be written more simply as "Here's some *important*
information". This is intended to match what many lily users already enter to
emphasize certain words in their messages, and PyLily will automatically convert
such input to actual styled text output on terminals that support it.
Not all terminals are able to render this kind of output, and by default PyLily
will attempt to determine whether to strip this formatting from its output based
on the terminal type of the client. Also, "smart" clients will be provided with
the raw markup in the message, so they can do their own rendering.
See "/help settings sending" for options to control whether markup is supported
on message input, and "/help settings display" for options to control whether or
not rich text and Unicode characters are rendered when output is received.
Also, see "/help style" for information on adding rich text markup and coloring
to incoming messages and notifications based on custom matching rules.
(see also: settings sending, settings display, style)