File tree Expand file tree Collapse file tree 2 files changed +28
-7
lines changed
Expand file tree Collapse file tree 2 files changed +28
-7
lines changed Original file line number Diff line number Diff line change @@ -31,10 +31,31 @@ Documentation
3131Documentation is available at `http://django-static-precompiler.readthedocs.org <http://django-static-precompiler.readthedocs.org/en/stable/ >`_.
3232
3333
34- Installation
35- ============
34+ Install
35+ =======
3636
37- To install ::
37+ ::
3838
3939 pip install django-static-precompiler
4040
41+ Use in templates
42+ ================
43+
44+ ::
45+
46+ {% load compile_static %}
47+ {% load static %}
48+
49+ <script src="{% static "path/to/script.coffee"|compile %}"></script>
50+ <link rel="stylesheet" href="{% static "path/to/styles1.less"|compile %}" />
51+ <link rel="stylesheet" href="{% static "path/to/styles2.scss"|compile %}" />
52+
53+
54+ Use in Python
55+ =============
56+
57+ ::
58+
59+ >>> from static_precompiler.utils import compile_static
60+ >>> compile_static("styles.scss")
61+ "COMPILED/styles.css"
Original file line number Diff line number Diff line change @@ -40,8 +40,8 @@ Note that all relative URLs in your stylesheets are converted to absolute URLs u
4040``compile `` is a template filter that allows to compile any source file supported by compilers configured with
4141``STATIC_PRECOMPILER_COMPILERS `` settings.
4242
43- Example Usage
44- -------------
43+ Example
44+ -------
4545
4646::
4747
@@ -71,8 +71,8 @@ Compiler must be specified in ``STATIC_PRECOMPILER_COMPILERS`` setting. Names fo
7171* ``scss ``
7272* ``stylus ``
7373
74- Example Usage
75- -------------
74+ Example
75+ -------
7676
7777::
7878
You can’t perform that action at this time.
0 commit comments