Limnoria/plugins/Format
Valentin Lorentz 833af36b08 all plugins: auto-generate READMEs
Starting with this commit, there should be no "original" text
in READMEs.
Instead, the entire text should be in docstrings, and READMEs
should be automatically generated from these docstrings.

Motivation:

* The same help is available both via IRC and in the README
  (although the README can be more detailed, as only the first
  paragraph will be shown on IRC)
* This will allow auto-generating plugin help on docs.limnoria.net
  using the same content as the README, as it's sourced from the
  docstrings

Additionally, this converts all READMEs from Markdown to ReST,
because the documentation already uses ReST, and other docstrings
in the codebase are in ReST for this reason.
2021-04-05 17:42:31 +02:00
..
locales Fix msgfmt warnings. 2020-03-26 22:10:28 +01:00
__init__.py all plugins: auto-generate READMEs 2021-04-05 17:42:31 +02:00
config.py Fix neutral pronouns. 2014-04-11 21:56:42 +00:00
messages.pot Squashed commit of the following: 2014-12-20 14:37:27 +01:00
plugin.py Format: use string.capwords() - not .title() (#1378) 2019-10-10 07:46:36 -07:00
README.rst all plugins: auto-generate READMEs 2021-04-05 17:42:31 +02:00
test.py Format: use string.capwords() - not .title() (#1378) 2019-10-10 07:46:36 -07:00

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

Commands

bold <text>

Returns <text> bolded.

capitalize <text>

Returns <text> capitalized.

color <foreground> [<background>] <text>

Returns <text> with foreground color <foreground> and background color <background> (if given)

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.

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

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.

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.

join <separator> <string 1> [<string> ...]

Joins all the arguments together with <separator>.

lower <text>

Returns <text> lowercased.

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

repr <text>

Returns <text> surrounded by double quotes.

reverse <text>

Returns <text> in reverse-video.

stripformatting <text>

Strips bold, underline, and colors from <text>.

title <text>

Returns <text> titlecased.

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.

underline <text>

Returns <text> underlined.

upper <text>

Returns <text> uppercased.

Configuration

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.