(no commit message)

This commit is contained in:
2026-01-18 22:37:06 -08:00
parent 2945d17b91
commit 192a744884
12 changed files with 599 additions and 0 deletions

25
utils/display.py Normal file
View File

@@ -0,0 +1,25 @@
"""Display and UI utilities for nanocode."""
import os
import re
# ANSI colors
RESET = "\033[0m"
BOLD = "\033[1m"
DIM = "\033[2m"
BLUE = "\033[34m"
CYAN = "\033[36m"
GREEN = "\033[32m"
YELLOW = "\033[33m"
RED = "\033[31m"
MAGENTA = "\033[35m"
def separator():
"""Return a horizontal separator line that fits the terminal width."""
return f"{DIM}{'' * min(os.get_terminal_size().columns, 80)}{RESET}"
def render_markdown(text):
"""Convert basic markdown bold syntax to ANSI bold."""
return re.sub(r"\*\*(.+?)\*\*", f"{BOLD}\\1{RESET}", text)