Binx syntax similar to xml syntax. Anyone knows xml syntax can easily write a binx document.
import { compile } from "/path/to/binx/index.js";
const compiled = compile(`!DOCTYPE[html]
html[lang="tr"]{
head{
title{BINX}
}
body{
p#tag-id.tag-class.class2[style="color:gray;"]{
\\tbinx is\\s not\\nxml
}
}
script[src="./script.js"]{}
}`);
console.log(compiled.type, compiled.output);
-
compile
orc
Compiles binx file into xml/html.
If output not specified, writes to stdout. -
serve
ors
serves path on local host. -
version
print binx version -
help
shows help menu
# writes output to stdout
$ binx compile /path/to/input.bx
# writes output to output file
$ binx c /path/to/input.bx /path/to/output.html
# compiles and serves path on local host
$ binx serve /path/
# compiles and serves path on local host with spesific port
# default is 8080
$ binx serve /path/ 3000
Important
Document type specifying is required on document start.
``` Document start ```
!DOCTYPE[html]
Important
The ID must always be specified before the class. And binx does not supports inline JavaScript and CSS coding.
<tag-name attribute="value" id="tag-id" class="class class2">
tag content
</tag-name>
tag-name#tag-id.class.class2[attribute="value"]{
tag content
}
<tag-name attribute="value" id="tag-id" class="class class2" />
tag-name#tag-id.class.class2[attribute="value"]&
<tag-name attribute="value" id="tag-id" class="class class2">
tag-name#tag-id.class.class2[attribute="value"]%
<?php echo 'Hello, world!'; ?>
?php{
echo 'Hello, world!';
}
<!DOCTYPE html>
!DOCTYPE[html]
<tag-name id="tag-id"></tag-name>
tag-name#tag-id{}
<tag-name class="class class2"></tag-name>
tag-name.class.class2{}
<tag-name attribute="value"></tag-name>
tag-name[attribute="value"]{}
<br>
<br/>
\n
\
\\
 
\t
\s