MCPcopy Create free account
hub / github.com/pywebio/PyWebIO / main

Function main

demos/markdown_previewer.py:8–24  ·  view source on GitHub ↗

Markdown Previewer

()

Source from the content-addressed store, hash-verified

6
7
8def 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
27if __name__ == '__main__':

Callers

nothing calls this directly

Calls 7

set_envFunction · 0.90
downloadFunction · 0.90
put_markdownFunction · 0.85
put_textareaFunction · 0.85
put_buttonsFunction · 0.85
pin_wait_changeFunction · 0.85
use_scopeFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…