binding for libsass
Project description
why?
the guy on this talk asqued for it: http://www.confreaks.com/videos/859-railsconf2012-the-future-of-sass
I wanted to play with ctypes
who?
marianoguerra
how?
first of all download, compile and install libsass:
git clone https://github.com/hcatlin/libsass.git cd libsass ./configure make sudo make install
then you can play with this project in two ways
command line
if no options provided read from stdin:
➜ src ./sass.py table.hl td.ln { text-align: right; } table.hl td.ln { text-align: right; }
from a file:
➜ src ./sass.py -f ../examples/simple.scss .content-navigation { border-color: #3bbfce; color: darken(#3bbfce, 9%); } .border { padding: 8px; margin: 8px; border-color: #3bbfce; }
from a folder:
# I think it doesn't work, never used sass before and don't know what # this means :) ➜ src ./sass.py -d ../examples/
you can’t chew gum and walk at the same time:
➜ src ./sass.py -f ../examples/simple.scss -d ~ usage: sass.py [-h] [-f FILE_PATH | -d DIR_PATH] sass.py: error: argument -d/--dir: not allowed with argument -f/--file
code
from a string:
Python 2.7.3 (default, Apr 20 2012, 22:44:07) >>> import sass >>> STYLE = """ ... table.hl td.ln { ... text-align: right; ... } ... """ >>> ok, style = sass.compile(STYLE) >>> ok True >>> print style table.hl td.ln { text-align: right; }
from a file:
>>> ok, style = sass.compile_path("../examples/simple.scss") >>> ok True >>> print style .content-navigation { border-color: #3bbfce; color: darken(#3bbfce, 9%); } .border { padding: 8px; margin: 8px; border-color: #3bbfce; }
from a folder:
>>> ok, style = sass.compile_folder("../examples/") # ??? # Profit!
how to install?
from sources
python 2:
sudo python2 setup.py install
python 3:
sudo python3 setup.py install
using pip
sudo pip install SassPython
license?
MIT + optional beer for the creator
what’s left to do?
make the folder stuff work
add command line options to specify option styles
see what the return value of the compile_* means and use it if needed
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file SassPython-0.2.1.tar.gz
.
File metadata
- Download URL: SassPython-0.2.1.tar.gz
- Upload date:
- Size: 5.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1a3d9d5a2ac4ad809ec6ae70bbcfa3aa1b2e47052aa17bfc7f83c498ee0aeb70 |
|
MD5 | 6cf2baff4c53a474178a0f7f8343cfe0 |
|
BLAKE2b-256 | 5b395c8114b333de15bef4766af1b24b21b2f2a077e4e3da5da7b885b18a7d80 |
File details
Details for the file SassPython-0.2.1.linux-i686.tar.gz
.
File metadata
- Download URL: SassPython-0.2.1.linux-i686.tar.gz
- Upload date:
- Size: 816.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 029e38e4c63277232dadfc96be463e6efebea887ff51a11e3000005e10a5b48f |
|
MD5 | 222e66e4ee08a713e18a65d4e69df1cc |
|
BLAKE2b-256 | 2ec1e478d1dde227153c9e83461147cca7d984e3fa35c279a857d40a217bb038 |