https://github.com/refi64/protic
Zero-effort HTML preprocessing/templating, with conditionals, includes, macros, and more
https://github.com/refi64/protic
Last synced: 5 months ago
JSON representation
Zero-effort HTML preprocessing/templating, with conditionals, includes, macros, and more
- Host: GitHub
- URL: https://github.com/refi64/protic
- Owner: refi64
- License: bsd-2-clause
- Created: 2017-12-08T21:51:41.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2019-09-01T20:39:59.000Z (almost 7 years ago)
- Last Synced: 2025-03-25T05:06:47.405Z (about 1 year ago)
- Language: JavaScript
- Homepage: https://refi64.com/protic
- Size: 810 KB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# protic
Zero-effort HTML preprocessing/templating, with conditionals, includes, macros, and more.
## Learning More
Check out [the docs](https://refi64.com/protic), and try out
[the live demo](https://refi64.com/protic/demo.html).
## Example
```html
<+ if="$config == dev" do>
Development build!
<+ orelse do>
Production build!
+>
<+ include="myfile.html">
<+ if="$config == dev" include="dev.html">
<+ else include="prod.html">
<+ set var="value">
<+ set width="20px">
<+ for var to="a b c">
+>
<+ macro="expand" slot>
Your name is: <+ value="$@name">
<+ if="$@?is-upper" do>
Is uppercase!
+>
<+ print="is-upper: ($@?is-upper and true or false) myname: $@name">
<+ slot>
+>
<+@ expand name="myname" is-upper>
Stuff here
+@>
<+ require="myfile.html">
```
## Source code structure
- `protic` - The protic core code, written in Dart.
- `protic-js` - protic, compiled to JavaScript for use in Node or the browser.
- `protic_transformer` - A Dart Pub transformer for protic
- `docs` - Website/documentation, powered by [Docute](https://docute.js.org/).