• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

django-ace/django-ace: Django-ace-editor is an implementation of the ajax.org Ac ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

django-ace/django-ace

开源软件地址:

https://github.com/django-ace/django-ace

开源编程语言:

JavaScript 99.9%

开源软件介绍:

django-ace

Usage

from django import forms
from django_ace import AceWidget

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

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",
        height="300px",
        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
    ))

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/
virtualenv .env
. .env/bin/activate
pip install -e ..
./manage.py makemigrations app
./manage.py migrate
./manage.py runserver

Then browser to http://localhost:8000.

Change log

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.



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap