Very experimental, and early access version of the Wax compiler.
The current CLI uploaded to crates.io is an old version which can be found on the legacy
branch.
Install the Wax cli using cargo :
$ cargo install wax-cli
Create new project
$ wax create <NAME>
Build your project
$ wax build <PATH>
./<my-wax-site>/*
│
├─ .wax - # Wax file cache
├─ build/ - # Wax build output
│
├─ src/*
│ ├─ lib/ - # Wax components (*.wx)
│ ├─ pages/ - # Wax page components (*.wx)
│ ├─ index.html - # Html template file
│ └─ ...
│
└─ wax.toml - # Wax config file
Wax components are build out of three parts.
Contain Html that can be inserted into other templates using the insert (<-
) operator.
Example : Wax Html Template
tmpl Hello:
<p>Hello, World!</p>;
tmpl @base:
<-Hello />; <!-- <p>Hello, World!</p> -->
@base
is a special tag which makes this template the basis for a page.
Every component within the /pages
dir should have an @base
template.
Contain Css that is linked to a template of the same name.
Example : Wax Css Stylesheet
tmpl Hello:
<p>Hello, World!</p>;
styl Hello {
p {
color: red;
}
}
Example : Wax JS Implementation
tmpl Hello:
<p #paragraph>Hello, World!</p>;
impl Hello {
#paragraph.textContent = 'Hello, Wax!';
}
Example : Wax Using Statement
use Hello from "./lib/hello.wx";
tmpl @base:
<-Hello />; <!-- <p>Hello, World!</p> -->
* ? : means it is optional
# wax.toml
[website]
pages = "RelativePath" # Path to the directory containing your index.html.
[build]
minify = "Boolean?" # If enabled, will minify the collapsed HTML files.