Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Kbd plugin #266

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Django CKEditor 5
Django CKEditor 5
==================

CKEditor 5 for Django >= 2.0
Expand All @@ -7,7 +7,7 @@ Quick start
-----------

.. code-block:: bash

pip install django-ckeditor-5

1. Add "django_ckeditor_5" to your INSTALLED_APPS in your `project/settings.py` like this:
Expand Down Expand Up @@ -57,11 +57,11 @@ Quick start

CKEDITOR_5_CUSTOM_CSS = 'path_to.css' # optional
CKEDITOR_5_FILE_STORAGE = "path_to_storage.CustomStorage" # optional
CKEDITOR_5_CONFIGS = {
CKEDITOR_5_CONFIGS = {
'default': {
'toolbar': ['heading', '|', 'bold', 'italic', 'link',
'bulletedList', 'numberedList', 'blockQuote', 'imageUpload', ],

},
'extends': {
'blockToolbar': [
Expand All @@ -86,7 +86,7 @@ Quick start
'alignRight',
'alignCenter',
]

},
'table': {
'contentToolbar': [ 'tableColumn', 'tableRow', 'mergeTableCells',
Expand Down Expand Up @@ -122,15 +122,15 @@ Quick start
CKEDITOR_5_FILE_UPLOAD_PERMISSION = "staff" # Possible values: "staff", "authenticated", "any"

3. Include the app URLconf in your `project/urls.py` like this:

.. code-block:: python

from django.conf import settings
from django.conf.urls.static import static

# [ ... ]
urlpatterns += [

urlpatterns += [
path("ckeditor5/", include('django_ckeditor_5.urls')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Expand All @@ -154,21 +154,21 @@ This allows users to customize the upload file logic by specifying their own vie





4. Add to your `project/models.py`:

.. code-block:: python


from django.db import models
from django_ckeditor_5.fields import CKEditor5Field


class Article(models.Model):
title=models.CharField('Title', max_length=200)
text=CKEditor5Field('Text', config_name='extends')


Includes the following ckeditor5 plugins:

Expand Down Expand Up @@ -223,7 +223,8 @@ Includes the following ckeditor5 plugins:
ShowBlocks,
SelectAll,
FindAndReplace,
FullScreen
FullScreen,
Kbd


Examples
Expand Down Expand Up @@ -410,7 +411,7 @@ Installing from GitHub:
yarn run prod
cd your_root_project
python manage.py collectstatic

Example Sharing content styles between front-end and back-end:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
To apply ckeditor5 styling outside of the editor, download content.styles.css from the official ckeditor5 docs and include it as a styleshet within your HTML template. You will need to add the ck-content class to the container of your content for the styles to be applied.
Expand Down
20 changes: 18 additions & 2 deletions django_ckeditor_5/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions django_ckeditor_5/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@
"@ckeditor/ckeditor5-ui": "^43.2.0",
"@ckeditor/ckeditor5-upload": "^43.2.0",
"@ckeditor/ckeditor5-word-count": "^43.2.0",
"@pikulinpw/ckeditor5-fullscreen": "^1.0.1",
"@liqd/ckeditor5-file-uploader": "github:liqd/ckeditor5-file-uploader#v0.0.5"
"@liqd/ckeditor5-file-uploader": "github:liqd/ckeditor5-file-uploader#v0.0.5",
"@mlewand/ckeditor5-keyboard-marker": "^1.0.3",
"@pikulinpw/ckeditor5-fullscreen": "^1.0.1"
},
"devDependencies": {
"@ckeditor/ckeditor5-core": "^43.2.0",
Expand Down
4 changes: 3 additions & 1 deletion django_ckeditor_5/static/django_ckeditor_5/src/ckeditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ import { ShowBlocks } from '@ckeditor/ckeditor5-show-blocks';
import { SelectAll } from '@ckeditor/ckeditor5-select-all';
import { FindAndReplace } from '@ckeditor/ckeditor5-find-and-replace';
import FullScreen from '@pikulinpw/ckeditor5-fullscreen';
import Kbd from '@mlewand/ckeditor5-keyboard-marker/src/Kbd';

export default class ClassicEditor extends ClassicEditorBase {
}
Expand Down Expand Up @@ -110,5 +111,6 @@ ClassicEditor.builtinPlugins = [
ShowBlocks,
SelectAll,
FindAndReplace,
FullScreen
FullScreen,
Kbd
];