acutis-lang
v0.28.1
Published
A simple and type-safe template language
Downloads
118
Maintainers
Readme
Project home | Source code | Mailing list | Documentation
The Acutis template language
Acutis is a template language that features static typing, pattern matching, and asynchronous template components. You can execute your templates like scripts or compile them to self-contained JavaScript files.
Acutis is an experimental, personal project and is not stable.
<h1> Blog posts for {% siteTitle %} </h1>
{%~ map blogPosts with {image, title, content, date, author: {name}} %}
<article class="h-entry">
<header>
{% match image with null ~%}
{* no image *}
{%~ with !{src, alt} ~%}
<img src="{% src %}" alt="{% alt %}">
{% /match ~%}
<h2 class="p-name"> {% title %} </h2>
<span class="p-author"> By {% name ? "Anonymous" %} </span>
<span class="dt-published"> Posted on {% date %} </span>
</header>
<div class="e-content"> {{% content %}} </div>
</article>
{%~ /map %}See how this example compiles in the playground.
Usage in OCaml
The Acutis source is written in OCaml. You can install it with the OCaml package manager, OPAM.
opam pin acutis git+https://git.sr.ht/~johnridesabike/acutisJavaScript & Eleventy plugin
You can use npm to install a JavaScript build of Acutis. This includes an Eleventy plugin.
Install the JavaScript package in your project:
npm install acutis-langRead more about its usage in the documentation.
Development
To get started developing this project, clone its source code repository with Git. Then create a development OPAM switch:
opam switch create . --deps-only --with-test --with-docUse Dune to compile the code:
dune buildOr use Dune to compile the code and also run the tests:
dune build @ciSend patches to ~johnridesabike/[email protected].
License
Acutis was created and is maintained by John Jackson.
Copyright (c) 2022 John Jackson.
This Source Code Form is subject to the terms of the Mozilla Public
License, v. 2.0. If a copy of the MPL was not distributed with this
file, You can obtain one at http://mozilla.org/MPL/2.0/.