Commit 0fee8967 by Timothée Peignier

improve docs

parent 58424a1c
......@@ -92,6 +92,7 @@ pygments_style = 'sphinx'
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
html_style = 'rtd.css'
# 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
......
......@@ -17,14 +17,13 @@ syntax to select multiples files.
The basic syntax for specifying CSS/JavaScript groups files is ::
PIPELINE_CSS = {
'group_one': {
'colors': {
'source_filenames': (
'css/style.css',
'css/foo.css',
'css/button/*.css',
'css/bar.css'
'css/core.css',
'css/colors/*.css',
'css/layers.css'
),
'output_filename': 'css/one_compressed.css',
'output_filename': 'css/colors.css',
'extra_context': {
'media': 'screen,projection',
},
......@@ -33,15 +32,14 @@ The basic syntax for specifying CSS/JavaScript groups files is ::
}
PIPELINE_JS = {
'all': {
'stats': {
'source_filenames': (
'js/jquery-1.2.3.js',
'js/jquery-preload.js',
'js/jquery.pngFix.js',
'js/my_script.js',
'js/my_other_script.js'
'js/jquery.js',
'js/d3.js',
'js/collections/*.js',
'js/application.js',
),
'output_filename': 'js/all_compressed.js',
'output_filename': 'js/stats.js',
}
}
......@@ -75,7 +73,6 @@ Group options
Defaults to ``None``.
``manifest``
............
......
......@@ -7,8 +7,8 @@ Storages
Using with a custom storage
===========================
Pipeline use `Django Storage <https://docs.djangoproject.com/en/dev/ref/files/storage/>`_
to read, save and delete files, by default it use an improved ``FileSystemStorage``.
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 ``StaticFilesStorage``.
You can provide your own via ``PIPELINE_STORAGE`` : ::
......@@ -18,18 +18,14 @@ You can provide your own via ``PIPELINE_STORAGE`` : ::
Using with staticfiles
======================
Pipeline is providing a Finder for `staticfiles app <https://docs.djangoproject.com/en/dev/howto/static-files/>`_,
to use it configure ``STATICFILES_FINDERS`` like so : ::
Pipeline is providing a storage for `staticfiles app <https://docs.djangoproject.com/en/dev/howto/static-files/>`_,
to use it configure ``STATICFILES_STORAGE`` like so ::
STATICFILES_FINDERS = (
'pipeline.finders.PipelineFinder',
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder'
)
STATICFILES_STORAGE = 'pipeline.storage.PipelineStorage'
And if you want versioning use ::
.. note::
``PipelineFinder`` should be the first finder in ``STATICFILES_FINDERS``.
STATICFILES_STORAGE = 'pipeline.storage.PipelineCachedStorage'
Pipeline is also providing a storage that play nicely with staticfiles app
particularly for development : ::
......
......@@ -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 ::
{% load compressed %}
{% compressed_css 'screen' %}
{% compressed_css 'print' %}
{% compressed_js 'scripts' %}
{% compressed_css 'colors' %}
{% compressed_js 'stats' %}
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
......
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