EmacsWiki

screenshot of emacs

emacs-wiki.el is a wiki major mode for emacs, which aims for implicit and natural markup.

(see the WikiMarkup rules, or this page's source: EmacsWiki.txt)

Some of its features include:

Emacs-wiki was written by John Wiegley, and is currently being maintained by .

If your are interested in modes like emacs-wiki, you may also like to read TheEmacsWiki:MarkupModes

Getting EmacsWiki

Up to date details on EmacsWiki are available at .

Old releases

v2.40 - updated 01-Jul-2003 (the development branch is far more up-to-date, so grab this if you can!)

v2.38 - updated 24-Nov-2002

If you have any difficulties with the latest stable release, you can try this older version instead.

Download: emacs-wiki-2.38.el.gz

You can read about the changes in ChangeLog.old.txt - though this release coincides with CVS version 1.11, so anything above that is only available in the development release.

Contributions

If you're doing something interesting with emacs-wiki and would like to share it with others, I'm happy to link to it here.

Wiki menus (Tables)
Jean-Philippe Georget contributed a package which shows you how to create a uniform menu across the different pages of your site. The package includes a README and an example of the generated pages in webwiki and webwiki-css. Grab it here.
Wiki menus (CSS)
Jody Klymak has modified Jean-Philippe's code to use CSS instead of tables, which copes a little better with tables which go off the screen. Grab it here.
Auto-generated image galleries and file listings
Mark Triggs has a page dedicated to the elisp code he's written for embedding in wiki documents. There's some nifty code here to generate pages which would be laborious to create manually.
RSS syndication
Hugo Haas has written some to publish an RSS document each time you publish a wiki project.
More information
Jorge Lehner has some information on emacs-wiki and planner-mode at his site here.

FAQs

How do I open an extended link or edit a lisp tag?
How do projects work?
How do I use the TAB key in emacs-wiki?
Is it possible to preview a page?
Can I publish remotely?
How do inlined images work? What about with publishing?
Can I define the header and footer in files?

How do I open an extended link or edit a lisp tag?

You can either hit backspace to reopen the construct, or use C-c C-l to toggle the lisp or tags being marked up.

How do projects work?

Projects allow you to organise your information into logical "units". For instance, this web site is a wiki project with a different publishing location and source directory, with different publishing headers and footers. My work wiki has a smaller fill-column. An example to get you started:

(setq emacs-wiki-projects
      `(("default" . ((emacs-wiki-directories . ("~/wiki"))))
        ("work" . ((fill-column . 65)
                 (emacs-wiki-directories . ("~/workwiki/"))))))

You can use C-c C-v to switch projects, or use interwiki links (see WikiMarkup).

How do I use the TAB key in emacs-wiki?

TAB is bound by default to move to the next wiki link. If you just want to insert a single tab, you can type C-q TAB. Otherwise you can change the definition of tab in emacs-wiki-mode-map.

Is it possible to preview a page?

Sure. Try these:

(defun emacs-wiki-preview-source ()
  (interactive)
  (emacs-wiki-publish-this-page)
  (find-file (emacs-wiki-published-file)))

(defun emacs-wiki-preview-html ()
  (interactive)
  (emacs-wiki-publish-this-page)
  (browse-url (emacs-wiki-published-file)))

Can I publish remotely?

Currently tramp doesn't like trying to calculate the file modification differences between a local and remote host - so if you wish to publish an entire wiki, you'll need to keep it all locally or remotely.

I tend to publish individual files when I update them, rather than publishing in a batch, which works around this. I also bind C-x C-p to emacs-wiki-publish-this-file.

An alternative work-around would be to comment out the modification check in emacs-wiki-publish.

How do inlined images work? What about with publishing?

To inline an image into your document, use something like

[[./myimage.png]]

The ./ is necessary because otherwise it won't be recognised as a link. But don't put the image in the same directory as all your wiki files, since then emacs-wiki will try and publish the image when it publishes your files (and it doesn't yet know the difference between a normal file and an image), so you end up with myimage.png.html.

So say you create an "images" subdirectory. Your link could then be:

[[images/myimage.png]]

By default, emacs-wiki looks in the publishing directory to find the images. This makes sense when both the wiki files and publishing dir are on the file system, but it is also possible to publish via tramp. If you want to do the latter, set this variable to try and locate the images relative to the wiki page:

(setq emacs-wiki-inline-relative-to 'default-directory)

The only remaining issue is how to get the images to be published when you publish your wiki pages. At present, you can try the following lisp on your WelcomePage:

(when emacs-wiki-publishing-p
       (ignore (shell-command "scp -r images webserver:/var/www/")))

Or via FTP:

(when emacs-wiki-publishing-p
       (ignore (shell-command "ftp ftpserver.domain.name << EOF
cd wikidir
mkdir images
prompt
mput images/*
EOF
")))

Every time you publish the project with C-c C-p the images will be updated.

Can I define the header and footer in files?

Sure. Try something like:

(setq emacs-wiki-publishing-header "(my-publishing-header)")

(defun my-publishing-header ()
    (if (file-readable-p "header.wiki")
        (ignore (insert-file-contents "header.wiki"))
      "this is the default header text, if the file can't be found\n"))

That will look for a file named 'header.wiki' in the same directory as the wiki page, and insert it. If it doesn't exist, the default text is inserted instead.

Need help?

There is an emacs-wiki discussion list dedicated to discussion of emacs-wiki, planner and related modules. The details of this list are available .

Documentation


Back to the Homepage.
Damien Elmes -