Git Product home page Git Product logo

tenjin's Introduction

tenjin

docs.rs crates.io

Buzzwords

  • dynamic
  • zero-allocation in render
  • logic-less
  • enables structural sharing

Template Syntax

{ if path.to.item } ... { end }
{ for item in path.to.items } ... { end }
{ include template_name }
{ path.to.item }

To escape { and }, use {{ and }}, respectively.

Macro Syntax

A macro can be used so that you can pass your own structs in as data to your templates.

context! {
    self: (TYPE PARAMETERS) TYPE {
        key1 => self.value,
        key2 => @iter self.iterable,
        key3 => @raw self.html,
        key4 => @{
            key5 => self.another_value,
            ...
        },
        ...
    }
}

You might also want to see the macros example. Note that these "contexts" are composable.

Truthiness

  1. All undefined values are falsey.
  2. Objects, maps and arrays are truthy.
  3. Booleans evaluate to their own value.
  4. Integers are truthy iff they are non-zero.
  5. Strings are truthy iff they are non-empty.
  6. Try to make truthiness as unsurprising as possible.

Contributing

Features will be added as they are needed. If you think something is missing, please open an issue!

tenjin's People

Contributors

kodesafi avatar quadrupleslap 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.