{ "info": { "author": "DeanWu", "author_email": "pyli.xm@gmail.com", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "Framework :: Django", "Framework :: Django :: 1.10", "Framework :: Django :: 1.11", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Framework :: Django :: 1.9", "Framework :: Django :: 2.0", "Framework :: Django :: 2.1", "Framework :: Django :: 2.2", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License v3 (GPLv3)", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "# django-mdeditor\n\n\n[](https://github.com/pylixm/django-mdeditor)\n[](./README_CN.md)\n[](https://gitter.im/django-mdeditor/Lobby)\n[](https://github.com/pylixm/django-mdeditor)\n[](https://github.com/pylixm/django-mdeditor)\n[](https://github.com/pylixm/django-mdeditor/master/LICENSE.txt)\n\n\n\n**Django-mdeditor** is Markdown Editor plugin application for [django](djangoproject.com) base on [Editor.md](https://github.com/pandao/editor.md).\n\n**Django-mdeditor** was inspired by great [django-ckeditor](https://github.com/django-ckeditor/django-ckeditor).\n\n**Note:** For Markdown page rendering issues, backend rendering is recommended. Because `Editor.md` has not been updated for a long time, some bugs and compatibility issues need to be debugged. Of course, front-end students can choose.\n\n## Features\n\n- Almost Editor.md features \n - Support Standard Markdown / CommonMark and GFM (GitHub Flavored Markdown);\n - Full-featured: Real-time Preview, Image (cross-domain) upload, Preformatted text/Code blocks/Tables insert, Search replace, Themes, Multi-languages;\n - Markdown Extras : Support ToC (Table of Contents), Emoji;\n - Support TeX (LaTeX expressions, Based on KaTeX), Flowchart and Sequence Diagram of Markdown extended syntax;\n- Can constom Editor.md toolbar \n- The MDTextField field is provided for the model and can be displayed directly in the django admin.\n- The MDTextFormField is provided for the Form and ModelForm.\n- The MDEditorWidget is provided for the Admin custom widget.\n\n\n## Quick start\n\n- Installation.\n```bash\n pipenv install django-mdeditor\n # or\n pip install django-mdeditor\n```\n\n- Add `mdeditor` to your INSTALLED_APPS setting like this:\n```python\n INSTALLED_APPS = [\n ...\n 'mdeditor',\n ]\n```\n\n- Add 'media' url to your settings like this:\n```python\nMEDIA_ROOT = os.path.join(BASE_DIR, 'uploads')\nMEDIA_URL = '/media/'\n\n```\nMake folder `uploads/editor` in you project for media files. \n\n- Add url to your urls like this:\n```python\nfrom django.conf.urls import url, include\nfrom django.conf.urls.static import static\nfrom django.conf import settings\n...\n\nurlpatterns = [\n ...\n url(r'mdeditor/', include('mdeditor.urls'))\n]\n\nif settings.DEBUG:\n # static files (images, css, javascript, etc.)\n urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)\n\n```\n\n- Write your models like this:\n```python\nfrom django.db import models\nfrom mdeditor.fields import MDTextField\n\nclass ExampleModel(models.Model):\n name = models.CharField(max_length=10)\n content = MDTextField()\n```\n\n- Register your model in `admin.py`\n\n- Run `python manage.py makemigrations` and `python manage.py migrate` to create your models.\n\n- Login Admin ,you can see a markdown editor text field like this:\n\n\n\n\n## Usage\n\n### Edit fields in the model using Markdown\n\nUsing Markdown to edit the fields in the model, we simply replace the `TextField` of the model with` MDTextField`.\n\n```python\nfrom django.db import models\nfrom mdeditor.fields import MDTextField\n\nclass ExampleModel (models.Model):\n\u00a0\u00a0\u00a0\u00a0name = models.CharField (max_length = 10)\n\u00a0\u00a0\u00a0\u00a0content = MDTextField ()\n```\n\nAdmin in the background, will automatically display markdown edit rich text.\n\nUsed in front-end template, you can use like this:\n```python\n{% load staticfiles%}\n\n\n\u00a0\u00a0\u00a0\u00a0
\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\n\n\u00a0\u00a0\u00a0\u00a0 head>\n\u00a0\u00a0\u00a0\u00a0\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0