Wikisource:Tools and scripts

This page contains various tools, scripts, and tutorials intended to simplify, make more efficient, or provide additional functionality to Wikisourcers.

If you're having trouble with anything on this page, make sure you've copied the code exactly as it is on this page, and you followed the instructions carefully. Try refreshing your browser to reset the cache. Try starting over from step 1, in case you made an accidental change. If this fails, feel free to ask for help on the talk page.

File formatting
The instructions on this page depend on Javascript pages and may not be formatted using &lt;pre&gt; or &lt;nowiki&gt; tags. These break the installation templates and prevent categorisation for opt-in automated updating. The best way to ensure correct formatting is to add at least one space at the start of every line (" " for blank lines), which is the correct wikisyntax method for plaintext formatting.

Updating scripts
Many of the scripts on this page are being actively developed. This occasionally requires that users replace scripts they're using with updated versions, which can be tedious and irregular. Users can ignore these updates, but they will not benefit from recent bugfixes or new features. Additionally, many scripts depending on external code will cease to work if they are very outdated.

Automated updates

There is a bot which will automatically update scripts in users' script files as necessary. This keeps all users at the cutting-edge versions and ensures that latest bugfixes and features are implemented immediately. This is an opt-in service, and some users may wish to update manually if they extensively customise the scripts they use.

To subscribe, add the code below at the very top of the javascript file you'd like to update. A bot will periodically scan pages in this category for outdated scripts, and update them as necessary. All scripts listed on this page will be updated as necessary as long as they are copied and pasted as shown on this page. You can subscribe to automated updates, but disable updates for one script in particular. To do so, change the update field in the script template to anything except "yes". /* &lt;/pre&gt; */

TemplateScript
TemplateScript is a powerful user script framework that adds custom one-click templates and scripts to the sidebar (on the left, below Tools). Currently various tools are available for proofreading and typography; see the page for details.

Scripts
These are typically added to your common.js page with something like the following code:

mw.loader.load('//en.wikisource.org/w/index.php?title=&action=raw&ctype=text/javascript');

With the text in red being replaced by the relevant script page name. For detailed help, see User styles on Meta.

InstaView
Update: last update February 14, 2006.

Author: Pilaf (Wikipedia)

Contributor: Pathoschild (ported to Wikisource)

Caution: This is an experimental script. It is not recommended for users unfamiliar with wikis.

''InstaView is an extension to Wikipedia's edit page which allows you to generate instant previews of the page you're editing. Unlike the normal preview mode, you don't need to refresh the page; except for very large pages, there is no delay whatsoever. However, the script does not recognize templates or signatures.''


 * 1) Copy and paste the code below into your javascript file.
 * 2) Fill in your username in the username field.
 * 3) See Updating scripts for details on the update field (usually doesn't need to be changed).

SoftRedirect
This script allows you to convert pages that are redirects to dated soft redirect. If no "#REDIRECT Blah" is found on the page, you will be prompted for the page that the soft redirect should point to. Update: last update June 09, 2006.

Author: Jude


 * 1) Copy and paste the code into your Javascript file

More editing buttons
This script includes more edit buttons in your editing toolbar, reducing time when writing and proofreading text. Update: First version April 29, 2008.

Authors: Steve Sanbeg (coding)

Contributor: Mtmelendez (individual buttons)

A full list of extra edit buttons is here.

Running header lookup
This script has been moved to the running header gadget.

typoscript
Update: last update October 02, 2016.

Author: AuFCL (Wikipedia)



Introduction

 * The typoscan.js script highlights out of place characters and anomalies in the text created by the OCR process, but it is not a spell checking script. The typos are on the pages of the the Main namespace, Page namespace, and Page Preview, but not in edit mode.


 * There are two versions, one of which excludes highlighting text in the Main namespace.

Examples

 * Out of place characters are considered to be . . ..

 Mix of letters with numbers and vice versa: or  Mix of upper and lower characters:  or  Word like, instead of modern. Punctuation preceded by space, excluding ellipsis: comma and period. . . . . Floating (unattached) punctuation and symbols, excluding emdash, or endash: Opening quote at the start of the word. Scan error of the character. or when followed by space or a comma.

Installation

 * Create a typoscan.js submodule of the common.js module named User:username/common.js/typoscan.js. Replace "username" with your username.

Inclusion of the Main namespace in highlighting typos

 * Currently, there are two versions:


 * For the inclusion of the Main namespace pages to be highlighted, copy this code into the submodule:

Exclusion of the Main namespace from highlighting typos

 * For the exclusion of the Main namespace pages from highlighting typos, copy this code into the submodule:

Activation

 * The script is activated by the following code placed in the common.js. Use the following script and replace "username" with your username.

