Skip to main content

Django admin CKEditor integration and added TOC .

Project description

Deprecation notice

I do not recommend using this package anymore since the open source version of CKEditor 4 has unfixed security issues. More on this in my blog post. Alternatives are listed here on Django Packages. I personally am using django-prose-editor. Thanks!

Django CKEditor powerd by django-ckeditor

https://img.shields.io/pypi/v/django-ckeditor-with-toc.svg

Django CKEditor Configurations.

Here, I will only explain how to configure the Table of Contents (TOC) in django-ckeditor, but to view the full django-ckeditor documentation, click here.

Example ckeditor configuration

CKEDITOR_CONFIGS = {
    'default': {
        'skin': 'moono',
        # 'skin': 'office2013',
        'toolbar_Basic': [
            ['Source', '-', 'Bold', 'Italic']
        ],
        'toolbar_YourCustomToolbarConfig': [
            {'name': 'document', 'items': ['Source', '-', 'Save', 'NewPage', 'Preview', 'Print', '-', 'Templates']},
            {'name': 'clipboard', 'items': ['Cut', 'Copy', 'Paste', 'PasteText', 'PasteFromWord', '-', 'Undo', 'Redo']},
            {'name': 'editing', 'items': ['Find', 'Replace', '-', 'SelectAll']},
            {'name': 'forms',
             'items': ['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton',
                       'HiddenField']},
            '/',
            {'name': 'basicstyles',
             'items': ['Bold', 'Italic', 'Underline', 'Strike', 'Subscript', 'Superscript', '-', 'RemoveFormat']},
            {'name': 'paragraph',
             'items': ['NumberedList', 'BulletedList', '-', 'Outdent', 'Indent', '-', 'Blockquote', 'CreateDiv', '-',
                       'JustifyLeft', 'JustifyCenter', 'JustifyRight', 'JustifyBlock', '-', 'BidiLtr', 'BidiRtl',
                       'Language']},
            {'name': 'links', 'items': ['Link', 'Unlink', 'Anchor']},
            {'name': 'insert',
             'items': ['Image', 'Flash', 'Table', 'HorizontalRule', 'Smiley', 'SpecialChar', 'PageBreak', 'Iframe']},
            '/',
            {'name': 'styles', 'items': ['Styles', 'Format', 'Font', 'FontSize']},
            {'name': 'colors', 'items': ['TextColor', 'BGColor']},
            {'name': 'tools', 'items': ['Maximize', 'ShowBlocks']},
            {'name': 'about', 'items': ['About']},
            '/',  # put this to force next toolbar on new line
            {'name': 'yourcustomtools', 'items': [
                # put the name of your editor.ui.addButton here
                'Preview',
                'Maximize',

            ]},
        ],
        'toolbar': 'YourCustomToolbarConfig',  # put selected toolbar config here
        # 'toolbarGroups': [{ 'name': 'document', 'groups': [ 'mode', 'document', 'doctools' ] }],
        # 'height': 291,
        # 'width': '100%',
        # 'filebrowserWindowHeight': 725,
        # 'filebrowserWindowWidth': 940,
        # 'toolbarCanCollapse': True,
        # 'mathJaxLib': '//cdn.mathjax.org/mathjax/2.2-latest/MathJax.js?config=TeX-AMS_HTML',
        'tabSpaces': 4,
        'extraPlugins': ','.join([
            'uploadimage', # the upload image feature
            # your extra plugins here
            'div',
            'autolink',
            'autoembed',
            'embedsemantic',
            'autogrow',
            'toc',
            # 'devtools',
            'widget',
            'lineutils',
            'clipboard',
            'dialog',
            'dialogui',
            'elementspath'
        ]),
    }
}

AUTHORS

Created By

  1. shaunsephton

Contributors

  1. riklaunim

  2. 3point2

  3. buchuki

  4. chr15m

  5. hedleyroos

  6. jeffh

  7. lihan

  8. loop0

  9. mwcz

  10. tomwys

  11. snbuback

  12. added toc alighazali

  13. And others https://github.com/django-ckeditor/django-ckeditor/graphs/contributors

Changelog

Unreleased

1.0.1

#. changed README 1.0.0 —–

  1. added TOC to django-ckeditor

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

django_ckeditor_with_toc-1.0.1-py3-none-any.whl (2.4 MB view details)

Uploaded Python 3

File details

Details for the file django_ckeditor_with_toc-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for django_ckeditor_with_toc-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a98a35324bc2c9f7a0ba97e1c729253c77d1af688e0237e8e8683743d701f474
MD5 6511060ba3e71b7abe009eefbd239ba2
BLAKE2b-256 4f77a57d223a23ccfc453e8d1404b8cadda667b35badd5d381111b2ca457d215

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page