Skip to content

Commit 76436bb

Browse files
author
Andrey Fedoseev
committed
Add usage example to README
1 parent bbeba4e commit 76436bb

File tree

2 files changed

+28
-7
lines changed

2 files changed

+28
-7
lines changed

README.rst

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,31 @@ Documentation
3131
Documentation 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"

docs/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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

0 commit comments

Comments
 (0)