Markdown
Use markup language for creating formatted text.
Function signature
app.markdown_widget(body, line_numbers=False, cssClassName='', cssStyles=None)
Parameters
Parameter | Description |
---|---|
body (str) | Markdown text |
line_numbers | Enables / Disables line numbers. |
cssClassName (str) | HTML class attribute |
cssStyles (Dict[str, Any]) | CSS properties |
Example
The example below shows how to create a basic markdown widget.
from shapelets.apps import dataApp, markdown
# Set up the app
app = dataApp()
# Set the title of the app
app.title('Markdown Example App')
# A sample markdown text
sample_md = """
# Markdown Description
This is a sample markdown text. You can write text using **bold** formatting, as well as *italic* formatting.
## Lists
### Unordered List
- First item
- Second item
- Third item
- Subitem 1
- Subitem 2
### Ordered List
1. First element
2. Second element
1. Sub-element 1
2. Sub-element 2
3. Third element
## Links and Images
Here is a [link to Shapelets](https://shapelets.io/).
![Python Logo](https://www.python.org/static/community_logos/python-logo.png)
"""
Note
-
Indentation before
#
and the text will result in a conflict when you have multiple text lines. -
As an example, this would work:
app.markdown("""
# Introduction""")
- On the other hand, this won't work:
app.markdown("""
# Introduction""")