Getting Started With WikiText
Join the DZone community and get the full member experience.
Join For Freedocumentation is the bane of all developers. nobody likes to write documentation, but most people know we need it. even more so in open source projects. if you don't have a decent documentation, it will be hard to find contributors which will eventually stall the projects ability to acquire new committers.
while documenting code is discussed quite controversial (see here , here , here and here ), most people seem at least to agree that a high level documentation outlining the concepts of the software in question is appropriate.
the options to write high-level documentation are:
- word processors like word, openoffice, pages and the like
- latex
- docbook
- wikis
using word processors for writing high-level documentation has serious drawbacks, especially when a whole team needs to contribute to the documentation. do you remember master documents ?
latex is a great alternative, as it allows us to split documentation across several text files - this allows for efficient team work. moreover, text files just cannot break and can be versioned / merged / diffed quite easily. however, latex syntax is not for the faint of heart.
docbook is great, too: it uses xml to describe documents and has a great number of transformations to about every output format you could think of ( pdf , html , eclipsehelp , html help , javahelp and even man pages ! however, not everybody likes xml and in fact docbook tends to be a little noisy.
so this leaves us with wikis. they are great in many regards: you can write your documentation online, most wikis support versioning and diffing to a certain degree and most wikis have a decent collision detection that helps to work on documentation collaboratively. thanks to offline wiki editors for ides, we can even store wiki documents in local files.
enter wikitext
wikitext is such a tool. it actually is very flexible, as it allows you to use a multitude of wiki dialects to write your documentation. it also supports a number of output formats (html, eclipse help, dita, docbook and fop). what's more, it features a really nice text editor that can display wiki markup almost in a wysiwyg fashion. wikitext is developed and maintained by david green .
so, without further ado, here is a quick introduction on how to install wikitext, writing your first document and transforming it to html.
installing
make sure you have a recent version of eclipse installed. then:
- point your update manager ( help -> install new software ) to the mylyn update site (http://download.eclipse.org/tools/mylyn/update/weekly/e3.4)
- select the most recent version of mylyn wikitext (as of this writing, this is wikitext 1.1.0.i20090423-1700-e3x) and install
after the obligatory eclipse restart, you can start using the wikitext editor.
writing your first document
- create a new project ( file -> project... -> general -> project
- create a new file. we will be using the textile wiki syntax, so let's name it helloworld.textile
-
enter some text:
h1(#id). an html first-level heading
textile syntax is really simple. you can _emphasize_ text or *emphasize it even more*.
scaled images:
!{width: 50%}images/eiffelturm.jpg!
enumerations also are very easy:
* an item in a bulleted (unordered) list
* another item in a bulleted list
** second level
** second level items
*** third level
# an item in an enumerated (ordered) list
# another item in an enumerated list
## another level in an enumerated list
let's have more headings:
h2. an html second-level heading
here is a table:
|_. header |_. header |_. header |
| cell 1 | cell 2 | cell 3 |
| cell 1 | cell 2 | cell 3 |
h2. an html third-level heading
here is some code:
bc..
package org.eclipse.workflow;
public class workflow {
}
p. here is a plain old paragraph. it needs to start with "p." to mark the end of the code block above.
h4. an html fourth-level heading
of course, we can also have hyperlinks: "peter's homepage":http://www.peterfriese.de
h5. an html fifth-level heading
h6. an html sixth-level heading
- create a new subfolder images and place an image in his folder. i used this one.
you can always switch over to the
preview
pane, but you will notice that the source editor already does a decent job at rendering the text in a kind of wysiwyg manner:
transforming your document to html
in order to convert your document to a nicely rendered html document, just right-click on
helloworld.textile
in the package explorer and select
wikitext -> generate html
. this will create anew file
helloworld.html
in the same directory. double-click it to open it with a browser:
automating, pdf, splitting documents,...
i hope i could whet your appetite. in the next installment, i am going to show you how to automate the process of transforming wikitext documents into output documents, how to create pdf (by way of exploiting docbook) and how to split your documents into smaller chunks so you can work on them as a team. stay tuned!
Opinions expressed by DZone contributors are their own.
Comments