The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

Libsass Math Plugin

Native libsass plugin adding trigonometric and mathematical functions.

Building

You need to have [libsass] 1 already [compiled] 2 or [installed] 3 as a shared library (inclusive header files). It is then compiled via cmake. See this example to compile it on windows via [MinGW] 4 Compiler Suite:

git clone https://github.com/sass/libsass.git
mingw32-make -C libsass BUILD=shared CC=gcc -j5
git clone https://github.com/mgreter/libsass-math.git
cd libsass-math && mkdir build && cd build
cmake -G "MinGW Makefiles" .. -DLIBSASS_DIR="..\..\libsass"
mingw32-make CC=gcc -j5 && dir math.dll

You may define LIBSASS_INCLUDE_DIR and LIBSASS_LIBRARY_DIR separately!

API

The following globals are available when you import the math plugin.

The following functions are available when you import the math plugin.

math/numeric

math/exponentiation

math/trigonometry

math/hyperbolic

math/inverse-trigonometry

math/inverse-hyperbolic

© 2015 [Marcel Greter] 6