Skip to content
Standalone editor for your markdown files
Branch: master
Clone or download
ncornette Merge pull request #13 from llazzaro/master
Update readme example and some PEP8 fixes
Latest commit 16313ad Jun 11, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
markdown_editor
.gitignore
.travis.yml
MANIFEST.in
README.rst
markdown_edit.py
requirements.txt Add compatibility with pymdownx 2.0+ Feb 13, 2017
screenshot.png
setup.cfg
setup.py
test_markdown_edit.py

README.rst

Python-Markdown-Editor

Build Status PyPI py versions PyPI version

Standalone editor for your local markdown files

Installation

To install the latest stable version from Pypi :

$ pip install markdown-editor

Usage

$ markdown_edit README.md

It will open the editor in your browser :

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 :

$ markdown_edit

Edit markdown file and save both markdown and html outputs :

$ 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 :

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)
You can’t perform that action at this time.