<commit_before>.. customized-plugins:

=================
Extending Cascade
=================

All Cascade plugins are derived from the same base class ``CascadeModelBase``, which stores all its
model fields inside a dictionary, serialized as JSON string in the database. This makes it much
easier to extend the Cascade eco-system, since no database migration is required when adding a new,
or extending plugins from this project.

The database model ``CascadeModelBase`` stores all the plugin settings in a single JSON field named
``glossary``. This in practice behaves like a Django context, but in order to avoid confusion with
the latter, it has been named “glossary”.

.. note:: Custom Cascade plugins should set the ``app_label`` attribute (see
    below). This is important so migrations for the proxy models generated by
    Cascade are created in the correct app.

    If this attribute is not set, Cascade will default to the left-most
    part the plugin's module path. So if your plugin lives in
    ``myapp.cascadeplugins``, Cascade will use ``myapp`` as the app label.
    We recommend that you always set ``app_label`` explicitly.

Simple Example
==============

This plugin is very simple and just renders static content which has been declared in the template.<commit_msg>Docs: fix language<commit_after>.. customized-plugins:

=================
Extending Cascade
=================

All Cascade plugins are derived from the same base class ``CascadeModelBase``, which stores all its
model fields inside a dictionary, serialized as JSON string in the database. This makes it much
easier to extend the Cascade eco-system, since no database migration is required when adding a new,
or extending plugins from this project.

The database model ``CascadeModelBase`` stores all the plugin settings in a single JSON field named
``glossary``. This in practice behaves like a Django context, but in order to avoid confusion with
the latter, it has been named “glossary”.

.. note:: Custom Cascade plugins should set the ``app_label`` attribute (see
    below). This is important so migrations for the proxy models generated by
    Cascade are created in the correct app.

    If this attribute is not set, Cascade will default to the left-most
    part of the plugin's module path. So if your plugin lives in
    ``myapp.cascadeplugins``, Cascade will use ``myapp`` as the app label.
    We recommend that you always set ``app_label`` explicitly.

Simple Example
==============

This plugin is very simple and just renders static content which has been declared in the template.
{'fraction_non_alphanumeric': 0.08784829721362229, 'fraction_numerical': 0.0, 'mean_word_length': 4.453586497890296, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '1989111', 'n_tokens_mistral': 625, 'n_tokens_neox': 604, 'n_words': 368}