feat: themes

This commit is contained in:
2026-04-01 10:45:02 +02:00
parent 0316e50233
commit 01a3e0095c
10 changed files with 413 additions and 66 deletions

View File

@@ -23,7 +23,7 @@ def cmd_render(args: argparse.Namespace) -> int:
source = Path(args.file).read_text(encoding="utf-8")
try:
result = uframe.compile(source, width=args.width)
result = uframe.compile(source, width=args.width, theme=getattr(args, 'theme', ''))
except UFrameError as e:
print(f"Error: {e}", file=sys.stderr)
return 1
@@ -52,7 +52,7 @@ def cmd_compile(args: argparse.Namespace) -> int:
source = source_path.read_text(encoding="utf-8")
try:
result = uframe.compile(source, width=args.width)
result = uframe.compile(source, width=args.width, theme=getattr(args, 'theme', ''))
except UFrameError as e:
print(f"Error: {e}", file=sys.stderr)
return 1
@@ -75,7 +75,7 @@ def cmd_check(args: argparse.Namespace) -> int:
source = Path(args.file).read_text(encoding="utf-8")
try:
result = uframe.compile(source, width=args.width)
result = uframe.compile(source, width=args.width, theme=getattr(args, 'theme', ''))
except UFrameError as e:
print(f"Error: {e}", file=sys.stderr)
return 1
@@ -97,7 +97,7 @@ def cmd_deploy(args: argparse.Namespace) -> int:
dest_dir = Path(args.dest or os.path.expanduser("~/.nomadnetwork/storage/pages"))
try:
result = uframe.compile(source, width=args.width)
result = uframe.compile(source, width=args.width, theme=getattr(args, 'theme', ''))
except UFrameError as e:
print(f"Error: {e}", file=sys.stderr)
return 1
@@ -130,12 +130,14 @@ def main() -> int:
p_render.add_argument("--ascii", action="store_true", help="Output ASCII only")
p_render.add_argument("--micron", action="store_true", help="Output Micron only")
p_render.add_argument("--width", type=int, default=64, help="Page width (default: 64)")
p_render.add_argument("--theme", default="", help="Theme name (default, nouveau, gothic, bamboo, circuit, brutalist)")
# compile
p_compile = sub.add_parser("compile", help="Compile to .mu file")
p_compile.add_argument("file", help="Path to .uf source file")
p_compile.add_argument("--out", help="Output file path (default: <name>.mu)")
p_compile.add_argument("--width", type=int, default=64, help="Page width")
p_compile.add_argument("--theme", default="", help="Theme name")
# check
p_check = sub.add_parser("check", help="Validate a .uf file")
@@ -147,6 +149,7 @@ def main() -> int:
p_deploy.add_argument("file", help="Path to .uf source file")
p_deploy.add_argument("--dest", help="Destination directory (default: ~/.nomadnetwork/storage/pages)")
p_deploy.add_argument("--width", type=int, default=64, help="Page width")
p_deploy.add_argument("--theme", default="", help="Theme name")
args = parser.parse_args()