Skip to content
algas edited this page Mar 1, 2012 · 2 revisions

What is Lightning

Lightning is a python library that takes Swfmill's XML output and transforms it into SVG with CSS animation.
Lightning can be used as a simple parser, but it was created under the assumption of DB storage of the resulting SVG+CSS.

License

MIT

Required Python version

2.5 or higher

Required libraries

  • lxml 2.3.1
  • simplejson 2.2.1

Installation method

$ python setup.py install

※ Required libraries will also be installed.

Usage examples

  • Generate a HTML file from XML
$ cd lightning_core/sample
$ python xml2html.py input.xml output.html
  • Generate a static SVG file
$ cd lightning_core/sample
$ python convert_svg.py input.xml output.svg
  • Generate a HTML file with SVG + CSS animation
$ cd lightning_core
$ python lightning_svg.py input.xml output.html

Supported environments for output

The resulting files can be displayed in any WebKit browser that supports SVG.
The primary target of Lightning is iPhone, so outputs may not work properly on other browsers.

Already tested

  • Safari (iPhone, Windows)
  • Chrome (Windows, Linux) - depends on the WebKit implementation
  • Opera (Linux) - depends on the WebKit / SVG implementation

Unsupported

  • Android browsers - SVG is not supported.

Caveats

Clone this wiki locally