DesertPlains is a template language, it compiles down to HTML
Language files has extension .desertp
Html, css and js are all written in one file
curl -L https://github.com/goncharovnikita/desert-plains/releases/latest/download/desert-plains-macOS.tar.gz > ./desert-plains-macos.tar.gz
tar -xvzf ./desert-plains-macos.tar.gz
mv ./desert-plains /usr/local/bin/desert-plains
rm ./desert-plains-macos.tar.gz
That's my fun project to learn haskell
Main idea is to create lightweight syntax to describe state of the page and add ability to compile it code using some popular libraries such as React
Everything must be enclosed in tags - []
Page should contain at least [head]
and [body]
[body
[h1 "Title of the page"]
]
Will be compiled to
<body>
<h1>Title of the page</h1>
</body>
Classes written after name of tag, divided by dot:
[body.some.class]
Will be compiled to
<body class="some class"></body>
For some reason every css modifier should be in tag:
[style
[.some-class
height: 100px;
width: auto;
]
]
Will be compiled to
<style>
.some-class {
height: 100px;
width: auto;
}
</style>
Test example with .desertp file and compiled html are in examples folder
To start compiler run desert-plains-exe --src .. --dest ..
It will start a compiler with watcher, which will compile index.desertp to index.html
- Add script engine
- Add javascript support