Felix Breuer's Blog

OMeta in Qute - a first experiment

It has been quiet around Qute, my experimental editor project, for quite some time since I announced a rewrite of the code. Well, to be honest, the rewrite has not started yet. But I did get around to do some experimenting with the feature I am most excited about: The support for user-defined custom markup languages within Qute.

I will write more about the rationale behind this feature when it is more polished. Right now, I just want to give you a little heads-up on the latest rough-around-the-edges feature in Qute 0.4.1.

To define a custom markup language, you include an OMeta grammar right inside your document. Such a grammar might look like this.

An OMeta grammar in Qute

You can then tell Qute that any paragraph in your document is written in the custom language you just defined. Then Qute will transform that paragraph according to the rules specified in the grammar. In this example, we calculate the number 42 by way of OMeta.

Using the custom language in Qute

Qute 0.4.1 even supports some rudimentary error reporting.

An OMeta parse error in Qute

If you want to try this out for yourself, grab a copy of Qute 0.4.1 from here.

The next milestone is to make this do something interesting. For example, an implementation of Markdown in OMeta would allow the user to easily extend Markdown to suit his or her needs. This is something that I have been missing sorely while writing mathematics with Qute.

Comments