django-ace


Namedjango-ace JSON
Version 1.38.0 PyPI version JSON
download
home_pageNone
Summarydjango-ace provides of ACE editor with Django
upload_time2025-02-18 11:18:32
maintainerNone
docs_urlNone
authorNone
requires_python>2
licenseSimplified BSD
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ==========
django-ace
==========


Usage
=====

::

    from django import forms
    from django_ace import AceWidget

    class EditorForm(forms.Form):
        text = forms.CharField(widget=AceWidget(width=None, height=None))

Syntax highlighting and static analysis can be enabled by specifying the
language::

    class EditorForm(forms.Form):
        text = forms.CharField(widget=AceWidget(mode='css'))

Themes are also supported::

    class EditorForm(forms.Form):
        text = forms.CharField(widget=AceWidget(mode='css', theme='twilight'))

All options, and their default values, are::

    class EditorForm(forms.Form):
        text = forms.CharField(widget=AceWidget(
            mode=None,  # try for example "python"
            theme=None,  # try for example "twilight"
            wordwrap=False,
            width="500px",  # Deprecated, pass None and use CSS
            height="300px",  # Deprecated, pass None and use CSS
            minlines=None,
            maxlines=None,
            showprintmargin=True,
            showinvisibles=False,
            usesofttabs=True,
            tabsize=None,
            fontsize=None,
            toolbar=True,
            readonly=False,
            showgutter=True,  # To hide/show line numbers
            behaviours=True,  # To disable auto-append of quote when quotes are entered
            useworker=True,
            extensions=None,
            basicautocompletion=False,
            liveautocompletion=False,
        ))


For a ``ModelForm``, for example in Django admin, it can be used like this::

    class PageForm(forms.ModelForm):
        class Meta:
            model = Page
            fields = ("title", "body")
            widgets = {
                "body": AceWidget(
                    mode="markdown", theme="twilight", width=None, height=None
                ),
            }

    class PageAdmin(admin.ModelAdmin):
        form = PageForm


Install
=======

1. Install using pip::

    pip install django_ace

2. Update ``INSTALLED_APPS``::

    INSTALLED_APPS = (
        # ...
        'django_ace',
    )


Example Project
===============

There's an example project included in the source, to try it do::

    cd example/
    python -m venv .venv
    source .venv/bin/activate
    pip install -e ..
    ./manage.py migrate
    ./manage.py runserver

Then browser to ``http://localhost:8000``.


Change log
==========

v1.38.0
-------

- Update ACE editor to version v1.38.

The ``width`` and ``height`` arguments (which sets the HTML ``style``
attribute) are starting a slow change of their default
values. Starting from this version do not rely in their default
arguments, give them explicitly!

They are changing from ``width="500px", height="300px"`` (setting the
HTML ``style`` argument) to ``width=None, height=None`` (relying on
the CSS).

The default CSS uses ``width: 500px; height: 300px``, so changing from
no ``width`` and no ``height`` to ``width=None, height=None`` is an
easy correct move.

If you need custom size, prefer using ``width=None, height=None`` (the
future default values) and use CSS to customize the size, this permits
more secure CSP rules.


v1.37.5
-------

- Update ACE editor to version v1.37.5.
- Use minified and non-conflict ACE instead of basic.
- Expose two new options: enablebasicautocompletion and enableliveautocompletion.

v1.36.2
-------

- Update ACE editor to version v1.36.2.

v1.32.4
-------

- Expose useworker, contributed by @mounirmesselmeni.

v1.32.3
-------

- Update ACE editor to version v1.32.3.

v1.32.0
-------

- Update ACE editor to version v1.32.0.
- Expose extensions, contributed by @okaycj.

v1.31.1
-------

- Update ACE editor to version v1.31.1.

v1.26.0
-------

- Update ACE editor to version v1.26.0.

v1.24.1
-------

- Update ACE editor to version v1.24.1.

v1.23.4
-------

- Update ACE editor to version v1.23.4.

v1.22.1
-------

- Update ACE editor to version v1.22.1.

v1.19.0
-------

- Update ACE editor to version v1.19.0.

v1.15.4
-------

- Added CSS to work with new admin in Django 4.2. Now you can use `width="100%"` without breaking the layout.

v1.15.3
-------

- Update ACE editor to version v1.15.3.

v1.14.0
-------

- Update ACE editor to version v1.14.0.
- Follow ACE version numbers.

v1.0.13
-------

- Update ACE editor to version v1.11.2.


v1.0.12
-------

- Update ACE editor to version v1.5.0.

v1.0.11
-------

- Support Grappelli inlines.


v1.0.10
-------

- FIX JavaScript error when using ``JavaScriptCatalog``.


v1.0.9
------

- New widget option ``showgutters`` to hide line numbers.
- New widget option ``behaviours`` to avoid auto-insert of quotes.


v1.0.8
------

- New widget option ``readonly``.
- Update ACE editor to version v1.4.12.


