An open API service indexing awesome lists of open source software.

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

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/).