Commit 0fee8967 by Timothée Peignier

improve docs

parent 58424a1c
...@@ -92,6 +92,7 @@ pygments_style = 'sphinx' ...@@ -92,6 +92,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
html_theme = 'default' html_theme = 'default'
html_style = 'rtd.css'
# Theme options are theme-specific and customize the look and feel of a theme # Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the # further. For a list of options available for each theme, see the
......
...@@ -17,14 +17,13 @@ syntax to select multiples files. ...@@ -17,14 +17,13 @@ syntax to select multiples files.
The basic syntax for specifying CSS/JavaScript groups files is :: The basic syntax for specifying CSS/JavaScript groups files is ::
PIPELINE_CSS = { PIPELINE_CSS = {
'group_one': { 'colors': {
'source_filenames': ( 'source_filenames': (
'css/style.css', 'css/core.css',
'css/foo.css', 'css/colors/*.css',
'css/button/*.css', 'css/layers.css'
'css/bar.css'
), ),
'output_filename': 'css/one_compressed.css', 'output_filename': 'css/colors.css',
'extra_context': { 'extra_context': {
'media': 'screen,projection', 'media': 'screen,projection',
}, },
...@@ -33,15 +32,14 @@ The basic syntax for specifying CSS/JavaScript groups files is :: ...@@ -33,15 +32,14 @@ The basic syntax for specifying CSS/JavaScript groups files is ::
} }
PIPELINE_JS = { PIPELINE_JS = {
'all': { 'stats': {
'source_filenames': ( 'source_filenames': (
'js/jquery-1.2.3.js', 'js/jquery.js',
'js/jquery-preload.js', 'js/d3.js',
'js/jquery.pngFix.js', 'js/collections/*.js',
'js/my_script.js', 'js/application.js',
'js/my_other_script.js'
), ),
'output_filename': 'js/all_compressed.js', 'output_filename': 'js/stats.js',
} }
} }
...@@ -75,7 +73,6 @@ Group options ...@@ -75,7 +73,6 @@ Group options
Defaults to ``None``. Defaults to ``None``.
``manifest`` ``manifest``
............ ............
......
...@@ -7,8 +7,8 @@ Storages ...@@ -7,8 +7,8 @@ Storages
Using with a custom storage Using with a custom storage
=========================== ===========================
Pipeline use `Django Storage <https://docs.djangoproject.com/en/dev/ref/files/storage/>`_ Pipeline use `Django Storage <https://docs.djangoproject.com/en/dev/ref/contrib/staticfiles/#storages>`_
to read, save and delete files, by default it use an improved ``FileSystemStorage``. to read, save and delete files, by default it use an improved ``StaticFilesStorage``.
You can provide your own via ``PIPELINE_STORAGE`` : :: You can provide your own via ``PIPELINE_STORAGE`` : ::
...@@ -18,18 +18,14 @@ You can provide your own via ``PIPELINE_STORAGE`` : :: ...@@ -18,18 +18,14 @@ You can provide your own via ``PIPELINE_STORAGE`` : ::
Using with staticfiles Using with staticfiles
====================== ======================
Pipeline is providing a Finder for `staticfiles app <https://docs.djangoproject.com/en/dev/howto/static-files/>`_, Pipeline is providing a storage for `staticfiles app <https://docs.djangoproject.com/en/dev/howto/static-files/>`_,
to use it configure ``STATICFILES_FINDERS`` like so : :: to use it configure ``STATICFILES_STORAGE`` like so ::
STATICFILES_FINDERS = ( STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
'pipeline.finders.PipelineFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder'
)
And if you want versioning use ::
.. note:: STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
``PipelineFinder`` should be the first finder in ``STATICFILES_FINDERS``.
Pipeline is also providing a storage that play nicely with staticfiles app Pipeline is also providing a storage that play nicely with staticfiles app
particularly for development : :: particularly for development : ::
......
...@@ -30,9 +30,20 @@ If you have specified the CSS-groups “screen” and “print” and a JavaScri ...@@ -30,9 +30,20 @@ If you have specified the CSS-groups “screen” and “print” and a JavaScri
with the name “scripts”, you would use the following code to output them all :: with the name “scripts”, you would use the following code to output them all ::
{% load compressed %} {% load compressed %}
{% compressed_css 'screen' %} {% compressed_css 'colors' %}
{% compressed_css 'print' %} {% compressed_js 'stats' %}
{% compressed_js 'scripts' %}
Collect static
==============
Pipeline integrates with staticfiles, you just need to setup ``STATICFILES_STORAGE`` to ::
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
Then when you run ``collectstatic`` command, your CSS and your javascripts will be compressed in the same time ::
$ python oslo/manage.py collectstatic
Middleware Middleware
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment