Jump to content

Wikipedia:Tools/Editing tools

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 76.107.40.139 (talk) at 11:52, 25 August 2017. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

Wikipedia editing tools

Screenshot of wikEd, a full-featured in-browser text editor

MW (ubiquity script)

MW is a Firefox Ubiquity script. It uses the mediawiki API to suggest and insert an internal link.

CSVLoader

CSVLoader is an AutoWikiBrowser plug-in that allows creating and updating articles using CSV data files.

QuickWikiEditor

With this Firefox-add-on it is possible to make little edits to wiki-articles without having to leave or reload the page, so the flow in reading an article is barely disturbed.

Available at addons.mozilla.org.

WikiUp

WikiUp is a small utility for adding images and files to your MediaWiki wiki site. (Windows only). With WikiUp you simply paste the image from the clipboard, click upload and then paste the Wiki-tag directly into the page you're editing.

You can drag and drop files and images to upload instantly. Automatic naming of pasted images.

WikiUp is proprietary freeware.

Available at wikiup.se

Wiki's

Wiki's is a software to edit wikis more easily, it content buttons to go in a page, to edit a page more speedily, etc.[needs copy edit]

Download Wiki's

WinMerge

WinMerge is a free and open-source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle. This application is very helpful for keeping track of changes on large, complicated edits.

WinMerge

Semi-auto edit bots

AutoWikiBrowser

AutoWikiBrowser – (Windows platform) Makes repetitive, tedious edits such as spell checkings or category moves faster and easier.

mwpush

mwpush.pl is a Perl script which takes a Wikified text file or input and submits it to a target MediaWiki page.

PyAutoWikiBrowser

PyAutoWikiBrowser (PyAWB) is an editing assist tool for Mediawiki similar to AWB, but since it is written in Python, it is intended to be cross-platform. Currently it is under development, but it is available for testing as a command line tool. While in beta please restrict editing to your own userspace, or preferably, sign up at test wikipedia and use that. Enter the project test (not Wikipedia) and language test when running make.py to set up the software.

Pywikibot

Useful for creating bots, or for interactive repair of interwiki links.

DotNetWikiBot

DotNetWikiBot has an option to review and change each edit in Microsoft Word before saving it to live wiki. DotNetWikiBot is a client API on .NET, intended for building bots for MediaWiki sites.

Relink.pl is a Perl5 script that relinks wikitext. It removes red links, given a list of titles that it generates from the raw wikitext. It can also add links given a list of words to link. It will report link counts, how many times each link occurs, and the total number of outgoing links.

Information display

Wikipedia:Tools/Navigation popups gives a popup box containing the first paragraph of an article when hovering over a link; it also allows quick access to common editing operations. If the wiki provides the NavPop gadget, it can be enabled in user preferences under the gadgets tab. Otherwise, installed by editing the user's [[User:Name/monobook.js]] file.

Alternative preview

  • Alex Smotrov's QPreview adds an edit toolbar button that uses XMLHttpRequest to generate page preview without reloading the whole page. QPreview functionality has also been added to the wikEd editor tool.

WikiCheck watchlist tool

WikiCheck is a small tool to make checking your watchlist easier. Docked to the left screen edge it shows a list of changes that occurred since the last time the list was checked. Clicking on a change will open the corresponding diff in a new browser window. Recently rewritten.

vfd_NavBar

