Skip to content

kryonlabs/ktml

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

KTML - Kryon Text Markup Language

KTML (Kryon Text Markup Language) is a minimalist markup language for the TaijiOS ecosystem. It compiles to static, dependency-free HTML5 with a retro "Windows 95" aesthetic.

Philosophy

KTML is designed to be:

  • Simple: A clean, readable syntax for web content
  • Retro: Generates HTML with classic Windows 95 styling
  • Static: No JavaScript, no dependencies, pure HTML/CSS
  • Portable: Single-file output that works anywhere

Installation

Via Nix (Recommended)

git clone https://github.com/KryonLabs/ktml.git
cd ktml
nix-shell

Manual Installation

# Install Janet (https://janet-lang.org/)
# Install jpm (Janet Package Manager)

# Clone the repository
git clone https://github.com/KryonLabs/ktml.git
cd ktml

Usage

# Compile to stdout
janet src/main.janet input.ktml > output.html

# Compile to file
janet src/main.janet input.ktml -o output.html

# Run tests
janet tests/parser-test.janet

KTML Syntax

Document Structure

Site {
  title = "My Site"
  theme = "win95-grey"
}

Header {
  title = "Welcome"
  tagline = "To TaijiOS"
}

Nav [
  "HOME": "#home"
  "ABOUT": "#about"
]

Section "home" {
  Title "Hello, World!"

  Text {
    Welcome to TaijiOS! This is a [b]bold[/b] statement.
    Visit [Link "KryonLabs" "https://kryonlabs.com"] for more.
  }

  Note {
    This is a highlighted note box.
    Great for important information!
  }

  Code "kryon" {
    fn main() {
      sys.println("Hello, TaijiOS!")
    }
  }
}

Block Elements

  • Site { title = "...", theme = "..." } - Root container with properties
  • Header { title = "...", tagline = "..." } - Page header banner
  • Nav [ "LABEL": "url", ... ] - Navigation bar
  • Section "id" { ... } - Content section with anchor ID
  • Title "text" - Section heading
  • Text { ... } - Paragraph text with inline markup
  • Note { ... } - Yellow highlighted note box
  • Code "lang" { ... } - Code block with syntax highlighting

Inline Elements

  • Link: [Link "text" "url"]
  • Bold: [b]text[/b]
  • Italic: [i]text[/i]

Supported Languages

  • kryon - Kryon programming language
  • sh or bash - Shell scripts
  • plain - No highlighting

Example

See examples/site.ktml for a complete example demonstrating all features.

janet src/main.janet examples/site.ktml > examples/index.html

License

MIT License - See LICENSE for details.

About

Kryon Text Markup Language

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages