<commit_before>===============
Wagtail Froala
===============

Extends Wagtail to use the amazing Froala editor.
This Wagtail extension requires Wagtail 1.5.x, as it uses ``WAGTAILADMIN_RICH_TEXT_EDITORS``.

Installation
============

Add ``wagtailfroala`` to your ``INSTALLED_APPS``.

Add ``wagtailfroala.rich_text.FroalaRichTextArea`` to ``WAGTAILADMIN_RICH_TEXT_EDITORS`` in your settings.

For example, to use Froala for all ``RichTextField`` and ``RichTextBlock`` instances:

.. code-block:: python

    WAGTAILADMIN_RICH_TEXT_EDITORS = {
        'default': {
            'WIDGET': 'wagtailfroala.rich_text.FroalaRichTextArea'
        },
    }

Or, to use Froala only for defined instances...

.. code-block:: python
    
    WAGTAILADMIN_RICH_TEXT_EDITORS = {
        'default': {
            'WIDGET': 'wagtail.wagtailadmin.rich_text.HalloRichTextArea'
        },
        'froala': {
            'WIDGET': 'wagtailfroala.rich_text.FroalaRichTextArea'
        },
    }

.. code-block:: python

    html_field = RichTextField(editor='froala')
    stream_field = StreamField([
        ('html', RichTextBlock(editor='froala'))
    ])

Options
-------

You will need to add ``FROALA_LICENSE_KEY`` to your settings:

.. code-block:: python
    FROALA_LICENSE_KEY = 'xxxxxxxxxxxxxx';

You can also specify ``FROALA_OPTIONS``, which should be a dict populated with [official Froala options](https://www.froala.com/wysiwyg-editor/docs/options):
.. code-block:: python
    FROALA_OPTIONS = {
        'toolbarButtonsMD': ['bold', 'italic', 'underline', 'fontFamily', 'fontSize', 'color'],
        'toolbarButtonsXS': ['bold', 'italic', 'underline']
    };<commit_msg>Updated readme.<commit_after>===============
Wagtail Froala
===============

Extends Wagtail to use the amazing Froala editor.
This Wagtail extension requires Wagtail 1.5.x, as it uses ``WAGTAILADMIN_RICH_TEXT_EDITORS``.

Installation
============

Add ``wagtailfroala`` to your ``INSTALLED_APPS``.

Add ``wagtailfroala.rich_text.FroalaRichTextArea`` to ``WAGTAILADMIN_RICH_TEXT_EDITORS`` in your settings.

For example, to use Froala for all ``RichTextField`` and ``RichTextBlock`` instances:

.. code-block:: python

    WAGTAILADMIN_RICH_TEXT_EDITORS = {
        'default': {
            'WIDGET': 'wagtailfroala.rich_text.FroalaRichTextArea'
        },
    }

Or, to use Froala only for defined instances...

.. code-block:: python
    
    WAGTAILADMIN_RICH_TEXT_EDITORS = {
        'default': {
            'WIDGET': 'wagtail.wagtailadmin.rich_text.HalloRichTextArea'
        },
        'froala': {
            'WIDGET': 'wagtailfroala.rich_text.FroalaRichTextArea'
        },
    }

.. code-block:: python

    html_field = RichTextField(editor='froala')
    stream_field = StreamField([
        ('html', RichTextBlock(editor='froala'))
    ])

Options
-------

You will need to add ``FROALA_LICENSE_KEY`` to your settings:

.. code-block:: python
    FROALA_LICENSE_KEY = 'xxxxxxxxxxxxxx';

You can also specify ``FROALA_OPTIONS``, which should be a dict populated with official Froala options (https://www.froala.com/wysiwyg-editor/docs/options):

.. code-block:: python
    FROALA_OPTIONS = {
        'toolbarButtonsMD': ['bold', 'italic', 'underline', 'fontFamily', 'fontSize', 'color'],
        'toolbarButtonsXS': ['bold', 'italic', 'underline']
    };
{'fraction_non_alphanumeric': 0.15294471153846154, 'fraction_numerical': 0.001201923076923077, 'mean_word_length': 3.579092159559835, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '3538542', 'n_tokens_mistral': 1146, 'n_tokens_neox': 1114, 'n_words': 240}