packages/library/bet-odin
b

bet-odin

v64bf0ablibrary

No description provided.

0 stars0 forksMITupdated 3 months ago
Open repo

Bet

A simple templating language for building UI components, written in Odin.

Features

  • Lightweight and fast templating engine
  • Written in Odin for native performance
  • Simple syntax for component-based UI generation

Installation

Prerequisites

  • Odin compiler (latest version)

Build from Source

git clone https://github.com/nyehamene/bet-odin.git
cd bet
task build

This creates the bet executable in the project root.

Usage

# Build a template file
./bet build -f template.bet

# Format a template file
./bet fmt -f template.bet

# Show help
./bet help

# Show version
./bet version

Development

# Run with file watching (requires entr)
task watch -- build -f template.bet

# Run tests
task test

# Run tests with file watching
task test-watch

Grammar Definition

The language grammar is defined in a separate repository: better-template-grammar

Template Syntax

Bet uses a simple component-based syntax:

My_Fancy_Button :: component {
  text: "Click me";
  color: #fff;

  (button
    {style="color: \{color}"}
    (text))
}

Project Structure

bet/
├── src/              # Source code
│   ├── bet/          # Core library (parser, tokenizer, AST)
│   ├── build.odin    # Build system
│   └── main.odin     # CLI entry point
├── Taskfile.yml      # Development tasks

License

See LICENSE

Package Info
Version
v64bf0ab
License
MIT
Author
@nyehamene
Type
library
Forks
0
Created
4 months ago
Updated
3 months ago
Health
maintained
has releases
has readme
has license
Activity
last 56 weeks