v1.0.7
------

- New widget option ``toolbar``.
- Update ACE editor to version v1.4.8.


v1.0.6
------

- New widget option ``fontsize``.
- Update ACE editor to version v1.4.7.


v1.0.5
------

- New widget option ``tabsize``.
- Upgrade ACE editor to version v1.4.2.


v1.0.4
------

- Update Django compatibility to ``>1.11,<=2.1``
- New widget options ``minLines``, ``maxLines``, ``showinvisibles``, ``usesofttabs``.
- Upgrade ACE editor to version v1.4.0.
- Updated example for Django 1.11
- PEP8 improvements

v1.0.2
------

- Upgrade ACE editor to version 1.1.8
- Add support for showprintmargin

v1.0.1
------

- Add support for Django 1.7 by removing deprecated imports.

v1.0.0
------

- Initial release.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "django-ace",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">2",
    "maintainer_email": null,
    "keywords": null,
    "author": null,
    "author_email": "Bradley Ayers <bradley.ayers@gmail.com>, Julien Palard <julien@palard.fr>",
    "download_url": "https://files.pythonhosted.org/packages/39/89/d9e4b538819c9629e471cbb20e0b244be2dedd0af59f3789328801dcec8e/django_ace-1.38.0.tar.gz",
    "platform": null,
    "description": "==========\ndjango-ace\n==========\n\n\nUsage\n=====\n\n::\n\n    from django import forms\n    from django_ace import AceWidget\n\n    class EditorForm(forms.Form):\n        text = forms.CharField(widget=AceWidget(width=None, height=None))\n\nSyntax highlighting and static analysis can be enabled by specifying the\nlanguage::\n\n    class EditorForm(forms.Form):\n        text = forms.CharField(widget=AceWidget(mode='css'))\n\nThemes are also supported::\n\n    class EditorForm(forms.Form):\n        text = forms.CharField(widget=AceWidget(mode='css', theme='twilight'))\n\nAll options, and their default values, are::\n\n    class EditorForm(forms.Form):\n        text = forms.CharField(widget=AceWidget(\n            mode=None,  # try for example \"python\"\n            theme=None,  # try for example \"twilight\"\n            wordwrap=False,\n            width=\"500px\",  # Deprecated, pass None and use CSS\n            height=\"300px\",  # Deprecated, pass None and use CSS\n            minlines=None,\n            maxlines=None,\n            showprintmargin=True,\n            showinvisibles=False,\n            usesofttabs=True,\n            tabsize=None,\n            fontsize=None,\n            toolbar=True,\n            readonly=False,\n            showgutter=True,  # To hide/show line numbers\n            behaviours=True,  # To disable auto-append of quote when quotes are entered\n            useworker=True,\n            extensions=None,\n            basicautocompletion=False,\n            liveautocompletion=False,\n        ))\n\n\nFor a ``ModelForm``, for example in Django admin, it can be used like this::\n\n    class PageForm(forms.ModelForm):\n        class Meta:\n            model = Page\n            fields = (\"title\", \"body\")\n            widgets = {\n                \"body\": AceWidget(\n                    mode=\"markdown\", theme=\"twilight\", width=None, height=None\n                ),\n            }\n\n    class PageAdmin(admin.ModelAdmin):\n        form = PageForm\n\n\nInstall\n=======\n\n1. Install using pip::\n\n    pip install django_ace\n\n2. Update ``INSTALLED_APPS``::\n\n    INSTALLED_APPS = (\n        # ...\n        'django_ace',\n    )\n\n\nExample Project\n===============\n\nThere's an example project included in the source, to try it do::\n\n    cd example/\n    python -m venv .venv\n    source .venv/bin/activate\n    pip install -e ..\n    ./manage.py migrate\n    ./manage.py runserver\n\nThen browser to ``http://localhost:8000``.\n\n\nChange log\n==========\n\nv1.38.0\n-------\n\n- Update ACE editor to version v1.38.\n\nThe ``width`` and ``height`` arguments (which sets the HTML ``style``\nattribute) are starting a slow change of their default\nvalues. Starting from this version do not rely in their default\narguments, give them explicitly!\n\nThey are changing from ``width=\"500px\", height=\"300px\"`` (setting the\nHTML ``style`` argument) to ``width=None, height=None`` (relying on\nthe CSS).\n\nThe default CSS uses ``width: 500px; height: 300px``, so changing from\nno ``width`` and no ``height`` to ``width=None, height=None`` is an\neasy correct move.\n\nIf you need custom size, prefer using ``width=None, height=None`` (the\nfuture default values) and use CSS to customize the size, this permits\nmore secure CSP rules.\n\n\nv1.37.5\n-------\n\n- Update ACE editor to version v1.37.5.\n- Use minified and non-conflict ACE instead of basic.\n- Expose two new options: enablebasicautocompletion and enableliveautocompletion.\n\nv1.36.2\n-------\n\n- Update ACE editor to version v1.36.2.\n\nv1.32.4\n-------\n\n- Expose useworker, contributed by @mounirmesselmeni.\n\nv1.32.3\n-------\n\n- Update ACE editor to version v1.32.3.\n\nv1.32.0\n-------\n\n- Update ACE editor to version v1.32.0.\n- Expose extensions, contributed by @okaycj.\n\nv1.31.1\n-------\n\n- Update ACE editor to version v1.31.1.\n\nv1.26.0\n-------\n\n- Update ACE editor to version v1.26.0.\n\nv1.24.1\n-------\n\n- Update ACE editor to version v1.24.1.\n\nv1.23.4\n-------\n\n- Update ACE editor to version v1.23.4.\n\nv1.22.1\n-------\n\n- Update ACE editor to version v1.22.1.\n\nv1.19.0\n-------\n\n- Update ACE editor to version v1.19.0.\n\nv1.15.4\n-------\n\n- Added CSS to work with new admin in Django 4.2. Now you can use `width=\"100%\"` without breaking the layout.\n\nv1.15.3\n-------\n\n- Update ACE editor to version v1.15.3.\n\nv1.14.0\n-------\n\n- Update ACE editor to version v1.14.0.\n- Follow ACE version numbers.\n\nv1.0.13\n-------\n\n- Update ACE editor to version v1.11.2.\n\n\nv1.0.12\n-------\n\n- Update ACE editor to version v1.5.0.\n\nv1.0.11\n-------\n\n- Support Grappelli inlines.\n\n\nv1.0.10\n-------\n\n- FIX JavaScript error when using ``JavaScriptCatalog``.\n\n\nv1.0.9\n------\n\n- New widget option ``showgutters`` to hide line numbers.\n- New widget option ``behaviours`` to avoid auto-insert of quotes.\n\n\nv1.0.8\n------\n\n- New widget option ``readonly``.\n- Update ACE editor to version v1.4.12.\n\n\nv1.0.7\n------\n\n- New widget option ``toolbar``.\n- Update ACE editor to version v1.4.8.\n\n\nv1.0.6\n------\n\n- New widget option ``fontsize``.\n- Update ACE editor to version v1.4.7.\n\n\nv1.0.5\n------\n\n- New widget option ``tabsize``.\n- Upgrade ACE editor to version v1.4.2.\n\n\nv1.0.4\n------\n\n- Update Django compatibility to ``>1.11,<=2.1``\n- New widget options ``minLines``, ``maxLines``, ``showinvisibles``, ``usesofttabs``.\n- Upgrade ACE editor to version v1.4.0.\n- Updated example for Django 1.11\n- PEP8 improvements\n\nv1.0.2\n------\n\n- Upgrade ACE editor to version 1.1.8\n- Add support for showprintmargin\n\nv1.0.1\n------\n\n- Add support for Django 1.7 by removing deprecated imports.\n\nv1.0.0\n------\n\n- Initial release.\n",
    "bugtrack_url": null,
    "license": "Simplified BSD",
    "summary": "django-ace provides of ACE editor with Django",
    "version": "1.38.0",
    "project_urls": {
        "Homepage": "https://github.com/django-ace/django-ace"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "6e0bc8d322bd702ac5c031ebb71b9da9026b5852af0b37641336f30d75202673",
                "md5": "6ed7d50103517099e7e81f30a7dc5b74",
                "sha256": "9d45f53b1acac6f37a9a9700f27226ce4c1425636e6a7981a905740c72e25e5f"
            },
            "downloads": -1,
            "filename": "django_ace-1.38.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "6ed7d50103517099e7e81f30a7dc5b74",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">2",
            "size": 2746830,
            "upload_time": "2025-02-18T11:18:24",
            "upload_time_iso_8601": "2025-02-18T11:18:24.706089Z",
            "url": "https://files.pythonhosted.org/packages/6e/0b/c8d322bd702ac5c031ebb71b9da9026b5852af0b37641336f30d75202673/django_ace-1.38.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "3989d9e4b538819c9629e471cbb20e0b244be2dedd0af59f3789328801dcec8e",
                "md5": "5f65f360b41c1ab37e56d4ff9056ae2d",
                "sha256": "6ed862f05f58f5363948ff1b8c47d84f5e4a014a023fa3f31541da8adb6eabaa"
            },
            "downloads": -1,
            "filename": "django_ace-1.38.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5f65f360b41c1ab37e56d4ff9056ae2d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">2",
            "size": 2388866,
            "upload_time": "2025-02-18T11:18:32",
            "upload_time_iso_8601": "2025-02-18T11:18:32.149036Z",
            "url": "https://files.pythonhosted.org/packages/39/89/d9e4b538819c9629e471cbb20e0b244be2dedd0af59f3789328801dcec8e/django_ace-1.38.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-18 11:18:32",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "django-ace",
    "github_project": "django-ace",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "django-ace"
}
        
Elapsed time: 1.86275s