Spaces:
Running
Running
File size: 1,390 Bytes
8e04495 d8d6fe1 8e04495 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
import mesop as me
SAMPLE_MARKDOWN = """
# Sample Markdown Document
## Table of Contents
1. [Headers](#headers)
2. [Emphasis](#emphasis)
3. [Lists](#lists)
4. [Links](#links)
5. [Code](#code)
6. [Blockquotes](#blockquotes)
7. [Tables](#tables)
8. [Horizontal Rules](#horizontal-rules)
## Headers
# Header 1
## Header 2
### Header 3
#### Header 4
##### Header 5
###### Header 6
## Emphasis
*Italic text* or _Italic text_
**Bold text** or __Bold text__
***Bold and Italic*** or ___Bold and Italic___
## Lists
### Unordered List
- Item 1
- Item 2
- Subitem 2.1
- Subitem 2.2
### Ordered List
1. First item
2. Second item
1. Subitem 2.1
2. Subitem 2.2
## Links
[Google](https://www.google.com/)
## Inline Code
Inline `code`
## Code
```python
import mesop as me
@me.page(path="/hello_world")
def app():
me.text("Hello World")
```
## Table
First Header | Second Header
------------- | -------------
Content Cell | Content Cell
Content Cell | Content Cell
"""
def on_load(e: me.LoadEvent):
me.set_theme_mode("system")
@me.page(
security_policy=me.SecurityPolicy(
allowed_iframe_parents=["https://mesop-dev.github.io"]
),
path="/markdown_demo",
on_load=on_load,
)
def app():
with me.box(
style=me.Style(background=me.theme_var("surface-container-lowest"))
):
me.markdown(SAMPLE_MARKDOWN, style=me.Style(margin=me.Margin.all(15)))
|