//activate typoscan script of User:username/common.js/typoscan.js mw.loader.load('//en.wikisource.org/w/index.php?title=User:username/common.js/typoscan.js&action=raw&ctype=text/javascript');

FullScreenEditing
This enables a toolbar button when editing in the Page namespace that switches in and out of full-screen mode, making it easier to proofread on smaller screens. The sidebar, and lots of other parts of the wiki layout, are removed completely; only things necessary for proofreading are kept.

Its effect can further be enhanced in many web browsers by entering the browser's full screen mode as well ( F11 in most browsers).

To enable, add this line to your common.js page:

mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/FullScreenEditing.js&action=raw&ctype=text/javascript');

PageCleanUp
Adds a toolbar button to clean up OCR text. This is a fork of part of MediaWiki:TemplateScript/proofreading.js, to re-implement it as a toolbar button. To use, add this to your common.js page:

mw.loader.load('//en.wikisource.org/w/index.php?title=User:Samwilson/PageCleanUp.js&action=raw&ctype=text/javascript');

There is also a slightly changed version of this Samwilson’s tool which lacks replacement of fullstops for commas before capital letters (as this may be a source of frequent errors in some texts):

mw.loader.load('//en.wikisource.org/w/index.php?title=User:Jan.Kamenicek/PageCleanUp.js&action=raw&ctype=text/javascript');

CurlyQuotes
Adds a toolbar button for converting all quotation marks, apostrophes, and dashes to their correct nicer typographical selves. To use, add this to your common.js page:

LinkedLintErrors
Adds a sidebar link which shows a list of lint errors for the current page and every page linked from it. Should work on all Wikimedia projects. To use, add this to your global.js page on Meta:

Quick Access


Adds a sidebar link that pops up a searchable list of all actions for a page. The link can be invoked with a hotkey (Shift+Alt+A), so it enables keyboard driven use of tools, even when the tools aren't visible on the page due to being scrolled off-screen.

Documentation

quick access.js

Index Preview
Adds a button to show a grid of the page in an Index, which can be helpful for page listing operations. Alt-clicking allows to quickly mark pages as without text, raw images or with tables.

mw.loader.load('//en.wikisource.org/w/index.php?title=User:Inductiveload/index_preview.js&action=raw&ctype=text/javascript');


 * User:Inductiveload/index_preview.js
 * Documentation: User:Inductiveload/index_preview

Tools

 * Tools Labs-based
 * [//tools.wmflabs.org/catscan2/catscan2.php?project=wikisource Intersection search tool], negative and positive searches. help
 * Direct uploading of one or more files to Commons (utilises OAuth)
 * Internet Archive upload tool (IA Upload) (utilises OAuth)
 * [//tools.wmflabs.org/commonshelper?language=en&project=wikisource&target_file=&file= Wikimedia file transfer to Commons]
 * Dictionary of National Biography project tool
 * Purpose:To identify pages that have been proofread with the WikiProject DNB and ancillary mainteance tasks Usage:Click the link, no refinement available.
 * Article page history
 * Purpose: Enables a deep look at the edits to a page, including when, who, size, statistics. Usage: Currently available as a link from the history of each page, or to paste in the name of the page of interest, eg. for this page 
 * Index: @ Page: transclusion check tool
 * Purpose: Maintenance tool to check the transclusion status of the Page: namespace pages that are linked to from the overarching Index: page. Useful to find pages that may have been missed when transcluding a work to main namespace, or to identify pages that need to be managed following maintenance to the related djvu file.  Usage: As a link from each Index: page for a work, or to paste in the name of the Index page with its namespace, eg. Index:The Dictionary of Australasian Biography.djvu.
 * Book scroll
 * Purpose: Tool to scroll through a djvu file. Active links from the Index: page of works.
 * [//tools.wmflabs.org/ws-cat-browser/ Category browser] for all validated works on English Wikisource.
 * Purpose: To give a quick overview of the category hierarchy when determining what categories to use for a work in the main namespace.
 * [[file:Wikisource-logo-green.svg|20px|link=toollabs:ws-image-uploader]] Wikisource Image Uploader
 * Purpose: streamlined image upload for images and illustrations extracted from books.
 * Usage: visit the tool, fill in the form, auto-generate the file description and upload the image

Text editors
Editing Wikisource may involve using a wide range of characters, some of which are not found on most English keyboards. Although it's possible to change one's keyboard language, this can be cumbersome for a few words. Many UTF-8 text editors allow the user to display a pop-up list of Unicode characters. Text strings in UTF-8 can be generated for pasting into Wikisource documents.


 * BabelPad
 * List at alanwood.net
 * list at sil.org
 * TextPad 8 Windows, non-free
 * Notepad++, Windows, free