2021-04-05 17:29:49 +02:00
.. _plugin-Format:
Documentation for the Format plugin for Supybot
===============================================
Purpose
-------
Provides simple commands for formatting text on IRC (like bold),
and to change the output of the bot for a particular command.
See also the :ref: `Filter plugin <plugin-Filter>` to configure
the output format for all commands.
Usage
-----
Provides some commands for formatting text, such as making text bold or
capitalized.
2021-04-05 22:56:40 +02:00
.. _commands-Format:
2021-04-05 17:29:49 +02:00
Commands
--------
2021-04-17 20:09:33 +02:00
.. _command-format-bold:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
bold <text>
Returns <text> bolded.
2021-04-17 20:09:33 +02:00
.. _command-format-capitalize:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
capitalize <text>
Returns <text> capitalized.
2021-04-17 20:09:33 +02:00
.. _command-format-color:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
color <foreground> [<background> ] <text>
Returns <text> with foreground color <foreground> and background color <background> (if given)
2021-04-17 20:09:33 +02:00
.. _command-format-concat:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
concat <string 1> <string 2>
Concatenates two strings. Do keep in mind that this is *not* the same thing as join "", since if <string 2> contains spaces, they won't be removed by concat.
2021-04-17 20:09:33 +02:00
.. _command-format-cut:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
cut <size> <text>
Cuts <text> down to <size> by chopping off the rightmost characters in excess of <size>. If <size> is a negative number, it chops that many characters off the end of <text>.
2021-04-17 20:09:33 +02:00
.. _command-format-field:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
field <number> <text>
Returns the <number>th space-separated field of <text>. I.e., if text is "foo bar baz" and <number> is 2, "bar" is returned.
2021-04-17 20:09:33 +02:00
.. _command-format-format:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
format <format string> [<arg> ...]
Expands a Python-style format string using the remaining args. Just be sure always to use %s, not %d or %f or whatever, because all the args are strings.
2021-04-17 20:09:33 +02:00
.. _command-format-join:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
join <separator> <string 1> [<string> ...]
Joins all the arguments together with <separator>.
2021-04-17 20:09:33 +02:00
.. _command-format-lower:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
lower <text>
Returns <text> lowercased.
2021-04-17 20:09:33 +02:00
.. _command-format-replace:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
replace <substring to translate> <substring to replace it with> <text>
Replaces all non-overlapping occurrences of <substring to translate> with <substring to replace it with> in <text>.
2021-04-17 20:09:33 +02:00
.. _command-format-repr:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
repr <text>
Returns <text> surrounded by double quotes.
2021-04-17 20:09:33 +02:00
.. _command-format-reverse:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
reverse <text>
Returns <text> in reverse-video.
2021-04-17 20:09:33 +02:00
.. _command-format-stripformatting:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
stripformatting <text>
Strips bold, underline, and colors from <text>.
2021-04-17 20:09:33 +02:00
.. _command-format-title:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
title <text>
Returns <text> titlecased.
2021-04-17 20:09:33 +02:00
.. _command-format-translate:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
translate <chars to translate> <chars to replace those with> <text>
Replaces <chars to translate> with <chars to replace those with> in <text>. The first and second arguments must necessarily be the same length.
2021-04-17 20:09:33 +02:00
.. _command-format-underline:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
underline <text>
Returns <text> underlined.
2021-04-17 20:09:33 +02:00
.. _command-format-upper:
2021-04-05 22:56:40 +02:00
2021-04-05 17:29:49 +02:00
upper <text>
Returns <text> uppercased.
2021-04-17 20:09:33 +02:00
.. _conf-Format:
2021-04-05 17:29:49 +02:00
Configuration
-------------
2021-04-17 20:09:33 +02:00
.. _conf-supybot.plugins.Format.public:
2021-04-05 17:29:49 +02:00
supybot.plugins.Format.public
This config variable defaults to "True", is not network-specific, and is not channel-specific.
Determines whether this plugin is publicly visible.