Release status: experimental |
|
|---|---|
| Description | Standardizes wikitext after each page save |
| Author(s) | Sophivorustalk |
| Latest version | 2.2 |
| MediaWiki | >= 1.39.0 |
| PHP | 7.4+ |
| Database changes | No |
| License | GNU General Public License 3.0 or later |
| Download | Download extension Git [?]: |
| Example | |
|
Parameters
|
|
|
Hooks used
|
|
| Quarterly downloads | 2 (Ranked 168th) |
| Translate the StandardWikitext extension if it is available at translatewiki.net | |
The StandardWikitext extension standardizes wikitext after each page save. Use this extension to:
- Fix messy wikitext
- Fix some broken wikitext
- Simplify regular expression search-and-replace
- Simplify wikitext parsing by other tools
- Eliminate OCD editing
- End controversy over wikitext styles
This extension is inspired on JavaScript Standard Style. Enough of this madness!
Installation
- Download and place the file(s) in a directory called
StandardWikitextin yourextensions/folder. - Add the following code at the bottom of your LocalSettings.php file:
wfLoadExtension( 'StandardWikitext' );
Done – Navigate to Special:Version on your wiki to verify that the extension is successfully installed.
Configuration
| Configuration | Description | Default | Example |
|---|---|---|---|
$wgStandardWikitextNamespaces
|
Array of namespaces where to run wikitext standardization. | [
NS_MAIN,
]
|
[
NS_MAIN,
NS_HELP,
NS_PROJECT,
]
|
$wgStandardWikitextAccount
|
System account from which to do the wikitext standardization. | "StandardWikitext bot"
|
"My bot"
|
Modules
Wikitext is standardized to the following formats.
Sections
== Section == Text. === Sub-section === Text. ==== Sub-sub-section ==== Text.
Links
[[foo]] [[foo]]s [[Foo|bar]] [[File:Foo.jpg|thumb|Caption]] [[File:Foo.jpg|thumb|left|300px|Caption with [[sublink]].]]
Lists
* Foo * Bar * Baz # Foo # Bar # Baz * Foo ** Bar *** Baz
Templates
{{Foo}}
{{Foo|bar|baz=qux}}
{{Foo
| bar
| baz = qux
}}
Tables
{| class="wikitable"
|+ Caption
! Header
! Header
|-
| Text
| Text
|-
| Text
| Text
|}
References
Text.<ref name="foo" group="bar">Reference</ref> Text.<ref name="foo" />
Categories
Text. [[Category:A]] [[Category:B]] [[Category:C]]
See also
- JavaScript Standard Style - Inspiration for this extension
This article is issued from Mediawiki. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.