Skip to main content

django-codemirror-widget is Django form widget library for using CodeMirror on textarea

Project description

Django form widget library for using CodeMirror on Textarea

Install

sudo pip install django-codemirror-widget

or

sudo pip install git+git://github.com/lambdalisue/django-codemirror-widget.git#egg=django-code-mirror

How to Use

  1. First, you need to specified CODEMIRROR_PATH on settings.py CODEMIRROR_PATH is the URI of CodeMirror directory like CODEMIRROR_PATH = r"javascript/codemirror"

  2. Use codemirror.widgets.CodeMirrorTextarea widgets for target Textarea like below:

    from django import forms
    from codemirror.widgets import CodeMirrorTextarea
    
    codemirror = CodeMirrorTextarea(
            parserfile=['parsexml.js'],
            stylesheet=[r'javascript/codemirror/css/xmlcolor.css'],
    )
    document = forms.TextField(widget=codemirror)

Settings

CODEMIRROR_PATH

the URI of CodeMirror directory

CODEMIRROR_DEFAULT_PARSER

the default parser (DEFAULT: ‘parsedummy.js’)

CODEMIRROR_DEFAULT_STYLESHEET

the default stylesheet (DEFAULT: ‘’)

Project details


Download files

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

Source Distribution

django-codemirror-widget-0.1rc3.tar.gz (362.9 kB view details)

Uploaded Source

Built Distribution

django_codemirror_widget-0.1rc3-py2.7.egg (406.1 kB view details)

Uploaded Source

File details

Details for the file django-codemirror-widget-0.1rc3.tar.gz.

File metadata

File hashes

Hashes for django-codemirror-widget-0.1rc3.tar.gz
Algorithm Hash digest
SHA256 3f90ea600f495365bc912d7c9039df382bf0ceabebde4e063c61cf12654f65de
MD5 0b9177e7d80f22e9bd49c1940b9cfaea
BLAKE2b-256 1b4a524ffd9f893249c849270200bfed6446c99be53a3811507f0e00b852d304

See more details on using hashes here.

File details

Details for the file django_codemirror_widget-0.1rc3-py2.7.egg.

File metadata

File hashes

Hashes for django_codemirror_widget-0.1rc3-py2.7.egg
Algorithm Hash digest
SHA256 654ec974cdcde6a33b1fd59ac9c1d62aa856fb25f866d95af6d2f28ebd8fe748
MD5 bca947e67fa2090ea795afbdd279f5e4
BLAKE2b-256 0bf6bc778ac8a5caba9f7595d166ca42259575c8394e26f5be08f921fdea8dcc

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