Skip to content

ora-0/augment

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Augment

A toy templating language

Usage

Compile the binary:

cargo build --release

Then, locate the binary in the target directory and move it out.

Provide the file as its argument, and the environment with the -i flag. Pipe stdout to a file:

augment ./index.augment.html -i name="John" > ./index.html

Example

A really scuffed example:

{@keys id name}

<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <h1>{title}</h1>
  {count}
  {#if count % 2 = 1}
  yes
  <table>
    <thead>
      <tr>
        <th>id</th>
        <th>name</th>
      </tr>
    </thead>
    <tbody>
      {#for user in users}
      <tr>
        <td>{user[id]}</td>
        <td>{user[name]}</td>
      </tr>
      {/}
    </tbody>
  </table>
  {:else}
    asdfsf
  {/}
</body>

</html>

About

A toy templating language

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages