@@ -0,0 +1,1502 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0Afrom markdown import markdown%0A%0Afrom wdom.document import get_document%0Afrom wdom.dom import Div%0Afrom wdom.themes.bootstrap3 import css_files, js_files%0Afrom wdom.themes.bootstrap3 import TextArea, Col6, Row, H1, Hr%0A%0A%0Aclass Editor(Row):%0A    def __init__(self, *args, **kwargs):%0A        super().__init__(*args, **kwargs)%0A        self.setAttribute('style', 'height: 80vh;')%0A        editor_col = Col6(parent=self)%0A        viewer_col = Col6(parent=self)%0A        self.editor = TextArea(parent=editor_col)%0A        self.editor.setAttribute('style', 'height: 80vh')%0A        self.viewer = Div(parent=viewer_col)%0A        self.viewer.setAttribute(%0A            'style',%0A            '''%0A            height: 100%25;%0A            min-height: 80vh;%0A            padding: 0 2em;%0A            border: 1px solid #ddd;%0A            border-radius: 3px;%0A            ''',%0A        )%0A%0A        self.editor.addEventListener('input', self.render)%0A        self.editor.addEventListener('change', self.render)%0A%0A    def render(self, data):%0A        html = markdown(data%5B'value'%5D)%0A        self.viewer.innerHTML = html%0A%0A%0Adef sample_page():%0A    doc = get_document()%0A    for js in js_files:%0A        doc.add_jsfile(js)%0A    for css in css_files:%0A        doc.add_cssfile(css)%0A    app = Div(parent=doc.body, style='width: 90vw; margin: auto')%0A    title = H1('Simple Markdown Editor', class_='text-center')%0A    app.appendChild(title)%0A    app.appendChild(Hr())%0A    app.appendChild(Editor())%0A    return doc%0A

Add markdown example