vibrant markdown theme: colored headings, emphasis, links, code, block quotes

This commit is contained in:
Dejvino 2026-06-25 08:26:36 +02:00
parent 346de4a4f8
commit 634e84b08b

View File

@ -17,6 +17,7 @@ from textual.app import App, ComposeResult
from textual.containers import Horizontal, Vertical, VerticalScroll
from textual.widgets import Button, Static, TabbedContent, TabPane
from rich.markdown import Markdown as RichMarkdown
from rich.theme import Theme
# ── Optional miniaudio ────────────────────────────────────
try:
@ -44,6 +45,21 @@ LOG_PATH = LOG_DIR / f'{TODAY}.md'
REFRESH_SECS = 2
MARKDOWN_THEME = Theme({
"markdown.h1": "bold #ff6b6b on #2a0000",
"markdown.h2": "bold #ffd93d",
"markdown.h3": "bold italic #6bcbff",
"markdown.h4": "bold #95e1d3",
"markdown.code": "bold #00d2d3 on #002222",
"markdown.code_block": "on #1e1e2e",
"markdown.block_quote": "dim italic #8395a7",
"markdown.link": "underline #48dbfb",
"markdown.item": "#ff9f43",
"markdown.em": "italic #ff9ff3",
"markdown.strong": "bold #feca57",
"markdown.horizontal_rule": "dim #555555",
})
# ── Helpers ──────────────────────────────────────────────
def ensure_log():
@ -474,6 +490,7 @@ class ChaosTUI(App):
def on_mount(self):
ensure_log()
self.console._theme = MARKDOWN_THEME
self._reload_book()
self._render_book_page()
self.set_interval(REFRESH_SECS, self._check_ambience)