zmarkup
overviewThe Z Notation is a formal specification language defined in the International Standard ISO/IEC 13568:2002. (The Standard is freely available from ISO as a zipped PDF file. Also freely available is the current Technical Corrigendum 1 of 2007.)
Z is a model-based specification language in the same family as VDM-SL, the Abstract Machine Notation (AMN) of the B-Method, or the RAISE specification language. Of all formal specification languages used in software development, it is probably the most popular, with several text books and a range of tools supporting it available.
The language itself is defined in the Standard with reference to Unicode, a conforming specification is a "plain" text using this Universal Character Set (UCS).
Because such text files contain plenty of mathematical symbols, they are cumbersome to write with a computer keyboard. A practical way to do this is to write the document in a "mark-up" of the Z notation, where symbols are denoted with strings of (ASCII) characters.
The Standard provides two such mark-ups: One is to use the source text conventions of [LaTeX]; the the resulting specification can readily printed as a high quality hardcopy. The other convention is the so-called "e-mail mark-up". It too requires only ASCII characters and, as the name implies, is intended for human communication via low-resolution devices like e-mail. But it can also be processed by computers.
Compared to the LaTeX mark-up, the e-mail variant of mark-up is much shorter and in my opinion easier to type and read using a plain text editor.
The intent of this project is to develop some portable, small and simple tools to process e-mail mark-up into other forms of documents. Here is a list of desirable target formats:
Of special importance is the ability to combine Z notation in e- mail mark-up with another syntax convention which fits nicely: the Markdown format is a simple plain text format orignially intended to be converted to HTML (many Wiki sites, including sourceforge.net
Wikis, use it). Conversion to other formats is supported by eg. MultiMarkdown.
The core of the tools is a small library that parses input text into a stream of UCS characters. Client tools use this character stream to build up their specific output format.
The binding between clients and the core library is intended to be very genral and adaptable: Clients provide callback functions to the core translation function, and the core uses these functions to get new input characters as well as to get rid of produced output characters.
Up to now (2014-02-09), there are two translating tools:
zhtml
: Converts e-mail mark-up into HTML (a HTML fragment).ztext
: Converts e-mail mark-up into various plain text formats.Translation to HTML either generates style
attributes in the output HTML tags, or generates class
attributes to reference a style sheet (CSS). The zhtml
tool is also usable as a preprocessor to a Markdown processor. A whole HTML document can be in this manner generated from a Markdown source text with interspersed Z notation.
The text translator generates a specification in the "canonical" form as UCS text (in UTF-8), or uses box-drawing characters to render Z boxes in the output Unicode text.
Many :-)