Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ncornette/python-markdown-editor

Standalone editor for your markdown files
https://github.com/ncornette/python-markdown-editor

bottle bottlepy browser editor extensible gfm javascript markdown modular python-2 python-3

Last synced: about 1 month ago
JSON representation

Standalone editor for your markdown files

Awesome Lists containing this project

README

        

Python-Markdown-Editor
======================

|Build Status| |PyPI py versions| |PyPI version| |Code quality|

Standalone editor for your local markdown files

Installation
~~~~~~~~~~~~

To install the latest stable version from Pypi :

.. code:: sh

$ pip install markdown-editor

Usage
~~~~~

.. code:: sh

$ markdown_edit README.md

It will open the editor in your browser :

.. figure:: https://github.com/ncornette/Python-Markdown-Editor/raw/master/screenshot.png
:alt: screenshot

screenshot

Features
~~~~~~~~

- Side-by-side markdown editor & html preview
- Live, when you type html preview
- Codehilite & markdown extra syntax support by default
- Github syntax support
- Github styles for rendering and codehilite
- Scrollbars sync

Dependencies
~~~~~~~~~~~~

- Markdown
- Pygments
- Bottle
- pymdown-extensions

Other usage examples
~~~~~~~~~~~~~~~~~~~~

Launch editor without input file for testing :

.. code:: bash

$ markdown_edit

Edit markdown file and save both markdown and html outputs :

.. code:: bash

$ markdown_edit -f README.html README.md

Extensible
~~~~~~~~~~

You can import this script as a module to write your own applications
based on the markdown editor.

example :

.. code:: python

from markdown_editor import web_edit
from markdown_editor.editor import MarkdownDocument

# ...

MY_HTML_HEAD = 'Editor title'

def action_send(document):

send_markdown_text(document.text)
# or
send_raw_html_code(document.getHtml())
# or
send_html_with_styles(document.getHtmlPage())

return html_to_display_as_result, keep_running_local_server

if __name__ == '__main__:
doc = MarkdownDocument()
web_edit.start(doc,
custom_actions=[
('Send', action_send),
],
title=MY_HTML_HEAD)

.. |Build Status| image:: https://travis-ci.org/ncornette/Python-Markdown-Editor.svg?branch=master
:target: https://travis-ci.org/ncornette/Python-Markdown-Editor
.. |PyPI py versions| image:: https://img.shields.io/pypi/pyversions/Markdown-Editor.svg?maxAge=2592000
:target: https://pypi.python.org/pypi/Markdown-Editor
.. |PyPI version| image:: https://img.shields.io/pypi/v/Markdown-Editor.svg?maxAge=2592000
:target: https://pypi.python.org/pypi/Markdown-Editor
.. |Code quality| image:: https://api.codacy.com/project/badge/Grade/189b747c1f874f3090168cae42b35217
:target: https://www.codacy.com/manual/nicolas-cornette/Python-Markdown-Editor?utm_source=github.com&utm_medium=referral&utm_content=ncornette/Python-Markdown-Editor&utm_campaign=Badge_Grade