Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -167,13 +167,13 @@ import html as py_html
|
|
| 167 |
from streamlit.components.v1 import html as st_html
|
| 168 |
|
| 169 |
def display_dialogue_with_numbers(text: str, title="Dialogue"):
|
| 170 |
-
with st.
|
| 171 |
# optional: wrap long lines instead of horizontal scrolling
|
| 172 |
st.markdown(
|
| 173 |
"<style>.stCode pre {white-space: pre-wrap !important; word-break: break-word !important;}</style>",
|
| 174 |
unsafe_allow_html=True,
|
| 175 |
)
|
| 176 |
-
st.code(text, language="
|
| 177 |
|
| 178 |
def markdown_with_line_numbers(text: str, height: int = 500):
|
| 179 |
# Number *source lines* (not wrapped visual lines)
|
|
|
|
| 167 |
from streamlit.components.v1 import html as st_html
|
| 168 |
|
| 169 |
def display_dialogue_with_numbers(text: str, title="Dialogue"):
|
| 170 |
+
with st.container(f"{title} (line numbers)", expanded=True):
|
| 171 |
# optional: wrap long lines instead of horizontal scrolling
|
| 172 |
st.markdown(
|
| 173 |
"<style>.stCode pre {white-space: pre-wrap !important; word-break: break-word !important;}</style>",
|
| 174 |
unsafe_allow_html=True,
|
| 175 |
)
|
| 176 |
+
st.code(text, language="markdown", line_numbers=True)
|
| 177 |
|
| 178 |
def markdown_with_line_numbers(text: str, height: int = 500):
|
| 179 |
# Number *source lines* (not wrapped visual lines)
|