Wikisource:TemplateScript
Proofreading
editUsage
editThis library is useful when proofreading pages in the Page: namespace. To enable it:
- Paste this code into your common.js or global.js:
/** * Add several tools useful when proofreading pages in the Page: namespace. * @see https://en.wikisource.org/wiki/Wikisource:TemplateScript */ mw.loader.load('//en.wikisource.org/w/index.php?title=MediaWiki:TemplateScript/proofreading.js&action=raw&ctype=text/javascript');
- (optional) Go to Special:TemplateScript to disable scripts you don't use.
Scripts
editThis library adds the following links to your sidebar:
- Add header adds the {{running header}} template to the header (and will use the special header for the current work if it's known). See here for instructions on how to use this script once installed Wikisource:TemplateScript/RunningHeader
- Add footer adds a reference list to the footer if the page contains references.
- Clean up OCR makes many automatic corrections and cleanup when proofreading a page after OCR:
- clean up format:
- move <noinclude> content at the start or end of the page into the header or footer;
- replace
<center>...</center>
with {{center}}; - replace {{float center}} with {{block center}};
- clean up whitespace:
- remove trailing spaces;
- remove spacing around em dashes or punctuation marks;
- replace consecutive spaces with one space;
- clean up newlines:
- join words that are hyphenated across a line break;
- move lines beginning with a quote character to a new paragraph;
- move punctuation on a new line back onto previous line;
- remove single line breaks (no effect in wikitext and usually an unneeded word wrap);
- remove forced hard breaks at the end of paragraphs;
- convert characters:
- convert double hyphens to em dashes;
- convert common HTML entity codes (like —) to characters (like —);
- convert curved quotes (“”‘’`) to straight quotes ("');
- convert diacritic templates (like {{ae}}) to characters (like æ);
- correct common OCR errors:
- remove numerals at the end of the page text (nearly always page numbers in the footer);
- convert '1' parsed as 'i' (e.g., i9 → 19);
- correct 'th' parsed as 'tli' (e.g., tlie → the);
- correct 'll' parsed as 'U' (e.g., aU → all);
- correct 'oul' parsed as 'oid' (e.g., woidd → would);
- correct missing apostrophes (e.g., he s → he's).
- clean up format:
- Make reference automatically gathers references. As you work your way through the page, when you encounter a reference, just mark it with
<ref></ref>
tags and continue. Once you've got to the end of the page and proofed the references, simply highlight each reference in turn, and use this function to move it to its proper position. - Convert to small caps converts the selected text to Small Caps using the {{small-caps}} template.
- Convert to uppercase converts the selected text to UPPERCASE.
Typography
editUsage
editThis library adds scripts for adding diacritics (like àéîö) and changing letter case. To enable it:
- Paste this code into your common.js or global.js:
/** * Add several tools for editing typography like diacritics and letter case. * @see https://en.wikisource.org/wiki/Wikisource:TemplateScript */ mw.loader.load('//en.wikisource.org/w/index.php?title=MediaWiki:TemplateScript/typography.js&action=raw&ctype=text/javascript');
- (optional) Go to Special:TemplateScript to disable scripts you don't use.
Scripts
editThis library adds the following links to your sidebar:
- Make title link converts the selected text into a link with title case (like "
THE MAN FROM SNOWY RIVER
" → "[[The Man from Snowy River|THE MAN FROM SNOWY RIVER]]
"). - Make author link converts the selected text into an author link with appropriate capitalisation (like "
John Smith
" → "[[Author:John Smith|John Smith]]
" or "SMITH, JOHN
" → "[[Author:John Smith|SMITH, JOHN]]
"). - Convert to Small Caps converts the selected text to Small Caps. This adds the
{{sc|...}}
template, and converts the text to title case if it's in UPPERCASE. - Convert to UPPER converts the selected text to UPPERCASE.
- Add diaeresis (ä) adds a diaeresis mark to the selected character (like "
a
" → "ä
"). - Add acute (á) adds an acute accent to the selected character (like "
a
" → "á
"). - Add grave (à) adds a grave accent to the selected character (like "
a
" → "à
"). - Add circumflex (â) adds a circumflex to the selected character (like "
a
" → "â
"). - Add macron (ā) adds a macron to the selected character (like "
a
" → "ā
"). - Add ligature or hook converts the selected text to a ligature (like "
ae
" → "æ
") or adds a hook (like "c
" → "ç
").