ULMUL (Ultra Lightweight MarkUp Language)

"ULMUL" is an original Ultra Lightweight MarkUp Language. Using "ulmul2html5" or "ulmul2mathjax" commands, You can convert a ULMUL text with TeX style equations into HTML5 documents with MathML or MathJax, respectively. ULMUL is written in Ruby. You can also use ulmul.rb as a library.

Homepage of ULMUL: http://t-nissie.users.sourceforge.net/ULMUL/

Ruby Gem of ULMUL: http://rubygems.org/gems/ulmul

Repository of ULMUL: https://github.com/t-nissie/ULMUL


Table of Contents:

Features

Installation of ULMUL

Please use gem ( RubyGems https://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 https://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 up to 4th--5th level.
 * First
   * Second
     * Third
       * Fourth
       * more for Fourth
     second continue
     * More for third
 * More for first

become

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

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 E=mc2.

You can refer the equation in a way like "Eq:Einstein", as Eq. (1).

To view the equations in MathML correctly, please use

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

Input:

\Fig:ruby ruby.jpg
  The is a dummy figure for an example.
  Cute red logo of Ruby, isn't it?
  You can write equations even in a caption as $ax^2+bx+c=0$.
/Fig:ruby

Output:

ruby.jpg
Figure 1: The is a dummy figure for an example. Cute red logo of Ruby, isn't it? You can write equations even in a caption as ax2+bx+c=0.

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 table caption between them. You can refer the table with "Table:bar" as Table 1.

Input:

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

Output:

Table 1: The is a dummy caption for the table.
TABLE
Not yet implemented

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 caption between them. You can refer the code with "Code:baz" as Code 1. Code will be highlighted with google-code-prettify when -j https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js is given.

Input:

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

Output:

Code 1: Ordinary hello.c. Can you see stdio.h? (download: hello.c)

/* hello.c */
#include <stdio.h>
int main()
{
  printf("hello, world\n");
  return 0;
}

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

Usage of ulmul2mathjax

It uses MathJax http://www.mathjax.org/ to show equations.

$ ulmul2mathjax --help
$ ulmul2mathjax -s ulmul2html5.css -j https://cdn.rawgit.com/google/code-prettify/master/loader/run_prettify.js \
  -j 'http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=default' README-en > README-en-mathjax.html

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

For more, see TODO file.

Repository in GitHub

You can clone the source tree of ULMUL from GitHub with git(1) command:

$ git clone https://github.com/t-nissie/ULMUL.git ulmul

Copying

Copyright © 2008,2009,2010,2011,2012,2013,2014,2015,2017,2022,2024 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 http://www.w3.org/Talks/Tools/Slidy/ . You can find their licenses at http://www.w3.org/Consortium/Legal/copyright-documents and http://www.w3.org/Consortium/Legal/copyright-software .

Author of ULMUL

Takeshi Nishimatsu (t_nissie{at}yahoo.co.jp) http://t-nissie.users.sourceforge.net/