-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compilescss does not support jinja2 #49
Comments
But then django-compressor becomes a hard dependency. Currently that's optional. The most important feature now, are unit tests. When I started, I was in a real hurry and that project was not intended to become what it is now. Normally I add unit tests right from the beginning. |
Currently the readme states:
Won't it still be 'optional' in the same way (only required for offline use)? We're currently importing it in |
@AndreasBackx I think I've added And yeah, django-compressor is actually not a very good thing to depend on - they have history of making breaking changes in their code with no good reason (like #45, it's still open with no reaction from their side). Maybe the better idea is right opposite - remove this dependency altogether. Just copy their django template walker and be done with it? |
@frostbtn it wasn't working for me. It's been about 2 weeks since I looked into it so I cannot really remember it. As I'm currently no longer using a Jinja2 environment, but am using django-jinja I cannot check what caused it. But in any case support for django-jinja should perhaps also be added. I would still say that we should depend on it as most of our users would benefit from using django-compressor and are perhaps already using it like I am. We could always keep the version locked to a specific version in case of a breaking change and make it work later on. I doubt there are gonna be a lot of big breaking changes. |
can we close this? |
@jrief I'll give it a look the coming weeks. Currently pretty busy. |
It's been a while since I looked at the django-compressor part of the code. But could you explain to me why we need the django-compressor? Can't we simply find all of the |
In some sense django-compressor and libsass are complementary indeed, since they both compress the CSS files. In addition to that, django-compressor concatenates all CSS files included by your HTML file. Here I use Sekizai in combination with Compressor. For example:
If you use SCSS files exclusively and if you use only one SCSS file per HTML file (you can use |
Doesn't the following work? {% compress css %}
<link rel="stylesheet" href="{% sass_src 'one.scss' %}" type="text/css" charset="utf-8">
<link rel="stylesheet" href="{% sass_src 'two.scss' %}" type="text/css" charset="utf-8">
{% endcompress %} |
Maybe? I only use django-compress in combination with django-sekizai, hence I don't know. |
* Resolves jrief#49. * Fixes failing Python 2.7 Jinja2 tests. * Multiple engines are now supported in the compilescss command. * Added more info to README regarding Jinja2 compilescss support.
I wanted to add support for the
compilescss
command because currently the command does not support jinja2. There have been a lot of changes in django-compressor's compress command which added support for jinja2 since the compilescss here was written based on that one. I think we/I should refactor the command and inherit from the compress command. This way we can follow the changes there. The current command on django-compressor is very messy, I think it's best to refactor that on their end first and then inherit it here, but add some changes so instead of compressing it would compile SCSS.It might also be good to add to the readme that setting
SASS_PROCESSOR_ENABLED
is the only way to use Jinja2 withDEBUG
set toFalse
.The text was updated successfully, but these errors were encountered: