What is it?

Tibia is an in-browser editor for web pages. It allows you to quickly and easily modify the content of your web pages. It allows you to directly view, edit, and save files on your webserver. It also allows you to upload files from your local filesystem to your webbrowser, and then edit those documents. It also allows you to grab web pages from other websites and save them on your server, and then edit those. Demo is available here; log on as "guest"/"guest" or "admin"/"yammer".

The name

"Tibia" comes from the acronym T.B.A. = To Be Authored or To Be Added. The tibia is also your shin-bone, the second-longest bone in your body. Hence the white-on-black color scheme, reminiscent of Halloween skeleton costumes.

The history

Tibia was written by Robert Brewer in late 2004 for Amor Ministries. Amor needed a generic CMS tool which would allow non-geeks to update content on multiple diverse websites on a regular basis.

Requirements and known issues

Different web browsers have different issues, which are described in detail here. We recommend the Firefox browser, since it has the least number of problems (none so far ;).

IMPORTANT: almost all browsers cache pages unless you explicitly tell them otherwise. If your browser is set to cache pages "automatically", you will run into serious problems very quickly--you will see older copies of the page you are editing, even though the server has your most recent edits. Bad news.

How do I...

...install Tibia?

Tibia comes in one small file. You install it by dropping it into the same folder where your web documents are stored (therefore, you usually save it on your webserver). You must have Python installed--get it at www.python.org. If you use a version older than 2.3, let me know if you have any problems. You also must have a webserver, like Apache or IIS. You need to configure your webserver to run tibia.py as a CGI script; Apache users may alternately use mod_python.

If you wish to use the image-resizing features of Tibia, you also need to obtain the Python Imaging Library from pythonware.com. PIL has a nice installer for Windows. If your webserver is running Debian Linux, just run apt-get install python-imaging. Other Unixen may need to build from source.

...edit a file on my server?


If you don't see a dropdown list of files, click the "Server" button on the Tibia toolbar. Pick one of the files in the list, and Tibia will load that document into the current window. Elements which you have permission to edit will be highlighted (bordered). You can change the style and color of the borders at any time by clicking on the "Border style" button on the Tibia toolbar (the borders won't be saved with your document).

You make changes to your document by double-clicking on the element you wish to modify. When you do so, Tibia will open a new window with the contents of that element, and allow you to edit. Just start typing! Your content will be changed in the document as you type, so you can see the effect of your changes right away.

Once you have finished making your changes, you need to save your document. Click the "Save" button. You will be prompted for a filename; the existing filename is provided for you. If the file already exists, you will be asked to confirm that you wish to overwrite the file.

...change the attributes of an element?

Edit the element. The edit window has two textboxes; one is a single line, and below that is the multiline textarea where you edit the content. The first line is where you set attributes for the element. Select the name of the attribute from the dropdown list, and then enter the new value in the single-line textbox.

You can add a new attribute to the element by selecting "(new element)" in the dropdown list. You will be prompted for the name of the new attribute, and Tibia will then add your new attribute to the dropdown list and select it for you.

...change permissions on an element?

If you are an admin, edit the element. The dropdown list of attributes (see above) will have a "tibia" entry. Select it, and enter the names of the users or groups who should have permission (separated by spaces) in the right-hand box. This means that, until you add users and groups to the element, nobody has permission to edit that element except an admin. If you are an admin, elements that have a "tibia" attribute will take the inverse color for their borders.

You define users and groups in the file "tibia.conf", in the same directory as tibia.py. See the example .conf file for the syntax. At the least, you need a [Groups] section, with group names as keys and a space-separated list of usernames as values. Make sure your own username is listed in the Admin row. If you do not create a tibia.conf file, or do not specify members for the Admin group, the Admin group defaults to *, meaning all users are Admins. Therefore, you should change this value right away.

...add a new element?

Every element on an HTML page is contained within some other element. Edit the element in which you wish to add the new element, and type in the HTML tags which create your new element. If you do not have permission to edit the parent element, talk to your admin; he or she probably doesn't want you to be able to add an element there.

...edit the html or head element (or their children)?

In your tibia.conf file, make an entry like the following:
Trunk Tags: base frame frameset

The "Trunk Tags" value defaults to base frame frameset head html, which blocks editing of those elements. When you remove html from the list, you allow the editing window to show html as an ancestor of body, which allows you to edit it.

...make a copy of a file?

When you edit a document and hit 'Save', you will be prompted for a filename, which defaults to the current filename. Simply replace the existing name with another. For real fun, try renaming a gif to a jpeg. ;) PIL is neat.

...visit a subfolder?

Select the subfolder name in the file list. You'll be shown the new path (to the left of the file list), and the file list will be refilled with the files in the subfolder.

To visit a parent folder, select the '../' option in the filelist. You aren't permitted to visit folders above the one in which tibia.py is located; you won't see a '../' option if you're looking at the root directory.

...delete a file?

Select the file you wish to delete from the filelist and hit the 'Del' button.

...delete a folder?

Navigate to the subfolder you wish to delete. Make sure the './' option is showing in the file list. Hit the 'Del' button. You won't be permitted to delete the root folder (the folder which tibia.py is in).

...make a new folder?

Whenever you save a file, you'll be prompted for a filename. If you wish to save "index.html" in a new subfolder called "myproject", just put the two together when prompted: "myproject/index.html". You can create any depth of subfolders in one step, and Tibia will create them all as needed.

...move all the files in folder X to folder Y?

Do I look like a for-profit software team of 40 people? Go back to FTP for complicated stuff like that. Tibia is a small webpage editor, not a website manager.

...resize an image?

Select the image from the file list. You'll receive a page where you can edit the size of the image interactively (in HTML). Once you have the size you like, hit 'Save' to make it permanent.

...upload a file?

Begin by clicking the 'Upload' button on the Tibia toolbar. This will expose a textbox where you can enter the name of the file you wish to upload. Most browsers will also provide you a "Browse..." button to help you find the file. Once you have located the file, click the "Save" button on the right. When prompted, enter a filename for the new file. If your document uploads successfully, Tibia will immediately update your file list and allow you to edit the new file.

...grab another webpage?

Begin by clicking the 'Web' button on the Tibia toolbar. This will expose a textbox where you can enter the name of the webpage you wish to grab. Hit Enter in that box to display that webpage within Tibia. You will not be able to edit it right away; first, you need to save it on your own webserver. Click the "Save" button and enter a filename when prompted. If your document is grabbed successfully, Tibia will immediately update your file list and allow you to edit the new file.

When you grab a webpage, Tibia attempts to localize it; that is, it tries to download any images, stylesheets, or javascript that are mentioned in the document. If successful, Tibia will change the references within the HTML of your new webpage to point to your new local copies of these dependent files.

...get support, request features, or gripe?

Shoot me an email at tibia@aminus.org. Bugs will be grudgingly tracked down and squashed. Patches welcome. New features which keep Tibia small and in one file will be enthusiastically pursued. If you use a different Python, browser, or server than those listed on the systems page, let me know.