Skip to content

ImShyMike/BTML

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BTML

PyPI - Version PyPI - Python Version

HTML but with curly brackets


Ever felt like plain HTML is lacking some curly brackets? Worry no more, BTML fixes that for you!

Plain HTML (bad):

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <title>My First Web Page</title>
</head>
<body style="background-color: #dddddd">
  <!--  This is a comment  -->
  <h1>Welcome to My Web Page</h1>
  <p>This is a simple BTML example with a button below.</p>
  <button onclick="alert('Hello, world!')">Click Me</button>
</body>
</html>

BTML (much better):

!html!
html[lang="en"] {
  head {
    meta[charset="UTF-8"].
    title "My First Web Page"
  }
  body[style="background-color: #dddddd"] {
    <# This is a comment #>
    h1 "Welcome to My Web Page"
    p "This is a simple BTML example with a button below."
    button[onclick="alert('Hello, world!')"] "Click Me"
  }
}

Installation

BTML can be installed from PyPI using pip:

pip install btml

or using uv's tools feature:

uv tool install btml

Usage

After installing, run:

btml

or if that doesn't work:

pythom -m btml

If installed using uv:

uv tool run btml

License

btml is distributed under the terms of the MIT license.