Skip to content

Commit cf859d8

Browse files
committed
Merge branch 'jor123-source_commen'
2 parents 8260950 + 1571a3d commit cf859d8

File tree

3 files changed

+16
-1
lines changed

3 files changed

+16
-1
lines changed

CHANGELOG.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
Changelog
22
=========
33

4+
0.3 (xx.xx.20xx)
5+
~~~~~~~~~~~~~~~~
6+
* Enabled source comments when DEBUG is True; can be overridden with the LIBSASS_SOURCE_COMMENTS setting
7+
48
0.2 (22.05.2014)
59
~~~~~~~~~~~~~~~~
610
* Made compatible with django-compressor 1.4 and Python 3.

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ possible to import files across different apps::
3838
@import "myotherapp/css/widget.scss"
3939

4040

41+
Source comments
42+
~~~~~~~~~~~~~~~
43+
44+
SASS source comments (adds comments about source lines) are enabled when Django's DEBUG is
45+
enabled. This setting can be overridden with a LIBSASS_SOURCE_COMMENTS boolean setting.
46+
47+
4148
Why django-libsass?
4249
~~~~~~~~~~~~~~~~~~~
4350

django_libsass.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1+
from django.conf import settings
12
from django.contrib.staticfiles.finders import get_finders
23

34
import sass
45
from compressor.filters.base import FilterBase
56

7+
SOURCE_COMMENTS = getattr(settings, 'LIBSASS_SOURCE_COMMENTS', settings.DEBUG)
8+
9+
610
def get_include_paths():
711
"""
812
Generate a list of include paths that libsass should use to find files
@@ -48,6 +52,6 @@ def __init__(self, content, attrs=None, filter_type=None, charset=None, filename
4852

4953
def input(self, **kwargs):
5054
if self.filename:
51-
return compile(filename=self.filename)
55+
return compile(filename=self.filename, source_comments=SOURCE_COMMENTS)
5256
else:
5357
return compile(string=self.content)

0 commit comments

Comments
 (0)