haiji alternatives and similar packages
Based on the "Text" category.
Alternatively, view haiji alternatives based on common mentions on social networks and blogs.
-
pandoc-citeproc
Library and executable for using citeproc with pandoc -
scholdoc
Fork of Pandoc for the implementation of a ScholarlyMarkdown parser -
prettyprinter
A modern, extensible and well-documented prettyprinter. -
blaze-from-html
A blazingly fast HTML combinator library for Haskell. -
skylighting
A Haskell syntax highlighting library with tokenizers derived from KDE syntax highlighting descriptions -
commonmark
Pure Haskell commonmark parsing library, designed to be flexible and extensible -
regex-genex
Given a list of regexes, generate all possible strings that matches all of them. -
regex-applicative
Regex-based parsing with an applicative interface -
pandoc-csv2table
A Pandoc filter that renders CSV as Pandoc Markdown Tables. -
servant-checked-exceptions
type-level errors for Servant APIs. -
double-conversion
A fast Haskell library for converting between double precision floating point numbers and text strings. It is implemented as a binding to the V8-derived C++ double-conversion library. -
text-format
A Haskell text formatting library optimized for ease of use and high performance. -
diagrams-pandoc
A pandoc filter to express diagrams inline using the haskell EDSL diagrams. -
boxes
A pretty-printing library for laying out text in two dimensions, using a simple box model. -
hyphenation
Knuth-Liang Hyphenation for Haskell based on TeX hyphenation files -
ghc-syntax-highlighter
Syntax highlighter for Haskell using the lexer of GHC
ONLYOFFICE Docs — document collaboration in your environment
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of haiji or a related project?
README
haiji
A typed template engine, subset of jinja2
Haiji is a template engine which is subset of jinja2. This is designed to free from the unintended rendering result by strictly typed variable interpolation.
Typed Template
{{ foo }}
For example, this jinja2 template requires "foo". A dictionary which provides a variable "foo" is required to render it. If a variable "foo" does not exist in a given dictionary, jinja2 evaluates it to an empty string, whereas haiji treats this case as compile error.
Support Features
Variables
You can use a dot to access attributes of a variable.
{{ foo.bar }}
Filters
- abs
- length
{{ foo|length|abs }}
Control Structures
If
{% if foo %}foo{% elif bar %}bar{% else %}baz{% endif %}
For
{% for bar in foo %}
loop: {{ bar }}
{% endfor %}
Assignments
{% for y in ys %}
{% set prev_loop = loop %}
{% for x in xs %}
{{ prev_loop.index0 }} {{ loop.index0 }}
{% endfor %}
{% endfor %}
Don't support
- immediate value assignment
- multiple targets
- namespace objects
- block assignments
Include
{% include "parts.html" %}
Extends
Base template
<html>
<head>
{% block head %}
<title>{{ foo }}{% block title %}{% endblock %}</title>
{% endblock %}
</head>
<body>
{{ bar }}
{% block missing %}child missing this block{% endblock %}
</body>
</html>
Child template
{% extends "parent.tmpl" %}
{% block title %}{{ super() }}{{ baz }}{{ super() }}{% endblock %}
{% block head %}
{{ super() }}
<style type="text/css"></style>
{% endblock %}
Escaping
Raw block
{% raw %}
<ul>
{% for item in seq %}
<li>{{ item }}</li>
{% endfor %}
</ul>
{% endraw %}
Comments
{# a comment #}
Expressions
Literals
Integer Literals
{{ 123 }}
Boolean Literals
{{ true }}
{{ false }}
Arithmetics
{{ foo + bar}}
{{ foo - bar}}
{{ foo * bar}}
{{ foo // bar}}
{{ foo % bar}}
{{ foo ** bar}}
Comparisons
{{ foo == bar }}
{{ foo != bar }}
{{ foo > bar }}
{{ foo >= bar }}
{{ foo < bar }}
{{ foo <= bar }}
Logic
{{ foo and bar }}
{{ foo or bar }}
Functions
- range
{% for i in range(n) %}{{ i }}{% endfor %}
Testing
The tests can be run with stack
:
$ stack test
In order to run the tests, you need a python2
binary on your PATH
, and the
jinja2
python library installed.