The Light Markup to XML is a markup intended to make writing xml or a recursive decent markup, easier. Head over to the wiki for an in-depth tour of what can be expected from this library.
Interested in the command-line app?
Let's take a simple html document for example.
HTML
<html>
<head>
<title>Test</title>
<script type="text/javascript" src="blah.js"></script>
<link rel="stylesheet" type="text/css" href="main.css"/>
</head>
<body>
<div class="page">
<div class="content">
Blah Blah Blah
</div>
<div id="footer">
This is where the copyright goes.
</div>
</div>
</body>
</html>
Equivalent LMXML
html
head
title "Test"
script @type="text/javascript" @src="blah.js"
link @rel="stylesheet" @type="text/css" @href="main.css"
body
div .page
div .content "Blah Blah Blah"
div #footer "This is where the copyright goes."
- Indention is important
- JSON-style attributes
- Class attributes prefixed with "." and Id with "#"
- Markdown Indirect link style templates
- Indirect definitions are delimited from main document by
---
Example:
div #page
[boilerplate]
div .content
div #footer
[boilerplate]
[boilerplate]:
div .signoff
q "And this here is the good life."
div .author "Philip Cali
Add it to your sbt build:
libraryDependencies += "com.github.philcali" %% "lmxml-core" % "0.1.3"
Each LMXML process (parsing, converting, transforming, etc), is designed to be extensible. Here's a list of each submodule and a link to each description:
lmxml-html
: HTML Shortcutslmxml-template
: File Templateslmxml-json
: JSON Transformslmxml-cache
: Compile Cachelmxml-markdown
: Markdown
That's all for now.
I have included an example app that uses all listed submodules (except lmxml-json
).
- Configuring LMXML with submodules L19-26
- Using Configured LMXML L87
- All the lmxml files in data/templates
To run, simply:
git clone git://github.com/philcali/lmxml.git
cd lmxml
sbt "project lmxml-example" run
Try it out at http://localhost:8080.
You've got nothing to lose, really. Head on over the GAE try LMXML app, to try the thing out. Give you hands a break from writing all those closing tags.