Menu

Overview

Martin Hofmann

Project zmarkup overview

Background

The 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.

Goals

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:

  • HTML,
  • XHTML,
  • SGML,
  • UCS text in the "canonical" form defined in the Standard,
  • plain text that uses Unicode box-drawing characters to render Z schema boxes,
  • Rich Text Format (RTF),
  • LaTeX source text.

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.

Components

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.

Features

Up to now (2014-02-09), there are two translating tools:

  1. zhtml: Converts e-mail mark-up into HTML (a HTML fragment).
  2. 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.

Plans

Many :-)


Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.