ConRunner:Text editor support

From ConRunner
Revision as of 17:21, 6 July 2005 by ConRunnerAdmin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
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.

Tips for all editors

Mozilla and Mozilla Firefox

If you are using the Mozilla or Mozilla Firefox 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 the "MozEx" extension at http://mozex.mozdev.org/ and follow a quick MozEx tutorial.

The "MozEx" extension doesn't work properly on Mozilla Firefox 1.0. See http://www.emacswiki.org/cgi-bin/wiki/FireFox for a work around. Or just use the new ViewSourceWith extension instead (it works similarly): get it from within Firefox by selecting Tools / Extensions / Get More Extensions.

Update: extensionsmirror.nl now provides a repackaged version of MozEx which installs (you have to approve installs from extensionsmirror.nl when Firefox displays the info notice about it, then clicking again on install) and works flawlessly with Mozilla Firefox 1.0.

Another recent useful tool is the Wikipedia extension for Firefox, available at http://wikipedia.mozdev.org/. It 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).

Textbrowser elinks

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.

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:

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 wikipedia markup, 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 is not designed for. The following lines added to your ".vimrc" or "_vimrc" file will make it much easier to edit such files:

set textwidth=0
set linebreak
map <Up> gk
map <Down> gj
imap <Up> <C-O>gk
imap <Down> <C-O>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, 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.

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.

Eclipse

A Wikipedia Editor Plugin is available for Eclipse. After downloading the bundle, unzip it into the corresponding /plugins and /features subdirectory. The plugin will be automatically selected for files with a .wp extension.

NoteTab

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

See also

de:Wikipedia:Texteditor-Unterstützung pt:Wikipedia:Como editar com um editor externo