ULMUL (Ultra Lightweight MarkUp Language)

“ULMUL” is an original Ultra Lightweight MarkUp Language. ULMUL texts can be converted into HTML5 with “ulmul2html5” command and into LaTeX with “ulmul2latex” command. TeX style equations are converted into MathML. ULMUL is written in Ruby. You can also use ulmul.rb as a library.

Homepage of ULMUL: ulmul.rubyforge.org/

Download ULMUL from: rubygems.org/gems/ulmul or rubyforge.org/projects/ulmul

Features

* TeX style equations between two dollar marks ($) and between \Eq:foo and /Eq:foo
  will be converted into MathML. You can use Firefox4, IE9, etc. to read MathML.
* ulmul2html5 output is good with the Slidy presentation environment
  http://www.w3.org/Talks/Tools/Slidy/ using Firefox+CSS+XHTML+JavaScript.
  Please use ulmul-slidy.js and ulmul-slidy.css in the package.
* Figures, tables and code can be inserted to the document.
  They can be easily refered in the text.
* Lines starting from "#" are comments.
* You can add your conversion rules to @subs_rules.
* "Table of Contents" will be automatically generated.
* "= ABC EFGH" will be the document title and the cover page of Slidy.
* Use utf-8 for ULMUL texts.
  Specify your natural language with a --language option, e.g. --language=en.

Installation of ULMUL

Please use gem ( RubyGems rubygems.org/ ) for the installation.

$ sudo gem install ulmul

If you do not have the eim_xml, math_ml, aasm and exifr libraries, gem will download and install the libraries automatically.

How to write ULMUL texts

The encode of input file must be utf-8.

lines

Inside ulmul.rb, input lines are processed as “events” with aasm library rubygems.org/gems/aasm .

empty

Empty lines divide paragraphs.

heading

Starting with “= ”, “== ”, “=== ”, “==== ”, “===== ”, and “====== ”. “= ” will be used for the title.

asterisk

Lines starting with asterisks become itemizing list. For example,

# Nesting is allowed uo to 5th level.
 * First
   * Second
     * Third
       * Fourth
       * more for Fourth
     second continue
     * More for third
 * More for first

become # Nesting is allowed uo to 5th level.

* First
  * Second
    * Third
      * Fourth
      * more for Fourth
    second continue
    * More for third
* More for first

offset

Lines starting with some spaces but not asterisks become verbatim lines.

end

EOF or “=end” end the process.

ignore

Lines starting with “#” and “=begin” are ignored.

normal

Other lines.

Other rules

* Lines after "=end" are ignored.
* Add your substitution rules to @subs_rules.

Equations

Input:

Mass $m$ can be converted into energy $E$ as
\Eq:Emc2
           E=mc^2.
/Eq:Emc2

Output:

Mass $m$ can be converted into energy $E$ as Eq:Emc2

E=mc^2.

/Eq:Emc2

To view the equations in MathML correctly, please use

* Firefox 4 http://mozilla.jp/firefox/
* IE9
* etc.

Figures

Start a Figure environment with “Fig:foo FILENAME.jpg” and terminate it with “/Fig:foo”, where “foo” is a tag for the figure. You can write a figure caption between them. You can refer the figure with “Fig:foo” as Fig:ruby.

Input:

\Fig:ruby ruby.jpg
  The is a dummy figure for an example.
  Cute red logo of Ruby, isn't it?
/Fig:ruby

Output: Fig:ruby ruby.jpg

The is a dummy figure for an example.
Cute red logo of Ruby, isn't it?

/Fig:ruby

Tables

Table environment is NOT IMPLEMENTED yet. Start a Table environment with “Table:bar” and terminate it with “/Table:bar”, where “bar” is a tag for the table. You can write a figure caption between them. You can refer the figure with “Table:bar” as Table:diamond.

Input:

\Table:diamond
  The is a dummy caption for the table.
/Table:diamond

Output: Table:diamond

The is a dummy caption for the table.

/Table:diamond

Code

Start a Code environment with “Code:baz FILENAME” and terminate it with “/Code:baz”, where “baz” is a tag for the code. You can write a figure caption between them. You can refer the figure with “Code:baz” as Code:hello. Code will be highlighted with google-code-prettify code.google.com/p/google-code-prettify/ , when options of -s google-code-prettify/src/prettify.css and -j google-code-prettify/src/prettify.js are given.

Input:

\Code:hello hello.c
  Ordinary hello.c.
  Can you see stdio.h?
/Code:hello

Output: Code:hello hello.c

Ordinary hello.c.
Can you see stdio.h?

/Code:hello

Usage of ulmul2html5

Examples

$ ulmul2html5 foo.txt > foo.html
$ ulmul2html5 -n 'Takeshi Nishimatsu' -s ulmul-slidy.css -j ulmul-slidy.js presentation.txt > presentation.html

Command options

–help

Show a help message.

-s, –style

Specify stylesheet filename.

-n, –name

Specify your name for copyright notices.

-j, –javascript

Specify JavaScript filename.

-l, –language

Specify natural language. Its default is “en”.

-m, –max-table-of-contents

Maximum depth for the Table of Contents. Its default is 3. If you do not need the Table of Contents, specify 1.

ULMUL and Slidy examples

* http://loto.sourceforge.net/feram/
  * Its source is http://loto.sourceforge.net/feram/README
* http://loto.sourceforge.net/feram/doc/film.xhtml
  * It is a Slidy presentation made from http://loto.sourceforge.net/feram/doc/film.txt
* http://ulmul.rubyforge.org/index.en.html
  * Its source is http://ulmul.rubyforge.org/README-en (this document)

ulmul2xhtml is obsolete

ulmul2xhtml will be removed from next version 0.6.x.

Usage of ulmul2latex

$ ulmul2latex --help
$ ulmul2latex test.ulmul | tee test.tex
$ latex test.tex
$ latex test.tex
$ dvipdfmx test.dvi

ulmul2latex is still under development. Sorry.

TODO

* More usefull error messages for syntax errors.
* Unit test, tests/ulmul_test.rb
* @body shoud be XML object, not a String.
* Citation.

For more, see TODO file.

Subversion repository

You can checkout the latest source tree of ULMUL anonymously from RubyForge with svn(1) command:

$ svn co svn://rubyforge.org/var/svn/ulmul/ulmul/trunk ulmul

Copying

Copyright © 2008-2011 by Takeshi Nishimatsu

ulmul.rb is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY. You can copy, modify and redistribute ulmul.rb, but only under the conditions described in the GNU General Public License (the “GPL”).

W3C has copyrights for ulmul-slidy.js and ulmul-slidy.css. Their original names were slidy.js and slidy.css, respectively. Takeshi Nishimatsu slightly modified them. You can download the original package, slidy.zip, from www.w3.org/Talks/Tools/Slidy/ . You can find their licenses at www.w3.org/Consortium/Legal/copyright-documents and www.w3.org/Consortium/Legal/copyright-software .

Google Inc. has copyrights for files under google-code-prettify directory. Package prettify-21-Jul-2010.zip is distributed from code.google.com/p/google-code-prettify/ under the Apache License, Version 2.0.

Author of ULMUL

Takeshi Nishimatsu (t_nissieatyahoo.co.jp) t-nissie.users.sourceforge.net/

# Local variables: # mode: rd # compile-command: “rake index.en.html” # End: