Wikipedia:Text editor support

From Wikipedia, the free encyclopedia.

Jump to: navigation, search

It is often convenient to edit Wikipedia articles using a full-fledged text editor, instead of the text area of a web browser. Text editors provide facilities that are very useful for writing articles (especially long articles), such as spell checking, search and replace, macros, and syntax highlighting. This article contains pointers for adapting several text editors to writing Wikipedia articles.

Contents

How to open articles in your text editor

Mozilla and Mozilla Firefox

If you are using the Mozilla web browser, it is possible to configure an external editor for editing wikipedia articles without copying and pasting them from the browser's text area. To achieve that, you need to download and install the "MozEx" extension at http://mozex.mozdev.org/, and follow a quick MozEx tutorial.

As of September 2005, the "MozEx" version at the address above does not work properly on Mozilla Firefox 1.0, however, a repackaged version which works is available at extensionsmirror.nl.

You can try using ViewSourceWith which provides similar functionality for the later versions of Firefox.

Other useful extensions are the external editor and the Wikipedia extension for Firefox. The latter makes editing Wikipedia pages easier by adding a toolbar to your browser and by providing new menu items in the context menu (right mouse key).

External editor feature starting with MediaWiki Version 1.5

See here: http://meta.wikimedia.org/wiki/Help:External_editors

Textbrowsers

The text-only browser elinks also provides a function to edit Textarea. The Key combination Ctrl-T calls an external Editor, e.g. vim. This allows also to use syntax highlighting, edit functions, spelling corrections and saving local copies. Another text browser, w3m, opens an external editor for textareas by default.

Command line tools

There are also a couple of command line tools that allow you to download articles, edit them using your favorite text editor, and upload the edited articles back into the Wikipedia. This bypasses the need for a web browser. These are:

How to use specific editors for Wikipedia editing

Eclipse

The Wikipedia editor plugin plog4u.org is available for Eclipse. With an automatically updating outline of the article. It has many features which are very helpful for editing wikipedia. It also downloads articles directly from Wikipedia and has highlighting.

Emacs

There are a couple of Emacs major modes available for editing wikipedia articles:

  • wikipedia-mode.el is a simple major mode that mostly provides syntax highlighting for wikipedia markup.
  • wikipedia.el is a much more advanced major mode which provides WYSIWYG editing of wikipedia articles. Note, however, that it is developed using the current CVS version of GNU Emacs, and may not be compatible with older versions. It is also in the alpha stage of development, so use it at your own risk.

You should also install longlines.el, which implements "word wrap" functionality for Emacs, since Wikipedia articles don't use line breaks. Installation instructions are here.

Vim

To make Vim support the MediaWiki markup used on Wikipedia, save Wikipedia.vim to your "syntax" directory. By default, this directory is "~/.vim/syntax" on a Unix system, and "C:\Program Files\Vim\vimfiles\syntax" on a Windows system.

To autodetect files ending in ".wiki", add the following lines to ".vim/filetype.vim" or "vimfiles\filetype.vim" (or create the file if it doesn't exist):

augroup filetypedetect
au BufNewFile,BufRead *.wiki setf Wikipedia
augroup END

Alternatively, the command "set syn=Wikipedia" will temporarily set the syntax for the current file.

Wikipedia articles often only have line-breaks at the end of each paragraph, a situation Vim doesn't handle gracefully by default. Save the following lines to "~/.vim/ftplugin/Wikipedia.vim" or "vimfiles\ftplugin\Wikipedia.vim" to make it easier (you may need to put "filetype plugin on" in your vimrc).

setlocal textwidth=0
setlocal linebreak
nmap <buffer> k gk
nmap <buffer> j gj
nmap <buffer> <Up> gk
nmap <buffer> <Down> gj
imap <buffer> <Up> <C-O>gk
imap <buffer> <Down> <C-O>gj
vmap <buffer> k gk
vmap <buffer> j gj
vmap <buffer> <Up> gk
vmap <buffer> <Down> gj

Please feel free to edit Wikipedia.vim and upload an improved copy.

jEdit

For jEdit there is a plugin available at http://www.djini.de/software/mwjed/ . Apart from providing syntax highlighting for wikipedia markup, it can communicate directly with the Wikipedia website using the HttpClient component from the Jakarta Project.

Kate

For Kate (for Linux' KDE desktop), rules for syntax highlighting are provided by the XML file de:Media:Wikimedia.xml. It recognizes HTML tags and entities, wiki control characters, links, section titles, tables and <nowiki> sections.

To install this template, copy it to ~/.kde/share/apps/katepart/syntax/ for per user settings or $(PREFIX)/share/apps/katepart/syntax/ for global settings. There's also an import tool : Settings → Configure Kate → Highlighting → Download.

SubEthaEdit

A syntax highlighting mode is available for SubEthaEdit as well. After downloading the mode bundle, drop it in /Library/Application Support/SubEthaEdit/Modes/ (system-wide) or ~/Library/Application Support/SubEthaEdit/Modes/ (user-specific). You may need to create the final two directories by hand. The mode will be automatically selected for files with a .wiki or .wikipedia extension.

NoteTab

A Clip Library plugin for the NoteTab text editor contains some functions to automate Wiki markup.

See also

Personal tools
In other languages