Serchilo:Command syntax

Serchilo's Command syntax is a bit like XML. Let's look at some examples: {|
 * colspan="3" |

Simple commands
keyword = google url    = http://www.google.com/ keyword = google url    = http://www.google.com/search?q={%query} Instead of {%query} you can also use {%foo}, {%bar} ... keyword = google url    = http://www.google.com/search?q={%query}&p={%second query} keyword = google url    = http://www.google.com/search?hl={$language}&q={%query} Note the difference between arguments ({%query}) and variables {$language})
 * accepts google
 * goes to http://www.google.com/
 * accepts google
 * goes to http://www.google.com/
 * accepts google something
 * replaces {%query} with something.
 * goes to http://www.google.com/search?q=something
 * replaces {%query} with something.
 * goes to http://www.google.com/search?q=something
 * accepts google something, something else
 * replaces {%query} with something and {%second query} with something else.
 * goes to http://www.google.com/search?q=something&p=something%20else
 * replaces {%query} with something and {%second query} with something else.
 * goes to http://www.google.com/search?q=something&p=something%20else
 * accepts google something
 * replaces {%query} with something and {$language} with en (if called from http://en.serchilo.net)
 * goes to http://www.google.com/search?hl=en&q=something
 * replaces {%query} with something and {$language} with en (if called from http://en.serchilo.net)
 * goes to http://www.google.com/search?hl=en&q=something
 * colspan="3" |
 * colspan="3" |

Priority in a language
keyword = google language = de   url      = http://www.google.de/ If called from http://de.serchilo.net/ and there are more commands using the keyword google, this one will be taken.
 * colspan="3" |
 * colspan="3" |

Own title
keyword = google title   = Google Homepage url     = http://www.google.com/ By default the command title is the title of the wiki-page where it is defined. With title you can define a different title.

This title is shown in the suggestions and the command search.
 * colspan="3" |
 * colspan="3" |

Regular expressions
regexp  = ^g([a-z]{2}) (.*)$ syntax  = g{language} {query} url     = http://www.google.com/search?lr=lang_{$1}&q={$2}
 * accepts anything from gaa something ... gzz something.
 * replaces {$1} with aa (or ... zz) and {$2} with something.
 * goes to http://www.google.com/search?lr=lang_aa&q=something
 * syntax can be any string (but should describe the usage properly)
 * regexp must be a regular expression in MySQL syntax.
 * colspan="3" |
 * regexp must be a regular expression in MySQL syntax.
 * colspan="3" |
 * colspan="3" |

Encoding
keyword = google url     = http://www.google.com/search?hl=en&q={%query} keyword = google url     = http://www.google.com/search?hl=en&q={%query|iso-8859-1} Besides iso-8859-1 you may also use: pass, auto, wchar, byte2be, byte2le, byte4be, byte4le, base64, uuencode, html-entities, quoted-printable, 7bit, 8bit, ucs-4, ucs-4be, ucs-4le, ucs-2, ucs-2be, ucs-2le, utf-32, utf-32be, utf-32le, utf-16, utf-16be, utf-16le, utf-8, utf-7, utf7-imap, ascii, euc-jp, sjis, eucjp-win, sjis-win, cp51932, jis, iso-2022-jp, iso-2022-jp-ms, windows-1252, iso-8859-1, iso-8859-2, iso-8859-3, iso-8859-4, iso-8859-5, iso-8859-6, iso-8859-7, iso-8859-8, iso-8859-9, iso-8859-10, iso-8859-13, iso-8859-14, iso-8859-15, iso-8859-16, euc-cn, cp936, hz, euc-tw, big-5, euc-kr, uhc, iso-2022-kr, windows-1251, cp866, koi8-r, armscii-8 (using mb-convert-encoding   keyword  = google    url      = http://www.google.com/search?hl=en&q={%query|none}
 * will encode %query in UTF-8 (default)
 * will encode %query in UTF-8 (default)
 * will encode %query in UTF-8 (default)
 * will encode %query in ISO-8859-1
 * colspan="3" |
 * will encode %query in ISO-8859-1
 * colspan="3" |
 * colspan="3" |
 * will apply no encoding at all, even no urlencode
 * }
 * will apply no encoding at all, even no urlencode
 * }