Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

78 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lua scriptable SVG image generator

Disclaimer

Important

lsvg is deprecated in favour of figure.

The legacy lsvg repository is still available but will no longer receive updates.

Lua scriptable SVG image generator

lsvg is a Lua interpreter specialized to generate SVG images.

It is based on LuaX and uses a pure Lua library to generate SVG images. It optionally requires ImageMagick to make PNG, JPEG or PDF images.

lsvg was initially inspired by svg-lua.

Releases

It is strongly recommended to build Lsvg from source, as this is the only reliable way to install the exact version you need.

However, if you do require precompiled binaries, this page offers a selection for various platforms: https://cdelord.fr/pub.

Installation

lsvg is available on Codeberg: https://codeberg.org/cdsoft/lsvg.

lsvg uses LuaX.

LuaX

git clone https://codeberg.org/cdsoft/luax
cd luax
./build.lua
ninja install

Lsvg

git clone https://codeberg.org/cdsoft/lsvg
cd lsvg
bang
ninja install

Usage

Help

$ lsvg -h

Usage: lsvg [-h] [-v] [-o output] <input> [<input>] ...

SVG generator scriptable in LuaX

Arguments after "--" are given to the input scripts

Arguments:
   input                 Lua script using the svg module to build an SVG image

Options:
   -h, --help            Show this help message and exit.
   -v                    Print version
   -o output             Output file name (SVG, PNG, JPEG or PDF)
   --MF name             Set the dependency file name (implies `--MD`)
   --MD                  Generate a dependency file

For more information, see https://codeberg.org/cdsoft/lsvg

Example

$ lsvg demo.lua -o demo.svg -- lsvg demo

This command stores {"lsvg", "demo"} in arg, executes demo.lua and produces demo.svg:

demo.svg

Documentation

No documentation yet. Just read the source code...

License

lsvg is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

lsvg is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with lsvg.  If not, see <https://www.gnu.org/licenses/>.

For further information about lsvg you can visit
https://codeberg.org/cdsoft/luax

About

Moved to Codeberg, this repo is just a (temporary) mirror -- lsvg is a Lua interpreter specialized to generate SVG images.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Contributors

Languages