MDE-Editor
A web editor for the Markdown-Extended (MDE) syntax., (*1)
This editor is a custom version of the original EpicEditor
to use the PHP MarkdownExtended parser.
It uses the MDE-Service PHP interface to post
the markdown content of the editor (via a synchronous XMLHttpRequest) at each run
(the original content is not parsed in JavaScript)., (*2)
This editor is available online at http://dingus.aboutmde.org/., (*3)
Installation
Manual installation
To install and use it, you will need Bower and Composer:, (*4)
wget --no-check-certificate https://github.com/markdown-extended/mde-editor/archive/master.tar.gz
tar -xvf master.tar.gz
cd mde-editor-master
bower install
composer install
Then you can browse the demonstration page: http://your.localhost/path/to/mde-editor-master/., (*5)
Usage as a Bower dependency
The MDE-Editor is registered into Bower. BUT, as
it remains on a PHP application, to get a "ready-to-use" editor (installed with the required
PHP scripts), you MUST use the bower branch of the package as follows:, (*6)
bower install mde-editor#bower --save
Or you may write in your bower.json configuration file:, (*7)
"dependencies": {
"mde-editor": "bower"
}
Usage
Usage of the MDE-Editor is very similar to the one of EpicEditor
except that:, (*8)
-
you must include the mde-editor.js script AFTER the original epiceditor(.min).js:, (*9)
<script src="mde-editor/mde-editor.js"></script>
-
you must create a MdeEpicEditor object instead of the original EpicEditor:, (*10)
var editor = new MdeEpicEditor().load();
-
the default ID of the DOM block which will finally embed the editor is mde-editor:, (*11)
<div id="mde-editor"></div>
If you move the package files, you NEED to keep the mde_editor_interface.php PHP script
in the same directory as the mde-editor.js (or override the parser_options settings -
see below) and redefine the basePath option to fit your environment. You also need to
redefine the $autoloader variable at the top of the mde_editor_interface.php script., (*12)
Options
The default options of the MDE-Editor are (they will be merged with the
default EpicEditor options in final object):, (*13)
container: 'mde-editor',
basePath: 'bower_components/epiceditor/epiceditor/',
autogrow: true,
file: {
name: 'mde-editor',
defaultContent: 'Type your *markdown*-**extended** content here ...',
autoSave: 5000
},
parserOptions: {
silent: false,
interface: 'mde-editor/mde_editor_interface.php',
mdeOptions: {}
}
The last parserOptions element concerns the MDE parser:, (*14)
-
the parserOptions.silent is a flag to see errors or not;, (*15)
-
the parserOptions.interface is the path to the PHP interface file from the
current document ; you can also use a "online" value to use the online webservice
available at http://api.aboutmde.org/ (this can be useful for a package installed
via Bower for instance, as the PHP dependencies may be not installed) ;, (*16)
-
the parserOptions.mdeOptions entry is a table of options passed to the
PHP-MarkdownExtended
parser to let you make custom parsings ; please note that the elements of this
entry must follow an underscored notation (no camel-case)., (*17)
License
MDE-Editor is authored by Pierre Cassat and licensed under a MIT license., (*18)
To transmit a bug or a feature request, see http://github.com/markdown-extended/mde-editor/issues., (*19)