coop HTML Editor
===============================================
* `What is coop_html_editor good for?`_
* `Quick start`_
* `Settings`_
.. _What is coop_html_editor good for?: #good-for
.. _Quick start?: #quick-start
.. _Settings?: #settings
.. _good-for:
What is coop_html_editor good for?
------------------------------------
coop_html_editor is a backend for using inline HTML editor into a Django site.
It enables inline editing for your HTML content.
It includes a django Form and a Widget helper.
It supports Aloha Editor and CK Editor
.. _quick-start:
Quick start
------------------------------------
In settings.py, add 'coop_html_editor' to the INSTALLED_APPS
In urls.py add ``(r'^html-editor/', include('coop_html_editor.urls'))`` to your urlpatterns
Then create a form. For example something like ::
import floppyforms.__future__ as floppyforms
from models import Note
from coop_html_editor.widgets import get_inline_html_widget
class NoteForm(floppyforms.ModelForm):
class Meta:
model = Note
fields = ('text',)
widgets = {
'text': get_inline_html_widget(),
}
Let's assume that you've a ``form`` variable pointing on an instance of a NoteForm.
In the template file, call the form and don't forget to put ``{{form.media}}`` in the headers.
.. _settings:
Settings
------------------------------------
The following constants can be set in your django project settings.py
You can choose between 2 HTML editors : Aloha editor or CkEditor. We recommend to use CkEditor but keep Aloha by default
for compatibility. Add one the 2 lines below in your settings.py
In settings::
COOP_HTML_EDITOR = 'aloha'
COOP_HTML_EDITOR = 'ck-editor'
You can tune your editor by changing the settings below. The values in this README correspond to defaults
For both, we package a default version than can be overriden by copying your own version folder in ste static files
and define the new version by
In settings::
ALOHA_VERSION = "aloha.0.23.26"
CKEDITOR_VERSION = "ckeditor.4.6.2"
The initialisation code of the editor is set in a javascript file. You can change the file to use by seetings
In settings::
ALOHA_INIT_JS_TEMPLATE = "html_editor/aloha_init.js"
CKEDITOR_INIT_JS_TEMPLATE = "html_editor/ckeditor-init.js"
If you choose CkEditor, you can add your own styles
In settings::
CKEDITOR_CSS_CLASSES = [
"{name: 'Highlight', element: 'span', attributes: {'class': 'highlight'}}",
"{name: 'Red Title', element: 'h3', styles: {color: '#880000'}}",
]
InlineHtmlInput has a "provider" that allows you to add local links to your models (articles, contacts, whatever) easily, through an autocomplete field that will search for objects based on rules you defined for each model :
* search this kind of models using get_absolute_url()
* search this kind of models using another method
* search this kind of models using a specified model field
You can set the ``HTML_EDITOR_LINK_MODELS`` setting in your settings.py to tell which django models will be available in the auto-complete field of the "add link" widget like this ::
HTML_EDITOR_LINK_MODELS = ('coop_local.Article', 'calendar.Event', )
djaloha requires jquery and is provided by default with jquery.1.7.2. You can change the jquery version if needed ::
HTML_EDITOR_JQUERY = 'js/jquery.1.7.2.js'
Aloha has a nice plugin architecture. coop_html_editor includes by default the main Aloha plugins. You may want to have a different set of plugins.
Please refer to the Aloha docs for more information on plugins ::
ALOHA_PLUGINS = (
"common/format",
"common/highlighteditables",
"common/list",
"common/link",
"common/undo",
"common/paste",
"common/commands",
"common/image",
"common/align",
"extra/attributes",
"common/characterpicker",
"common/abbr",
"common/horizontalruler",
"common/table",
"extra/browser",
)
Please note that the ``ALOHA_PLUGINS`` setting is a global setting. If you need to change the set of plugins for a specific form field, you
can pass a similar tuple in the ``aloha_plugins`` attribute of your ``coop_html_editor`` widget.
The ``extra_aloha_plugins`` attribute will add additional plugins to the default set.
``HTML_EDITOR_INIT_URL`` setting make possible to overload the aloha init file of djaloha.
``html_editor_init_url`` attribute of ``InlineHtmlInput`` can also be used to overload it for a specific form field.
License
=======
coop_html_editor is based on apidev-djaloha is a fork from credis/djaloha (see http://github.com/credis/djaloha)
coop_html_editor uses the BSD license. see license.txt
Djaloha development was funded by `CREDIS <http://credis.org/>`_, FSE (European Social Fund) and Conseil Regional d'Auvergne.
Raw data
{
"_id": null,
"home_page": "https://github.com/ljean/coop_html_editor/",
"name": "coop-html-editor",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Luc Jean",
"author_email": "ljean@apidev.fr",
"download_url": "https://files.pythonhosted.org/packages/69/3d/1de7d1fc284c09c0c8cb73e7c6aefff47655664f32ac93e608ff9e83a140/coop_html_editor-1.4.1.tar.gz",
"platform": null,
"description": "coop HTML Editor\n===============================================\n\n* `What is coop_html_editor good for?`_\n* `Quick start`_\n* `Settings`_\n\n.. _What is coop_html_editor good for?: #good-for\n.. _Quick start?: #quick-start\n.. _Settings?: #settings\n\n.. _good-for:\n\nWhat is coop_html_editor good for?\n------------------------------------\ncoop_html_editor is a backend for using inline HTML editor into a Django site.\nIt enables inline editing for your HTML content.\nIt includes a django Form and a Widget helper.\nIt supports Aloha Editor and CK Editor\n\n.. _quick-start:\n\nQuick start\n------------------------------------\nIn settings.py, add 'coop_html_editor' to the INSTALLED_APPS\nIn urls.py add ``(r'^html-editor/', include('coop_html_editor.urls'))`` to your urlpatterns\n\nThen create a form. For example something like ::\n\n import floppyforms.__future__ as floppyforms\n from models import Note\n from coop_html_editor.widgets import get_inline_html_widget\n \n class NoteForm(floppyforms.ModelForm):\n class Meta:\n model = Note\n fields = ('text',)\n widgets = {\n 'text': get_inline_html_widget(),\n }\n\n\nLet's assume that you've a ``form`` variable pointing on an instance of a NoteForm.\nIn the template file, call the form and don't forget to put ``{{form.media}}`` in the headers.\n\n.. _settings:\n\nSettings\n------------------------------------\n\nThe following constants can be set in your django project settings.py\n\nYou can choose between 2 HTML editors : Aloha editor or CkEditor. We recommend to use CkEditor but keep Aloha by default\nfor compatibility. Add one the 2 lines below in your settings.py\n\nIn settings::\n\n COOP_HTML_EDITOR = 'aloha'\n COOP_HTML_EDITOR = 'ck-editor'\n\nYou can tune your editor by changing the settings below. The values in this README correspond to defaults\n\nFor both, we package a default version than can be overriden by copying your own version folder in ste static files\nand define the new version by\n\nIn settings::\n\n ALOHA_VERSION = \"aloha.0.23.26\"\n CKEDITOR_VERSION = \"ckeditor.4.6.2\"\n\nThe initialisation code of the editor is set in a javascript file. You can change the file to use by seetings\n\nIn settings::\n\n ALOHA_INIT_JS_TEMPLATE = \"html_editor/aloha_init.js\"\n CKEDITOR_INIT_JS_TEMPLATE = \"html_editor/ckeditor-init.js\"\n\nIf you choose CkEditor, you can add your own styles\n\nIn settings::\n\n CKEDITOR_CSS_CLASSES = [\n \"{name: 'Highlight', element: 'span', attributes: {'class': 'highlight'}}\",\n \"{name: 'Red Title', element: 'h3', styles: {color: '#880000'}}\",\n ]\n\n\nInlineHtmlInput has a \"provider\" that allows you to add local links to your models (articles, contacts, whatever) easily, through an autocomplete field that will search for objects based on rules you defined for each model :\n\n* search this kind of models using get_absolute_url()\n* search this kind of models using another method\n* search this kind of models using a specified model field\n\nYou can set the ``HTML_EDITOR_LINK_MODELS`` setting in your settings.py to tell which django models will be available in the auto-complete field of the \"add link\" widget like this ::\n\n HTML_EDITOR_LINK_MODELS = ('coop_local.Article', 'calendar.Event', )\n \n \ndjaloha requires jquery and is provided by default with jquery.1.7.2. You can change the jquery version if needed ::\n\n HTML_EDITOR_JQUERY = 'js/jquery.1.7.2.js'\n \n \nAloha has a nice plugin architecture. coop_html_editor includes by default the main Aloha plugins. You may want to have a different set of plugins.\nPlease refer to the Aloha docs for more information on plugins ::\n\n ALOHA_PLUGINS = (\n \"common/format\",\n \"common/highlighteditables\",\n \"common/list\",\n \"common/link\",\n \"common/undo\",\n \"common/paste\",\n \"common/commands\",\n \"common/image\",\n \"common/align\",\n \"extra/attributes\",\n \"common/characterpicker\",\n \"common/abbr\",\n \"common/horizontalruler\",\n \"common/table\",\n \"extra/browser\",\n )\n \n\nPlease note that the ``ALOHA_PLUGINS`` setting is a global setting. If you need to change the set of plugins for a specific form field, you\ncan pass a similar tuple in the ``aloha_plugins`` attribute of your ``coop_html_editor`` widget.\nThe ``extra_aloha_plugins`` attribute will add additional plugins to the default set.\n\n``HTML_EDITOR_INIT_URL`` setting make possible to overload the aloha init file of djaloha.\n``html_editor_init_url`` attribute of ``InlineHtmlInput`` can also be used to overload it for a specific form field.\n\nLicense\n=======\n\ncoop_html_editor is based on apidev-djaloha is a fork from credis/djaloha (see http://github.com/credis/djaloha)\n\ncoop_html_editor uses the BSD license. see license.txt\n\nDjaloha development was funded by `CREDIS <http://credis.org/>`_, FSE (European Social Fund) and Conseil Regional d'Auvergne.\n",
"bugtrack_url": null,
"license": "BSD",
"summary": "integration for Inline HTML editor",
"version": "1.4.1",
"project_urls": {
"Download": "https://github.com/ljean/coop_html_editor/tarball/master",
"Homepage": "https://github.com/ljean/coop_html_editor/"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "39d3e5bacf808d601ec86a4677eb7b3e06e2f179114b0026635da9f52af60159",
"md5": "36abb0c85156f4ec154532f671f4b751",
"sha256": "842227c3036ba48f5790a1cfdd8832e3ff98d1262d751d3af705d42fd7a33bdc"
},
"downloads": -1,
"filename": "coop_html_editor-1.4.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "36abb0c85156f4ec154532f671f4b751",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 1419392,
"upload_time": "2023-06-12T12:55:10",
"upload_time_iso_8601": "2023-06-12T12:55:10.970721Z",
"url": "https://files.pythonhosted.org/packages/39/d3/e5bacf808d601ec86a4677eb7b3e06e2f179114b0026635da9f52af60159/coop_html_editor-1.4.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "693d1de7d1fc284c09c0c8cb73e7c6aefff47655664f32ac93e608ff9e83a140",
"md5": "40de4f95055658c9411087644a2f3d60",
"sha256": "d771d75fdb516638f70a256803b3b7e87fbb1639c525701f7aff5633e0584ae6"
},
"downloads": -1,
"filename": "coop_html_editor-1.4.1.tar.gz",
"has_sig": false,
"md5_digest": "40de4f95055658c9411087644a2f3d60",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 1066587,
"upload_time": "2023-06-12T12:55:13",
"upload_time_iso_8601": "2023-06-12T12:55:13.666533Z",
"url": "https://files.pythonhosted.org/packages/69/3d/1de7d1fc284c09c0c8cb73e7c6aefff47655664f32ac93e608ff9e83a140/coop_html_editor-1.4.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-12 12:55:13",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ljean",
"github_project": "coop_html_editor",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "coop-html-editor"
}