Wikipedia talk:WikiProject User scripts/Scripts/Formatter/doc
Appearance
This is a documentation subpage for Wikipedia:WikiProject User scripts/Scripts/Formatter. It may contain usage information, categories and other content that is not part of the original the script.. |
The Formatter script automatically performs a number of common formatting operations.
To install, simply include this line in your monobook.js:
importScript('Wikipedia:WikiProject_User_scripts/Scripts/Formatter');
Optionally, for an automatic edit summary, also include this line:
importScript('Wikipedia:WikiProject_User_scripts/Scripts/Formatter/Auto Edit Summary');
Make sure you refresh (Ctrl+F5) after saving to complete the installation.
When using an edit box, you should have a tab called format
. Click this to use Formatter. Make sure you preview all the changes before saving!
Functions
[edit]- Standardises and removes excess whitespace (tabs, spaces, carriage returns etc.)
- Does not break special case of using a space at the start of the line for preformatted data
- Converts dashes, squared2 and degree° symbols to Unicode characters, e.g.
–
,–
or–
to – (U+2013)- Makes sure not to break items which should not be converted to Unicode
- Fixes some common non-standard headings:
- Standard headings have whitespace and capitalisation standardised, e.g.
"== eXterNAL LiNKs =="
would become"==External links=="
- "see also", "related topics", "related articles", "internal links" and "also see" sections become "See also"
- "external links", "outside links", "web links" and "exterior links" sections become "External links"
- Convert singular case to plural, e.g. "external link" becomes "External links"
- "references", "reference", "sources" and "source" sections have whitespace, capitalisation, and pluralisation standardised as above
- Standard headings have whitespace and capitalisation standardised, e.g.
- Standardises appearances of categories, e.g.
[[category : Test]]
to[[Category:Test]]
- Fixes common syntax errors, e.g. converts
<b>text</b>
to'''text'''
- Removes external images and removes code from internal images
- Simplifies some links, e.g.
[[Dog|dog]]
to[[dog]]
and[[Dog|dogs]]
to[[dog]]s
- Loads as a tab on edit pages