Zoglair Markup Language

ZML is a special notation used for writing rich text, with both formatting and content generation capabilities. This is the default markup language used all over zoglair. In fact, after a response is completed - no matter the type of it (HTML, CSS, JSON, etc) - is ZML parsed just before output. That makes it possible to use ZML literally everywhere, not only in plain text input but also in templates, even in arbitrary database columns!

Why not HTML?

The need for an intermediate markup language came from the fact that HTML is just too dangerous to be used directly. Traditionally, direct HTML input is only enabled in privileged accounts, so that they can build pages that cannot be built otherwise. Unprivileged accounts, such as simple forum members and blog commenters, are not given this option because it is too much of a security risk. Instead, they are given the option of using some form of a special syntax so that they are able to format their postings. The most popular one is BBCode which is used in hundreds of thousands sites, mainly because it is the de facto syntax in forum scripts. There are, however, a lot of alternatives, such as Markdown and DokuWiki from which ZML was inspired.

Why ZML?

The reason why ZML was chosen - instead of the trusted, well known and popular BBCodes - is because of its natural syntax (for common cases, at least) that makes text appear as readable as possible. BBCodes are too verbal to seem natural. They are similar to HTML tags, using square brackets [] in place of inequality symbols <>.

Let us take bold text for example, one of the most common formatting markup. In BBCode one should enter:

[b]bold text[/b]

...while in ZML

**bold text**

Less characters to type, easier to enter and - most important - it seems familiar (and thus natural) as this is the standard way to emphasize text on systems that lack formatting capabilities.

If the above example is not convincing, let us see another one, an unordered list of items:

» BBCode
     [list]   
     [*]Item 1
     [*]Item 2
     [/list]  
» ZML
     - Item 1 
     - Item 2 

As you can see, the ZML syntax is so clear that does not even seem as a “syntax”!

ZML parsers

ZML, in its whole, is implemented through the following parsers, run in the exact order they are listed here:

The first one, text, is applied to whatever database column is designated as such and used for your content, such as the Sitemap, Article, Product, Post, etc, text columns. The rest are applied to the whole output, including your texts.

This means, for example, that links inside phrases will work as expected. Text formatting inside phrases, however, won't!

All parsers, except text, deal with a single set of opening/closing tags. Text is the only parser supporting various tags, for various entities, as explained in the following chapter.

« Schema Text »
(C) Nick B. Cassos - All Rights Reserved
powered by zoglair
page generated in 27ms (11 queries, 5ms)