All Projects β†’ jbboehr β†’ handlebars.c

jbboehr / handlebars.c

Licence: LGPL-2.1 and 2 other licenses found Licenses found LGPL-2.1 LICENSE.md AGPL-3.0 LICENSE-AGPL.md GPL-2.0 LICENSE-GPL.md
C implementation of handlebars.js

Programming Languages

c
50402 projects - #5 most used programming language
shell
77523 projects
Yacc
648 projects
M4
1887 projects
Lex
420 projects
Nix
1067 projects

Projects that are alternatives of or similar to handlebars.c

php-handlebars
PHP bindings for handlebars.c
Stars: ✭ 23 (-25.81%)
Mutual labels:  handlebars, handlebars-js
Happy
Happy πŸ₯³ | Rocketseat πŸ’œ - NLW 03 πŸ‘©β€πŸš€
Stars: ✭ 61 (+96.77%)
Mutual labels:  handlebars, handlebars-js
Publii
Publii is a desktop-based CMS for Windows, Mac and Linux that makes creating static websites fast and hassle-free, even for beginners.
Stars: ✭ 3,644 (+11654.84%)
Mutual labels:  handlebars, handlebars-js
Newman Reporter Htmlextra
A HTML reporter for Postman's Command Line Runner, Newman. Includes Non Aggregated Runs broken down by Iterations, Skipped Tests, Console Logs and the handlebars helpers module for better custom templates.
Stars: ✭ 183 (+490.32%)
Mutual labels:  handlebars
Yarte
Yarte stands for Yet Another Rust Template Engine
Stars: ✭ 189 (+509.68%)
Mutual labels:  handlebars
filisantillan.com
My official site
Stars: ✭ 16 (-48.39%)
Mutual labels:  handlebars
velvet
A sweet velvety templating package
Stars: ✭ 72 (+132.26%)
Mutual labels:  handlebars
Baumeister
πŸ‘· The aim of this project is to help you to build your things. From Bootstrap themes over static websites to single page applications.
Stars: ✭ 171 (+451.61%)
Mutual labels:  handlebars
extensions
Code Generators and Extensions for vanilla-rtb stack
Stars: ✭ 16 (-48.39%)
Mutual labels:  handlebars
Cedar
JavaScript Charts for ArcGIS
Stars: ✭ 230 (+641.94%)
Mutual labels:  handlebars
Www.rust Lang.org
The home of the Rust website
Stars: ✭ 228 (+635.48%)
Mutual labels:  handlebars
Fizzy Theme
πŸ₯€A tasty blogging theme for Ghost.
Stars: ✭ 194 (+525.81%)
Mutual labels:  handlebars
grafana-dynamictext-panel
A dynamic, data-driven text for @grafana.
Stars: ✭ 42 (+35.48%)
Mutual labels:  handlebars
Gulp Site Generator
A static site generator using Gulp
Stars: ✭ 183 (+490.32%)
Mutual labels:  handlebars
startover
Startover is a boilerplate for developing static websites. With Startover you don't have to start over!
Stars: ✭ 15 (-51.61%)
Mutual labels:  handlebars
Ramhorns
Fast Mustache template engine implementation in pure Rust.
Stars: ✭ 172 (+454.84%)
Mutual labels:  handlebars
nlw-03-discovery
Projeto construΓ­do durante o Next Level Week #03
Stars: ✭ 124 (+300%)
Mutual labels:  handlebars
Ssl Config Generator
Mozilla SSL Configuration Generator
Stars: ✭ 217 (+600%)
Mutual labels:  handlebars
Django Static Precompiler
Django Static Precompiler provides template tags and filters to compile CoffeeScript, LiveScript, SASS / SCSS, LESS, Stylus, Babel and Handlebars. It works with both inline code and external files.
Stars: ✭ 206 (+564.52%)
Mutual labels:  handlebars
Vscode Codicons
The icon font for Visual Studio Code
Stars: ✭ 242 (+680.65%)
Mutual labels:  handlebars

handlebars.c

GitHub Build Status Coverage Status License

