Linux Online
[ Register ]

[ Applications ]
[ Documentation ]
[ Distributions ]
[ Download Info ]
[ General Info ]
[ Book Store ]

Advertisement

[ Courses ]
[ News ]
[ People ]
[ Hardware ]
[ Vendors ]
[ Projects ]
[ Events ]
[ User Groups ]
[ User Area ]

Automating Unix and Linux Administration

[ About Us ]
[ Home Page ]
[ Advertise ]

Lesson: Using a Wiki

Putting the Wiki to Work

Now that we've got our Wiki software running, it's time to get all those things we want to look at from time to time into it. We're going to have to learn a few rules about how wikis work in general and how the engine we've chosen works in particular.

Formatting in a Wiki

I'll go into a bit more detail here on formatting text and links in a wiki. As I mentioned before, the real advantage to a wiki is that you don't have to know anything about HTML markup to create a web site. This is the main reason why so many wikis are now in place. These are mostly providing internal documentation for organizations of all kinds. Anybody can lend a hand in documenting procedures for companies, writing FAQs or creating knowledge bases. You don't have to wait for the "webmaster" to get around to posting it so you increase productivity. Anyway, enough about the advantages of it. Let's start putting information into our wiki.

First, what you want to do is go in and create your first page. This can be done by editing the home page provided for you by your wiki engine. As I chose PmWiki for mine, this is what I'd do to create my first page. Click on the 'Edit' button and enter somewhere:

This is my {{first page}}

Now, save the page and you should see what you wrote with a question mark (?) at the end. This means that 'first page' is a link to a page waiting to be created. Click on the question mark and you will go directly to an edit field, ready for you to insert content. Now here's where you get to learn your wiki engine's text formatting rules. But don't worry, the learning curve is not very steep.

Let's enter something like this:

This is first of a series of other pages which I hope will all be '''wonderful'''.

By putting the word wonderful inside three single quotes, PmWiki will display that word in bold text on a page. Again, as I mentioned before, it's not excessively difficult to learn how to create bold text in HTML, but the wiki engine will do it for you.

Other types of formatting that are more difficult in HTML are made much easier in a wiki. For example, to create a bulleted list, you would simply put asterisks before the items:

Wikis are good for:

* creating collaborative websites
* maintaining internal documentation
* keeping track of personal notes, etc.

And this will output as a bulleted list. If it wanted a numbered list, you would substitute the asterisk for the pound sign.

One of the main reasons I use a wiki is to keep track of little Linux tips and tricks I find out there, like one-liner Bash or Perl tricks. I use the teletype or monospaced format a lot for these. For example, I create a page with PerlSubstituteText. Then I type the explanation and the one-liner like so:

Substitute text in a file with Perl

@@perl -pi -e 's/cookie/biscuit/g' file@@

This overwrites the file, so be careful

So I can see clearly what I have to put on the command line as opposed to what are my comments or explanations.

You can also create report-style headers very easily. These are what corresponds to the h1, h2, h3 headers in HTML. For example, if I were writing some comments about my favorite cars, I could use a markup like this:

!My Favorite Cars

!!Ford Motor Co.

!!!Mustang

!!Renault

!!!Renault 4

There are of course, more formatting options. PmWiki has a generous amount of documentation that gets incorporated into your wiki. A lot of this deals with style and formatting and it worth a close read before you start loading your wiki with information.

The Advantage Is in Linking.

It's the linking process where you start to see the magic of using a wiki. We saw above that curly brackets will create links in PmWiki. There is also another method to do this. It's known as CamelCase.

This is my page on LinuxConfiguration

Unlike the other example, we don't have to put curly brackets around the 'LinuxConfiguration'. This is an example of CamelCase. CamelCase simply means that we combine two or more words, each of which start with a capital letter (the capitals represent the humps of a camel). In most wiki engines, this starts a link. This can have certain pitfalls. There are some words and abbreviations (OpenOffice, MySQL, PhD) that will be automatically converted into links in a wiki. If you just want to use the term OpenOffice in a page but not create a link, you could use this markup to just show the term:

I have migrated from Microsoft Office to [=OpenOffice=]

If you want to create links to pages out on the WWW, just put the URL into the page. A link will be created automatically.

Groups in Your Wiki

One of the main reasons that I decided to use PmWiki is that it has the ability to divide the wiki up into groups. That's a real plus when it comes to organizing your information. When you install it, there is one group by default, called 'main'. That is, if you created a page called 'FirstPage', it would become part of the 'main' group. But let's say you wanted to create a new group called 'Linux' where you, like me, could start creating pages about Linux configuration and use. On the 'main' group's home page you would choose 'edit' and write something like this:

Linux tips and tricks in the [[Linux/{{homepage}} Linux section]]

The forward slash following a word creates a group out of that word. The name of the page you want to create in that group comes after in the curly brackets. Outside of the curly brackets but still inside of the square ones is what the visible link is going to look like. In this case, whoever looks at the wiki will see 'Linux Section' as a link.

The only drawback to groups is that you have to remember that when you create a simple link either by the {{curly bracket}} method or the CamelCase one, you're creating a new page inside that group. Let's say you've got a group called 'Personal' and you've put some reminders in there. Let's say you have one that says: Take a look at the new version of OpenOffice. If you want to start a new page for OpenOffice in your 'personal' group then you're all set. If you want to refer to an existing page on OpenOffice in your Linux group, then you would write this in the edit field:

Take a look at the new version of Linux/OpenOffice

The 'Group/Page' scheme creates a link to the already existing page in the other group. This will not create a non-existing page in another group, though. You need to use the link scheme above to do that.

The group system also makes searches easier. In the search field, enter Group/search term to look for that particular term in a specific group.

Organize your Personal and Professional Life

There is a calendar plug-in available for PmWiki as well as for many other wiki engines. I installed it and I am using it right now. This is not a substitute for personal information managers and their shared calendars but if you're looking for something you can add to and consult quickly, this is a good idea. If you're setting up the wiki for a project where a group is collaborating, then this might come in handy for writing down deadlines or other dates that are important for the group. The tarball and installation instructions are here: http://www.pmwiki.org/wiki/Cookbook/WikiCalendar. Installation was fairly straight forward, though I did have a small gotcha. I had to create a directory in /local, called 'scripts' and copy the file wikilog-i18n-en.php to it in order to get the plug in to work. [1]

Notes

[1]

Installing the calendar also broke some alternative forms of linking. In particular, the creation and linking to groups with a period instead of a forward slash: (i.e. {{Group.page}}) I haven't been able to see any reference to this happening on PmWiki's homepage.




Comments: feedback (at) linux.org
Advertising: banners (at) linux.org
Copyright Linux Online Inc.
Compilation ©1994-2008 Linux Online, Inc.
All rights reserved.