Giter Club home page Giter Club logo

django-wmd-editor's Introduction

Django WMD Editor

A WMD-Editor wrapper for Django applications.

Installation

Installing django-wmd-editor should be really as easy as possible. To install django-wmd-editor all you need to do is just follow these steps:

  1. Download and install django-wmd-editor.

    You can use PIP to install the latest version of django-wmd-editor from github like so:

     $ pip install -e git://github.com/marcuswhybrow/django-wmd-editor.git#egg=django_wmd_editor
    

    or you can run python setup.py install.

  2. Install django-wmd-editor in your django application

     INSTALLED_APPS = (
       ...
       'wmd',
       ...
     )
    
  3. In the wmd.js file on line 49, it explicitly states where images are located in your project. By default this is set to "/static/wmd/images", you must change this if your static files are located elsewhere.

    Run python manage.py collectstatic to collect the static files in all of your apps (including this one).

Usage

  1. In your models:

     from wmd import models as wmd_models
     description = wmd_models.MarkDownField()
    
  2. In your forms:

     from wmd.widgets import MarkDownInput
     description = forms.CharField(widget=MarkDownInput())
    

    Note: Use forms.CharField(widget=AdminMarkDownInput()) if you want the "preview" functionality to work in the admin.

  3. You also need to add these lines on your template to load the wmd static files:

     <head>
     	{{ form.media }}
     </head>
    

    Note: In the admin, these static files are loaded automatically.

Configuration

In your django settings file, use this configuration for setting up your django wmd editor

  • WMD_SHOW_PREVIEW: Whether to show the preview or not. This is the setting if you use the wmd editor outside the admin. Values: True, False Default: False
  • WMD_ADMIN_SHOW_PREVIEW: Whether to show the preview in the admin or not. Values: True, False Default: True

Bugs & Features request

Just file it in the issue tracker.

License

Copyright © 2009 Scrum8 (http://scrum8.com), 2011 Marcus Whybrow under BSD License.

django-wmd-editor's People

Contributors

danawoodman avatar madisona avatar mhulse avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.