https://github.com/johnridesabike/acutis
Mirror for https://sr.ht/~johnridesabike/acutis/
https://github.com/johnridesabike/acutis
compiler eleventy handlebars mustache nunjucks ocaml template-engine template-language
Last synced: 3 months ago
JSON representation
Mirror for https://sr.ht/~johnridesabike/acutis/
- Host: GitHub
- URL: https://github.com/johnridesabike/acutis
- Owner: johnridesabike
- License: mpl-2.0
- Created: 2020-11-30T16:27:31.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2025-08-22T11:13:37.000Z (4 months ago)
- Last Synced: 2025-09-02T06:32:54.591Z (3 months ago)
- Topics: compiler, eleventy, handlebars, mustache, nunjucks, ocaml, template-engine, template-language
- Language: OCaml
- Homepage: https://acutis.johnridesa.bike/
- Size: 10.7 MB
- Stars: 26
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-list - acutis
README

[Project home](https://sr.ht/~johnridesabike/acutis/) |
[Source code](https://git.sr.ht/~johnridesabike/acutis) |
[Mailing list](https://lists.sr.ht/~johnridesabike/public-inbox) |
[Documentation](https://acutis.johnridesa.bike/)
# 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.
```acutis
Blog posts for {% siteTitle %}
{%~ map blogPosts with {image, title, content, date, author: {name}} %}
{% match image with null ~%}
{* no image *}
{%~ with !{src, alt} ~%}
{% /match ~%}
{% title %}
Posted on {% date %}
{{% content %}}
{%~ /map %}
```
[See how this example compiles in the playground][example].
[example]:
https://acutis.johnridesa.bike/playground/?props=ewogICJzaXRlVGl0bGUiOiAiTXkgQmxvZyIsCiAgImJsb2dQb3N0cyI6IFsKICAgIHsKICAgICAgInRpdGxlIjogIk15IHNlY29uZCBwb3N0IiwKICAgICAgImF1dGhvciI6IHsgIm5hbWUiOiAiSm9obiIgfSwKICAgICAgImRhdGUiOiAiMjAyMC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QgJX19IDwvZGl2PgogIDwvYXJ0aWNsZT4KeyV%2BIC9tYXAgJX0%3D
## Usage in OCaml
The Acutis source is written in OCaml. You can install it with the OCaml package
manager, OPAM.
```shell
opam pin acutis git+https://git.sr.ht/~johnridesabike/acutis
```
## JavaScript & Eleventy plugin
You can use npm to install a JavaScript build of Acutis. This includes an
[Eleventy] plugin.
[eleventy]: https://www.11ty.dev/
Install the JavaScript package in your project:
```shell
npm install acutis-lang
```
[Read more about its usage in the documentation](https://acutis.johnridesa.bike/introduction/).
## Development
To get started developing this project, clone its source code repository with
Git. Then create a development OPAM switch:
```shell
opam switch create . --deps-only --with-test --with-doc
```
Use Dune to compile the code:
```shell
dune build
```
Or use Dune to compile the code and also run the tests:
```shell
dune build @ci
```
Send patches to <~johnridesabike/public-inbox@lists.sr.ht>.
## License
Acutis was created and is maintained by
[John Jackson](https://johnridesa.bike/).
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/.