Re: The Mysterious ZEML
- From:
- Frederik Elwert
- Date:
- 2010-08-16 @ 16:41
- Subject:
- Re: The Mysterious ZEML
Hello,
Am Montag, den 16.08.2010, 00:20 +0300 schrieb Artem Egorkine:
> At the heart of Zine lies the mysterious ZEML markup language. Creole,
> RestructuredText, Markdown parsers create HTML, which, as far as I
> understand, is a subset of ZEML. Since it is not really documented
> anywhere, I decided to ask the community, do you know what exactly
> ZEML is and what advantages does it provide over HTML? And while on
> the subject, does anyone use it as they primary Zine markup?
I only looked into Zine recently, so I might be mistaken, but I’ll have
a guess about what ZEML is: ZEML is the “Zine Extensible Markup
Language”. ZEML is XHTML for people that dislike the X: You can add
arbitrary elements to the language without caring about namespaces and
so on. A good example is the pygments plugin: It adds a <sourcecode> tag
with a "syntax" attribute that allows to add highlighted source code to
blog posts. Zine will then convert this into valid HTML by translating
the sourcecode tag into something a web browser understands (divs and
spans and so on).
Internally, ZEML provides an API similar to ElementTree (as stated in
[1]). You can even parse normal HTML into a ZEML tree using the html5lib
parser.
I currently don’t use ZEML but reST, because of the LaTeX/PDF output.
But ZEML is nice if you want to allow users to use basically HTML with
some handy extensions.
Cheers,
Frederik
[1] http://dev.pocoo.org/projects/zine/browser/zine/utils/zeml.py
Re: The Mysterious ZEML
- From:
- Kiran Jonnalagadda
- Date:
- 2010-08-17 @ 04:45
- Subject:
- Re: The Mysterious ZEML
On 16-Aug-2010, at 10:11 PM, Frederik Elwert wrote:
> ZEML is XHTML for people that dislike the X: You can add
> arbitrary elements to the language without caring about namespaces and
> so on. A good example is the pygments plugin: It adds a <sourcecode> tag
> with a "syntax" attribute that allows to add highlighted source code to
> blog posts. Zine will then convert this into valid HTML by translating
> the sourcecode tag into something a web browser understands (divs and
> spans and so on).
All parsers convert markup into ZEML, which is the cooked database format. Pages are rendered from ZEML to HTML.
The most useful tag ZEML provides is <intro>. If you use this to markup the first part of your post, Zine will hide the rest of the post except on the post's permalink page.
The markdown parser will convert Wordpress-style <!--more--> on a line by itself into an intro tag for everything preceding it.
Kiran