Markdown Previewer
()
| 6 | |
| 7 | |
| 8 | def main(): |
| 9 | """Markdown Previewer""" |
| 10 | set_env(output_animation=False) |
| 11 | |
| 12 | put_markdown("""# Markdown Live Preview |
| 13 | The online markdown editor with live preview. The source code of this application is [here](https://github.com/wang0618/PyWebIO/blob/dev/demos/markdown_previewer.py). |
| 14 | ## Write your Markdown |
| 15 | """) |
| 16 | put_textarea('md_text', rows=18, code={'mode': 'markdown'}) |
| 17 | |
| 18 | put_buttons(['Download content'], lambda _: download('saved.md', pin.md_text.encode('utf8')), small=True) |
| 19 | |
| 20 | put_markdown('## Preview') |
| 21 | while True: |
| 22 | change_detail = pin_wait_change('md_text') |
| 23 | with use_scope('md', clear=True): |
| 24 | put_markdown(change_detail['value'], sanitize=False) |
| 25 | |
| 26 | |
| 27 | if __name__ == '__main__': |
nothing calls this directly
no test coverage detected
searching dependent graphs…