You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fromtextual.appimportApp, ComposeResultfromtextual.containersimportVerticalScrollfromtextual.widgetsimportHeader, Footer, MarkdownMARKDOWN="""\# Hello world!Here is some Python code in a code block:```pythondef hello() -> str: return "Hello!"```Here is some plain text in a code block:```Hello!```"""classMDCodeBlocksApp( App[ None ] ):
defcompose( self ) ->ComposeResult:
yieldHeader()
withVerticalScroll():
yieldMarkdown( MARKDOWN )
yieldFooter()
defon_mount( self ) ->None:
self.dark=Falseif__name__=="__main__":
MDCodeBlocksApp().run()
results in this:
Note how code blocks are always a dark background but in light mode the text for the block with no syntax inverts the text colour. Here's the same code but with the one true mode:
The text was updated successfully, but these errors were encountered:
The following code:
results in this:
Note how code blocks are always a dark background but in light mode the text for the block with no syntax inverts the text colour. Here's the same code but with the one true mode:
The text was updated successfully, but these errors were encountered: