Disable long code in markdown widget from being "scrollable" by default? #5222
-
I have a markdown widget with a long piece of python code in it. It's scrollable by default: Is it possible to not make it scrollable? (e.g. like Github doesn't make it scrollable below) from textual.app import App, ComposeResult
from textual.widgets import Markdown
EXAMPLE_MARKDOWN = """\
# Markdown Document
A large piece of python code
```python
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
\```
"""
class MarkdownExampleApp(App):
def compose(self) -> ComposeResult:
yield Markdown(EXAMPLE_MARKDOWN)
if __name__ == "__main__":
app = MarkdownExampleApp()
app.run() Thanks for any help! |
Beta Was this translation helpful? Give feedback.
Answered by
willmcgugan
Nov 8, 2024
Replies: 1 comment 1 reply
-
Add the following to your app: CSS = """
MarkdownFence { height: auto; max-height: 100%; }
""" |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
asmith26
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add the following to your app: