Giter Club home page Giter Club logo

handlebars-hx's Introduction

Handlebars-hx

Haxe implementation of the Handlebars templating engine.

IN PROGRESS, NOT FEATURE COMPLETE

HXML Files

  • basic.hxml builds a small neko app that takes a test name as a parameter and runs the output of that test.
  • test.hxml builds the neko files required for testing the library.

Tests

As of the creation of this project, I did not find a good test suite that could be used that is javascript agnostic. So I decided to make my own based on the examples and explainations at the Handlebars Guide. In the future the tests from the spec/ from the github repository should be ported over in order to use the same test suite as the original engine.

Running Tests

Tests are stored in the tests directory and are run using test-engine in the project (this project) root. Be sure to run haxe test.hxml before running the tests otherwise you could be using an older compiled build for the test.

There are multiple ways to use test-engine based on what you want.

  • haxelib run test-engine will run all the tests and show only the error outputs of each failed test
  • haxelib run test-engine -l will show all tests ran and failed, but no output errors
  • haxelib run test-engine --test "*blob*" will run tests that match the provided title.

Creating a Test

Each test should be chosen to test a specific thing, and the name and folder the test is placed should accurately describe that thing. Before adding the test make sure the files adhere to the results from the online handlebars engine (an eample here, put in your template and object and ensure the output matches the output for the testfile).

Each test is made of at least 2 and up to 3 files:

  • [name].hbs : the handlebars template file
  • [name].json : the data object used by the template to generate the output
  • [name].html : the rendered output

The output is optional. If there is no output file then test-engine will assume that this should be a failing test, and the test will pass if it gets an error.

handlebars-hx's People

Contributors

snsvrno avatar

Stargazers

Datee avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.