Skip to content
darryllawson edited this page Mar 30, 2012 · 10 revisions

Welcome to the gedit-twiki wiki. See the README for an overview of the project, the motivations for creating it and installation instructions.

Design Principles

Wiki syntax is good; it is an efficient way to write documents. The aim is to enhance the Topic Markup Language (TML) syntax, not to try and synthesise a WYSIWYG editor. That is, the aim is to highlight the markup, but not simulate the rendered output of TWiki/Foswiki. For example, *bold* should not necessarily be rendered as bold text in gedit.

The syntax highlighting does not need to look like a Christmas tree to be useful. That is, we don't need every single syntactical element to have a unique highlighting style or colour.

Design Decisions and Limitations

  • We classify the language as "Markup/TML (TWiki/Foswiki)" because wikis are commonly referred to as "lightweight markup languages", and the Topic Markup Language is used in both TWiki and Foswiki.
  • Highlighting errors is generally avoided for two reasons: 1/ There is not really such a thing as an error in wiki markup; it is just un-formatted text. For example, *bold, may seem like an error (that is, *bold is missing a trailing asterisk), but maybe that is what the user wants. 2/ The flashing red error highlighting as you type, which is what some other language definitions do, is annoying and distracting.
  • The <noautolink> does not prevent Wiki words from being highlighted, but it is highlighted as a HTML tag. Given the limitations of GtkSourceView, it is simply too cumbersome to implement it properly (it could be implemented with a lot of code duplication). If GtkSourceView had something like the <replace> element, but context sensitive, then it would be possible to implement.

Testing

The language definition is tested with a single text file test.tml, which features test cases for hopefully all aspects of TML.

gedit

gedit is the official GNOME text editor. The gedit wiki has some useful information, and a list of syntax highlighter bundles is available here.

TWiki

TWiki is an open source wiki platform. The TWiki Text Formatting Rules is the basis for this language definition.

Foswiki

Foswiki was forked from TWiki in 2008. Read all about it at http://foswiki.org/About.WhyThisFork.

GtkSourceView Language Definition

gedit uses GtkSourceView for rendering text and GtkSourceView Language Definitions are the mechanism for enabling language syntax highlighting. Language definitions are XML documents which employ a healthy dose of Perl regular expressions.

References:

Clone this wiki locally