C implementation of handlebars.js, developed in conjunction with php-handlebars and handlebars.php.

The opcode compiler is fully featured, however the VM currently does not implement decorators, and therefore inline partials.

Installation

Nix / NixOS

nix-env -i -f https://github.com/jbboehr/handlebars.c/archive/v1.0.0.tar.gz

or, in a .nix file:

(import <nixpkgs> {}).callPackage (import (fetchTarball {
  url = https://github.com/jbboehr/handlebars.c/archive/v1.0.0.tar.gz;
  sha256 = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx";
})) {}

or, to run as a flake:

nix run github:jbboehr/handlebars.c

Alpine Linux

apk add handlebars handlebars-dev handlebars-utils

Debian / Ubuntu

# Install dependencies
sudo apt-get install autoconf automake bison flex gcc libjson-c-dev liblmdb-dev \
                     libtalloc-dev libyaml-dev libtool m4 make pkg-config

# Install testing dependencies
sudo apt-get install check gdb lcov libpcre3-dev bats

# Compile
git clone https://github.com/jbboehr/handlebars.c.git --recursive
cd handlebars.c
./configure --disable-Werror --disable-testing-exports
make all check
sudo make install
sudo ldconfig

OSX via Homebrew

# Install dependencies
brew install autoconf automake bison flex gcc json-c libtool libyaml lmdb pkg-config talloc

# Install testing dependencies
brew install check lcov pcre bats

# Compile
git clone https://github.com/jbboehr/handlebars.c.git --recursive
cd handlebars.c
./configure --disable-Werror --disable-testing-exports
make all check
make install

CLI via Docker

# via Docker Hub
docker pull jbboehr/handlebars.c:latest

# via GitHub Packages
docker pull docker.pkg.github.com/jbboehr/handlebars.c/handlebarsc:latest

Usage

Usage: handlebarsc [OPTIONS]
Example: handlebarsc -t foo.hbs -D bar.json

Mode options:
  -h, --help            Show this message
  -V, --version         Print the version
  --execute             Execute the specified template (default)
  --lex                 Lex the specified template into tokens
  --parse               Parse the specified template into an AST
  --compile             Compile the specified template into opcodes

Input options:
  -t, --template=FILE   The template to operate on
  -D, --data=FILE       The input data file. Supports JSON and YAML.

Behavior options:
  -n, --no-newline      Do not print a newline after execution
  --flags=FLAGS         The flags to pass to the compiler separated by commas. One or more of:
                        compat, known_helpers_only, string_params, track_ids, no_escape,
                        ignore_standalone, alternate_decorators, strict, assume_objects,
                        mustache_style_lambdas
  --no-convert-input    Do not convert data to native types (use JSON wrapper)
  --partial-loader      Specify to enable loading partials dynamically
  --partial-path=DIR    The directory in which to look for partials
  --partial-ext=EXT     The file extension of partials, including the '.'
  --pool-size=SIZE      The size of the memory pool to use, 0 to disable (default 2 MB)
  --run-count=NUM       The number of times to execute (for benchmarking)

The partial loader will concat the partial-path, given partial name in the template,
and the partial-extension to resolve the file from which to load the partial.

If a FILE is specified as '-', it will be read from STDIN.

via Docker

# via Docker Hub
DOCKER_IMAGE=jbboehr/handlebars.c:latest

# via GitHub Packages
DOCKER_IMAGE=docker.pkg.github.com/jbboehr/handlebars.c/handlebarsc:latest

docker pull ${DOCKER_IMAGE}

# relying on the workdir is probably not stable

docker run \
    --rm \
    -v "$PWD:/srv" \
    ${DOCKER_IMAGE} \
    --data bench/templates/variables.json \
    --template bench/templates/variables.handlebars

cat bench/templates/variables.json | docker run \
    --rm -i
    -v "$PWD:/srv"
    ${DOCKER_IMAGE} \
    --data - \
    --template bench/templates/variables.handlebars

License

The library for this project is licensed under the LGPLv2.1 or later. The executable and the test suite are licensed under the AGPLv3.0 or later. handlebars.js is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].