vfd_NavBar is a modified version of the experimental navigation bars. This will hide closed discussions in the AFD & AFC pages, but not in the AFD sub pages (where there's only 1 discussion) and allows you to toggle them individually. There's no other requirements, just {{subst:User:Sanbeg/vfd_NavBar.js}} into your monobook.js -Steve Sanbeg 21:12, 17 October 2006 (UTC)[reply]

Wikisyntax conversion utilities

From spreadsheet tables

From Microsoft Word or OpenOffice

see also "From OpenOffice" section below for conversion from or via OpenOffice

  • VisualEditor, the WYSIWYG editor deployed on multiple Wikipedias allows for the copying/pasting of content from Word documents into a wiki page. Most formatting is kept intact - including tables. However, images and advanced formatting will need to be cleaned up upon import.
  • User:Cacycle/wikEd editor extension functionality, see above
  • Extension:Word2MediaWikiPlus: Converts most text, tables and pictures into wiki format.
  • Microsoft Office Word Add-in For MediaWiki: Converts Word documents to wiki formatting. Doesn't do images.
  • Word2MediaWiki using a Word Visual Basic macro
  • word2mediawiki.pl: A Perl script that convert Word files to Mediawiki using OpenOffice (running "headless"). Images are also supported. Images are extracted from the Word file and saved as ordinary images which are uploaded to the wiki using pywikipediabot. Runs on Linux.
  • word2mediawiki.py: A Python script that convert Word files to Mediawiki using OpenOffice. Images are also supported.
  • Excel2Wiki tool for converting Excel tables to wiki tables.
  • Adding code to Microsoft visual basic editor
Add the source code below (currently hidden in a collapsed table) to the visual basic editor in Word.
Copy and paste the below code into a file.
Open the visual basic editor tools → macro → visual basic editor (In Word 2007, Show Developer Tab in Ribbon must be checked in Word Options → Popular)
Right click on Normal in the Project pane and select Import File...
Import the file saved above (that file is no longer needed after import)
Save the code File → Save normal
Close the visual basic editor.
Converting the Word formatted text is simply done by running your new 'installed' macro tools → macro → macros.
See the notes[2] for more formatting options.
Code to add to Microsoft Visual basic editor

Attribute VB_Name = "Word2Wiki"
Dim newDoc As Document

Sub Word2Wiki()

    Set newDoc = New Word.Document
    ActiveDocument.Content.Copy
    newDoc.Content.Paste

    Application.ScreenUpdating = False

    ConvertH1
    ConvertH2
    ConvertH3

    ConvertItalic
    ConvertBold
    'ConvertUnderline
    ConvertLinks

    'must come before lists otherwise it adds extra line breaks in their sequence and breaks it
    ConvertBreaks

    '''ConvertLists
    ConvertTables'''

    ' Copy to clipboard
    newDoc.Content.Copy
    newDoc.Close (False)

    Application.ScreenUpdating = True
End Sub

Private Sub ConvertH1()
    Dim normalStyle As Style
    Set normalStyle = newDoc.Styles(wdStyleNormal)

    newDoc.Select

    With Selection.Find

        .ClearFormatting
        .Style = newDoc.Styles(wdStyleHeading1)
        .Text = ""

        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False

        .Forward = True
        .Wrap = wdFindContinue

        Do While .Execute
            With Selection
                If InStr(1, .Text, vbCr) Then
                    ' Just process the chunk before any newline characters
                    ' We'll pick-up the rest with the next search
                    .Collapse
                    .MoveEndUntil vbCr
                End If

                ' Don't bother to markup newline characters (prevents a loop, as well)
                If Not .Text = vbCr Then
                    .InsertBefore "= "
          .InsertAfter " ="
                End If

                .Style = normalStyle
            End With
        Loop
    End With
End Sub

Private Sub ConvertH2()
    Dim normalStyle As Style
    Set normalStyle = newDoc.Styles(wdStyleNormal)

    newDoc.Select

    With Selection.Find

        .ClearFormatting
        .Style = newDoc.Styles(wdStyleHeading2)
        .Text = ""

        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False

        .Forward = True
        .Wrap = wdFindContinue

        Do While .Execute
            With Selection
                If InStr(1, .Text, vbCr) Then
                    ' Just process the chunk before any newline characters
                    ' We'll pick-up the rest with the next search
                    .Collapse
                    .MoveEndUntil vbCr
                End If

                ' Don't bother to markup newline characters (prevents a loop, as well)
                If Not .Text = vbCr Then
                    .InsertBefore "== "
          .InsertAfter " =="
                End If

                .Style = normalStyle
            End With
        Loop
    End With
End Sub

Private Sub ConvertH3()
    Dim normalStyle As Style
    Set normalStyle = newDoc.Styles(wdStyleNormal)

    newDoc.Select

    With Selection.Find

        .ClearFormatting
        .Style = newDoc.Styles(wdStyleHeading3)
        .Text = ""

        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False

        .Forward = True
        .Wrap = wdFindContinue

        Do While .Execute
            With Selection
                If InStr(1, .Text, vbCr) Then
                    ' Just process the chunk before any newline characters
                    ' We'll pick-up the rest with the next search
                    .Collapse
                    .MoveEndUntil vbCr
                End If

                ' Don't bother to markup newline characters (prevents a loop, as well)
                If Not .Text = vbCr Then
                    .InsertBefore "=== "
                          .InsertAfter " ==="
                End If

                .Style = normalStyle
            End With
        Loop
    End With
End Sub

Private Sub ConvertBold()
    newDoc.Select

    With Selection.Find

        .ClearFormatting
        .Font.Bold = True
        .Text = ""

        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False

        .Forward = True
        .Wrap = wdFindContinue

        Do While .Execute
            With Selection
                If InStr(1, .Text, vbCr) Then
                    ' Just process the chunk before any newline characters
                    ' We'll pick-up the rest with the next search
                    .Collapse
                    .MoveEndUntil vbCr
                End If

                ' Don't bother to markup newline characters (prevents a loop, as well)
                If Not .Text = vbCr Then
                    .InsertBefore "'''"
                    .InsertAfter "'''"
                End If

                .Font.Bold = False
            End With
        Loop
    End With
End Sub

Private Sub ConvertItalic()
    newDoc.Select

    With Selection.Find

        .ClearFormatting
        .Font.Italic = True
        .Text = ""

        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False

        .Forward = True
        .Wrap = wdFindContinue

        Do While .Execute
            With Selection
                If InStr(1, .Text, vbCr) Then
                    ' Just process the chunk before any newline characters
                    ' We'll pick-up the rest with the next search
                    .Collapse
                    .MoveEndUntil vbCr
                End If

                ' Don't bother to markup newline characters (prevents a loop, as well)
                If Not .Text = vbCr Then
                    .InsertBefore "''"
                    .InsertAfter "''"
                End If

                .Font.Italic = False
            End With
        Loop
    End With
End Sub

Private Sub ConvertUnderline()
    newDoc.Select

    With Selection.Find

        .ClearFormatting
        .Font.Underline = True
        .Text = ""

        .Format = True
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False

        .Forward = True
        .Wrap = wdFindContinue

        Do While .Execute
            With Selection
                If InStr(1, .Text, vbCr) Then
                    ' Just process the chunk before any newline characters
                    ' We'll pick-up the rest with the next search
                    .Collapse
                    .MoveEndUntil vbCr
                End If

                ' Don't bother to markup newline characters (prevents a loop, as well)
                If Not .Text = vbCr Then
                    .InsertBefore "=== "
                    .InsertAfter " ==="
                End If

                .Font.Underline = False
            End With
        Loop
    End With
End Sub

Private Sub ConvertLists()
    Dim para As Paragraph
    For Each para In newDoc.ListParagraphs
        With para.Range
            If .ListFormat.ListType = wdListBullet Then
                .InsertBefore "*"
            Else
                .InsertBefore "#"
            End If

            .ListFormat.RemoveNumbers
        End With
    Next para
End Sub
Private Sub ConvertBreaks()
    Dim para As Paragraph
    For Each para In newDoc.Paragraphs
        If para.Range.ListFormat.List Is Nothing Then
            If para.Range.Words.Count > 1 Then
                para.Range.InsertParagraphBefore
            End If
       End If
    Next para
End Sub

Private Sub ConvertTables()
    Dim thisTable As Table
    Dim myCol As Word.Column
    Dim myRow As Word.Row
    Dim myCell As Word.Cell
    Dim myFrame As Word.Frame
    For Each thisTable In newDoc.Tables
        With thisTable
            For Each myRow In thisTable.Rows
                For Each myCell In myRow.Cells
                    With myCell.Range
                        .InsertBefore "|"
                    End With
                Next myCell
                myRow.Range.InsertBefore "|-" & vbCrLf
            Next myRow
            .Range.InsertBefore "{| border=""1""" & vbCrLf
            .Range.InsertAfter vbCrLf & "|}"
            .ConvertToText Separator:=wdSeparateByParagraphs
        End With
    Next thisTable
    For Each myFrame In newDoc.Frames
        myFrame.Delete
    Next myFrame
End Sub

Private Sub ConvertLinks()
    newDoc.Select
    For Each aHyperlink In newDoc.Hyperlinks
        Set aRange = aHyperlink.Range
        With aRange
            .InsertBefore "[" + aHyperlink.Address + " "
            .InsertAfter "]"
        End With
    Next aHyperlink
End Sub

On the other hand, transferring a single wiki page in mediawiki to Word is easy, just save the desired webpage and then open the page in Microsoft Word.

From HTML

Online, no installation required
Note: You must change the "Wiki dialect" to MediaWiki or it won't work properly. You can enter a url to convert a web page. It is based on the Perl module HTML::WikiConverter which performs html→wiki conversion and is available on CPAN. (by en:Diberri). This converter can fetch a URL instead of pasting the html.
Tip: If you receive no conversion but an "Internal Server Error" or nothing at all, the HTML source may be too large
Tip: If you experience problems with non-ASCII characters, paste UTF-8 code as ASCII (Ä instead of Ä), convert and restore original encoding (SciTe could help you doing the encoding conversions)
To download

From OpenOffice and LibreOffice

  • LibreOffice provides MediaWiki export functionality, package libreoffice-wiki-publisher needs to be installed
  • via OpenOffice 2.x to MediaWiki: open the .doc with OpenOffice.org 2.x and export as mediawiki text. Not available any longer in OpenOffice 3.x versions.
  • Odt2Wiki – OpenOffice.org Wiki
  • OpenOffice2MediaWiki: Export filter for converting from ODT format to MediaWiki
  • Writer2MediaWiki: OpenOffice macro for converting to MediaWiki format
  • Sun Wiki Publisher: OpenOffice extension from Sun to publish in MediaWiki format

From LaTeX

  • LaTeX2wiki converts sections, math, and references using a web form.

From source codes

  • Wikipedia supports syntax highlighting. For information on how to use it, and the languages supported, see Syntax Highlight Extension.

From Wikispaces

Misc. editing tools

RecentChanges tools

Spell Checkers

  • [1] to interwiki articles in different languages which ought to have a link.

Disambiguation fixer

Disambiguation fixer is a program to fix the links to Disambiguation pages. (See Wikipedia:Disambiguation pages with links)

Go-to-edit-page contextual menu item

  • This script for a Firefox extension allows one to go directly to the edit page of a right-clicked wiki page link (control-clicked on a Macintosh one-button mouse).

Timeline creation tool

For a tool to create nice graphical timelines, see meta:Wikipedia Project Time Charts and the Easy Timeline Homepage. (by meta:Erik Zachte)

AFD tools

note : AFD stands for Articles For Deletion

Add the following to your monobook.js file

Code for "AFD" to be added to your monobook.js
function hidevfd(){
    var divs = document.getElementsByTagName("div");
    for(var x = 0; x < divs.length; ++x)
        if(divs[x].className.indexOf("vfd") != -1)
            divs[x].style.display = "none";
    document.getElementById('footer').style.display = 'none';
}

function showvfd(){
    var divs = document.getElementsByTagName("div");
    for(var x = 0; x < divs.length; ++x)
        if(divs[x].className.indexOf("vfd") != -1)
            divs[x].style.display = "";
    document.getElementById('footer').style.display = '';
}

function addlilink(tabs, url, name){
    var na = document.createElement('a');
    na.href = url;
    na.appendChild(document.createTextNode(name));
    var li = document.createElement('li');
    li.appendChild(na);
    tabs.appendChild(li);
    return li;
}

function vfdlinks(){
    var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
    if(document.title.indexOf("Wikipedia:Articles for deletion") == 0){
        addlilink(tabs, 'javascript:hidevfd()', 'Hide');
        addlilink(tabs, 'javascript:showvfd()', 'Show');
    }
}

if (window.addEventListener) window.addEventListener("load",vfdlinks,false);
else if (window.attachEvent) window.attachEvent("onload",vfdlinks);
Added by ABCD
This should be improved by saving a 7-day cookie as to the hidden or shown status of each VFD --jnothman talk 02:01, 2 November 2005 (UTC)[reply]

Afd helper

A script to speed up voting on AFDs. See afd helper. Feedback needed.

WikiDiscussion Manager

This is a tool for posting your opinion on discussions on Wikipedia. Currently only AfD is supported, more are coming. WDM. This is a console app using .NET and C++.

Regex: change heading levels

The following may seem trivial for Unix-experienced people, but a collection of ready to use regular expressions can help people who don't know anything or much about regular expressions. For these people: You can use regular expressions in many editors to perform complex editing tasks.

This will give the headings more (or less) equal signs ("="). I can only provide a version which is verified to work in Eclipse, but it will work in many text editors which feature Unix-style regular expressions.

Please change the expressions only if you are very, very sure that it will work correctly, say you have tested that it works.

Verified in Eclipse

Search-string:
^=(=*?)([^=]+?)(=*?)=\s*$
For more equal signs replace with:
==$1$2$3==
For less equal signs replace with:
$1$2$3
To balance right equals signs to left:
=$1$2$1=

Hints for text editors not mentioned

In other editors the replace strings will have to be different:

For more equal signs replace with:

==\1\2\3==

For less equal signs replace with:

\1\2\3

Footnote renumbering tool

If you have a page with many footnotes ({{Fn|...}} and {{Fnb|...}}), and they're all in the wrong order, this script could be useful. Written in Python, tested on a Linux system with Python 2.4.

User:Skagedal/Footnote renumbering tool

Extra edit page buttons

For extra edit page buttons, put the following code in your skin.js.

{{subst:js|User:MarkS/extraeditbuttons.js}}

The buttons include: left aligned text, sub-script, super-script, insert table, insert quoted text.

More details can be found at User:MarkS/Extra edit buttons.

Units of measure formatting and conversion tool and date formatting tool

User:MJCdetroit/monobook.js is a monobook tool that allows many common units to be correctly formatted (e.g. km² and not sq km) and converted between metric and imperial/U.S. customary systems with one click on a 'units' tab in edit mode.

Dates can be delinked and common errors associated with can be corrected with one click on a 'dates' tab in edit mode.

Units and dates can be combined by clicking the 'combined' tab in the edit mode.

To avoid false positives, editors can/should review the changes offered and accept or reject the changes offered and/or do more editing before pressing 'Save'. Simply add importScript("User:MJCdetroit/monobook.js"); to your own monobook. Follow the instructions in your monobook to clear the cache (i.e. press Ctrl-Shift-R in Firefox, or Ctrl-F5 in IE) before it will work. —MJCdetroit (yak) 20:32, 21 July 2008 (UTC)[reply]

Wiki Welcome

// A small piece of JS written by [[User:MatthewFenton]], This is my first piece of JS.
function welcome() {
    if (document.title.indexOf('Editing User talk:') == 0) {
        document.editform.wpTextbox1.value = document.editform.wpTextbox1.value + '==' +
          'Welcome' + '==\n' + '{{subst:User:' + 'MatthewFenton/Welcome}}\n~~' + '~~';
        document.editform.wpSummary.value = 'Welcome a user to Wikipedia using JS WW';
    }
}
function welcome_tab() {
    add_link('javascript:welcome()', 'Welcome');
}

if (document.title.indexOf('Editing User talk:') == 0) {
 addOnloadHook(welcome_tab);
}

The code adds a tab when you are on user talk pages, you can then click it to add a welcome template and then save. A little time saver for me i thought I would share. Matthew Fenton (contribs) 16:25, 12 July 2006 (UTC)[reply]

Image tagging tools

Script for quickly tagging images as lacking source, licensing, or fair use rationale. Also simplifies nominating images for deletion:

User talk:Howcheng/quickimgdelete.js

Labelled Image Editor

The Labelled Image Editor is a Java tool that creates and edits labelled links for an image. Useful for creating clickable maps like Template:United States Labelled Map. http://mujibab.googlepages.com/labelledimageeditor

CSDHelper

A Greasemonkey script to add a menu with common WP:CSD criteria next in the form that appears when deleting articles. It saves time and provides more meaningful deletion reasons in the logs. Can be included directly into monobook.js with basic modification. It is available at User:Chairboy/csdhelper.greasemonkey.js. Wikipedia administrator access required.

AFD Organizer

An application used in AFD discussions. Loads a list of all the recent AFD's, and then pre-loads several useful pages when opening an AFD, saving valuable time and energy.

Notes

  1. ^ http://article.gmane.org/gmane.science.linguistics.wikipedia.technical/55686
  2. ^ Note: You may want to alter this Microsoft Word visual basic editor code so that Word H1 tags become Wiki H2 tags, H2->H3, and so on. H1 is widely considered the title of a web page, whereas H1 is widely considered just the top-level heading in Word.
    Note: this macro also provides a workaround converting linebreaks from word to paragraphs in wiki – line breaks in word are ignored in wiki so everything runs together in one paragraph in the older version of this code. Additionally, the code no longer makes any changes to the source document. Changes are made on a document in memory and put on the clipboard for pasting into the wiki text area.

See also