<commit_before>.. _ref-usage:

=====
Usage
=====

Describes how to use Pipeline when it is installed and configured.

Automated generation
====================

If ``PIPELINE`` and ``PIPELINE_AUTO`` is enabled (``True``), the source files
will be automatically updated, and re-generated if needed when invoked from the
templatetags.
The last modified time of the files will be compared, and if any of the
source-files is newer than the output-file, the file will be re-generated.

Management command
==================

You can update and force updates of the compressed file(s) with the management command “synccompress”.
This makes it possible to keep the files updated manually.

The command is (assuming you are in you project-folder that contains ``manage.py``). ::

    ./manage.py synccompress

To force all files to be re-generated, use the argument ``--force`` :: 
  
    ./manage.py synccompress --force

Templatetags
============

Pipeline includes two template tags: ``compressed_css`` and ``compressed_js``,
in a template library called ``compressed``.

They are used to output the ``<link>`` and ``<script>``-tags for the
specified CSS/JavaScript-groups (as specified in the settings).
The first argument must be the name of the CSS/JavaScript group.

The templatetags will either output the source filenames or the compressed filenames,<commit_msg>add docs on synccompress new args<commit_after>.. _ref-usage:

=====
Usage
=====

Describes how to use Pipeline when it is installed and configured.

Automated generation
====================

If ``PIPELINE`` and ``PIPELINE_AUTO`` is enabled (``True``), the source files
will be automatically updated, and re-generated if needed when invoked from the
templatetags.
The last modified time of the files will be compared, and if any of the
source-files is newer than the output-file, the file will be re-generated.

Management command
==================

You can update and force updates of the compressed file(s) with the management command “synccompress”.
This makes it possible to keep the files updated manually.

The command is (assuming you are in you project-folder that contains ``manage.py``) ::

    ./manage.py synccompress

To force all files to be re-generated, use the argument ``--force`` :: 
  
    ./manage.py synccompress --force

To re-generate only a specific group ::

	./manage.py synccompress screen

Templatetags
============

Pipeline includes two template tags: ``compressed_css`` and ``compressed_js``,
in a template library called ``compressed``.

They are used to output the ``<link>`` and ``<script>``-tags for the
specified CSS/JavaScript-groups (as specified in the settings).
The first argument must be the name of the CSS/JavaScript group.

The templatetags will either output the source filenames or the compressed filenames,
{'fraction_non_alphanumeric': 0.1173758865248227, 'fraction_numerical': 0.0, 'mean_word_length': 4.6195219123505975, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '453426', 'n_tokens_mistral': 778, 'n_tokens_neox': 752, 'n_words': 365}