Skip to content

Commit 67099a7

Browse files
committed
launch v1.0.2
1 parent d7ebe50 commit 67099a7

File tree

7 files changed

+137
-4
lines changed

7 files changed

+137
-4
lines changed

README.rst

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,136 @@ draceditor |pypi version|
1919

2020

2121
**DracEditor** is Django Markdown Editor build for Dracos Linux https://dracos-linux.org *(Under Development Mode)*
22+
23+
24+
Features
25+
------------------------------
26+
27+
* Integrated with Ace Editor
28+
* Live Preview
29+
* Upload Image to imgur.com `(via API)`
30+
* Emoji ``:emoji_name:``
31+
* Direct Mention users `(not yet)` - ``@[username]``
32+
* Highlight ``pre``
33+
* Django Admin support
34+
* Toolbar Buttons
35+
36+
37+
Preview
38+
------------------------------
39+
40+
.. image:: https://raw.githubusercontent.com/agusmakmun/draceditor/master/__screenshot/draceditor-preview.png
41+
42+
43+
Installation
44+
------------------------------
45+
46+
DracEditor is available directly from `PyPI`_:
47+
48+
::
49+
50+
$ pip install draceditor
51+
52+
53+
***).** And don't forget to add ``'draceditor'`` to your ``'INSTALLED_APPS'`` setting `(without migrations)`.
54+
55+
56+
Requirements
57+
------------------------------
58+
59+
* ``Django>=1.10.1``
60+
* ``Markdown>=2.6.7``
61+
* ``requests>=2.12.4``
62+
63+
64+
Configurations
65+
------------------------------
66+
67+
::
68+
69+
# Imgur API Keys
70+
DRACEDITOR_IMGUR_CLIENT_ID = 'your-client-id'
71+
DRACEDITOR_IMGUR_API_KEY = 'your-api-key'
72+
73+
# Safe Mode
74+
DRACEDITOR_MARKDOWN_SAFE_MODE = True # default
75+
76+
# Markdownify
77+
DRACEDITOR_MARKDOWNIFY_FUNCTION = 'draceditor.utils.markdownify' # default
78+
79+
# Markdown extensions (default)
80+
DRACEDITOR_MARKDOWN_EXTENSIONS = [
81+
'markdown.extensions.extra',
82+
'markdown.extensions.nl2br',
83+
'markdown.extensions.smarty',
84+
'markdown.extensions.fenced_code',
85+
86+
# Custom markdown extensions.
87+
'draceditor.utils.extensions.urlize',
88+
'draceditor.utils.extensions.mention', # require for mention
89+
'draceditor.utils.extensions.emoji', # require for emoji
90+
]
91+
92+
# Markdown Extensions Configs
93+
DRACEDITOR_MARKDOWN_EXTENSION_CONFIGS = {}
94+
95+
# Markdown urls
96+
DRACEDITOR_UPLOAD_URLS_PATH = '/draceditor/uploader/' # default
97+
DRACEDITOR_SEARCH_USERS_URLS_PATH = '/draceditor/search-user/' # default
98+
99+
# Markdown Extensions
100+
DRACEDITOR_MARKDOWN_BASE_EMOJI_URL = 'https://assets-cdn.github.com/images/icons/emoji/' # default
101+
DRACEDITOR_MARKDOWN_BASE_MENTION_URL = 'https://forum.dracos-linux.org/profile/' # default (change this)
102+
103+
104+
Usage
105+
------------------------------
106+
107+
**Model**
108+
109+
::
110+
111+
from django.db import models
112+
from draceditor.models import DraceditorField
113+
114+
class Post(models.Model):
115+
description = DraceditorField()
116+
117+
118+
**Form**
119+
120+
::
121+
122+
from django import forms
123+
from draceditor.fields import DraceditorFormField
124+
125+
class PostForm(forms.Form):
126+
description = DraceditorFormField()
127+
128+
129+
**Admin**
130+
131+
::
132+
133+
from django.db import models
134+
from django.contrib import admin
135+
136+
from draceditor.widgets import AdminDraceditorWidget
137+
138+
from yourapp.models import YourModel
139+
140+
class YourModelAdmin(admin.ModelAdmin):
141+
formfield_overrides = {
142+
models.TextField: {'widget': AdminDraceditorWidget},
143+
}
144+
145+
admin.site.register(YourModel, YourModelAdmin)
146+
147+
148+
Draceditor Commands Refference
149+
--------------------------------
150+
151+
.. image:: https://raw.githubusercontent.com/agusmakmun/draceditor/master/__screenshot/draceditor-guide.png
152+
153+
154+
.. _PyPI: https://pypi.python.org/pypi/draceditor

__screenshot/draceditor-guide.png

138 KB
Loading
192 KB
Loading

draceditor/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# -*- coding: utf-8 -*-
22

3-
__VERSION__ = '1.0.0'
3+
__VERSION__ = '1.0.2'
44
__AUTHOR__ = 'Agus Makmun (Summon Agus)'
55
__AUTHOR_EMAIL__ = '[email protected]'

draceditor/settings.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
'draceditor.utils.extensions.emoji',
3333
]
3434
)
35+
36+
# Markdown Extensions Configs
3537
DRACEDITOR_MARKDOWN_EXTENSION_CONFIGS = getattr(
3638
settings, 'DRACEDITOR_MARKDOWN_EXTENSION_CONFIGS', {}
3739
)

draceditor/static/css/draceditor.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@
8181
left: 0;
8282
}
8383
}
84-
#emoji-loader-init {
84+
.ui.segment.emoji-loader-init {
8585
padding: 5em;
8686
}
8787
.insert-emoji {

draceditor/static/js/draceditor.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -506,7 +506,6 @@
506506
},
507507
error: function(response) {
508508
console.log("error", response);
509-
alert(response);
510509
}
511510
});
512511
return false;
@@ -688,7 +687,6 @@
688687
// setup initial loader
689688
segmentEmoji.html('');
690689
loaderInit.show();
691-
692690
modalEmoji.modal({
693691
onVisible: function () {
694692
for (var i = 0; i < emojiList.length; i++) {

0 commit comments

Comments
 (0)