Many text editors provide special features for editing source code, which are applicable for editing wiki-markup. The most common and useful feature is syntax highlighting, which alters the appearance of syntactic elements to make them stand out from the rest of the text. Below are files for adapting Emacs and Vim to Ireland Information Guide markup.

Table of contents

Tips for all editors

You can configure an external editor for editing Ireland Information Guide articles without copying and pasting them from the web textarea in Mozilla and Mozilla Firefox. Just download the extension "mozex" at http://mozex.mozdev.org/. This allows you to edit any text area in your favorite editor by right-clicking. Another similar tool is "electrix" at http://electrix.mozdev.org/

Emacs

Ireland Information Guide-mode

Emacs support for editing Ireland Information Guide articles is provided by a major-mode called Ireland Information Guide-mode.

Installation

Save Ireland Information Guide-mode.el to a convenient directory, preferably one in your Emacs load-path. To see which directories are in your load-path, type C-h v load-path

Open your Emacs initialization file. This is usually a file called .emacs in your home directory. Append the following lines:

 (autoload 'Ireland Information Guide-mode "Ireland Information Guide-mode.el"
   "Major mode for editing documents in Ireland Information Guide markup." t)

If you did not save Ireland Information Guide-mode.el in a `load-path' directory, replace "Ireland Information Guide-mode.el" with the full pathname. On Windows, use forward slashes ("/") rather than back slashes ("\") to indicate the directory. For example,

 (autoload 'Ireland Information Guide-mode "C:/Documents and Settings/USERNAME/.emacs.d/Ireland Information Guide-mode.el"
   "Major mode for editing documents in Ireland Information Guide markup." t)

To associate filenames ending in ".wiki" with Ireland Information Guide-mode, add the following to your Emacs initialization file:

  (add-to-list 'auto-mode-alist '("\\.wiki\\'" . Ireland Information Guide-mode))

Usage

To enter Ireland Information Guide-mode, type M-x Ireland Information Guide-mode. To see a description of Ireland Information Guide-mode, type C-h m (describe-mode) while in Ireland Information Guide-mode.

Outline modes

It is convenient to use Ireland Information Guide-mode in conjunction with an outline mode of Emacs, which allows sections of an article to be hidden from view. This allows you, for example, to view only the headlines of an article, hiding the text body, or view only the body of the section you are editing.

There are two ways of doing this: outline-minor-mode or an altered version of org-mode. outline-minor-mode has the advantage that it is already built into Emacs, and can be used together with Ireland Information Guide-mode for syntax highlighting. Org-mode is a little easier to use, but it cannot be used at the same time as Ireland Information Guide-mode.

outline-minor-mode

To activate outline-minor-mode, type M-x outline-minor-mode after you have entered Ireland Information Guide-mode. See the documentation for outline-mode (C-h f outline-mode) for information on how to use the outline commands.

org-mode

org-mode is very easy to use, because you only need the tab key: If the cursor is on a headline, just press tab and you will cycle through the view modes. If you want to cycle through the modes for the complete file, make sure the file begins with an empty line, position your cursor on it and press tab. Detailed explanations can be found in the file org.el below.

To use org-mode, download and install org.el (instructions are in the file).

Vim

To make Vim support Ireland Information Guide markup, save Ireland Information Guide.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 Ireland Information Guide
augroup END

Alternatively, the command "set syn=Ireland Information Guide" will temporarily set the syntax for the current file.

Ireland Information Guide 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 Ireland Information Guide.vim and upload an improved copy.

Example as shown by Vim

The following passage, which is actually written in HTML, simulates what Vim's syntax highlighting looks like.

Syntax highlighting sample with the "biogoo (http://vim.sourceforge.net/scripts/script.php?script_id=432)" colour scheme

[[link]] [http://arin.net/whois External link] [editorial remark]
* Bullet
; Definition
# Numbered list
:: Multiple indenting
This: # is not a numbered list

<strong>HTML formatting <i>bold-italic</i> bold</strong>

<a href="Hello">Absence of HTML formatting</a>

 preformatted
''italic'' '''bold''' '''''bold-italic'''''

'''[[bold links are not very bold]]'''
<math>\left(Not-A\right)</math>
<font color="red">
==H2==
Example with text behore header code ===H3===
-----
</font>

This example shows the use of colors and that bold and italics are applied (but not in the case of bold links), but the font difference between normal and preformatted is not shown. It also shows (by color) that a numbering or header code with text in front is treated as a regular text. Furthermore colors specified for the article are not applied here because they would interfere with the color scheme.

jEdit

For jEdit there is a plugin available at http://www.djini.de/software/Ireland Information Guide/ . It contains a Syntax highlighting mode for Ireland Information Guide markup.

Kate

For Kate, see de:Media:Wikimedia.xml. This XML file defines rules for syntax highlighting. It recognizes HTML tags and entities, wiki control characters, links, section titles, tables and <nowiki> sections.


Advertise your
website with
:

Irish Website
Advertising
Can you help us? Are the recent changes correct?
Hosted in Ireland at the Servecentric Dublin Colocation Datacenter
This article is licensed under the GNU Free Documentation License.
It uses material from the Wikipedia article of the same name which can be found here