All Projects → Mike96Angelo → Bars

Mike96Angelo / Bars

Licence: mit
Bars is a lightweight high performance HTML aware templating engine. Bars emits DOM rather than DOM-strings, this means the DOM state is preserved even if data updates happen.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Bars

Flexml
🚀基于Litho的Android高性能动态业务容器。
Stars: ✭ 225 (+4400%)
Mutual labels:  view, template-engine
gender-render
Template-system and proof-of-concept for rendering gender-neutral text-, email- and RPG-text-templates with the correct pronouns of all people involved.
Stars: ✭ 21 (+320%)
Mutual labels:  template-engine, template-language
Androidlibs
🔥正在成为史上最全分类 Android 开源大全~~~~(长期更新 Star 一下吧)
Stars: ✭ 7,148 (+142860%)
Mutual labels:  app, view
Egg View
Stars: ✭ 35 (+600%)
Mutual labels:  view, template-engine
Docpad
Empower your website frontends with layouts, meta-data, pre-processors (markdown, jade, coffeescript, etc.), partials, skeletons, file watching, querying, and an amazing plugin system. DocPad will streamline your web development process allowing you to craft powerful static sites quicker than ever before.
Stars: ✭ 3,035 (+60600%)
Mutual labels:  app, template-engine
Bem Xjst
bem-xjst (eXtensible JavaScript Templates): declarative template engine for the browser and server
Stars: ✭ 115 (+2200%)
Mutual labels:  view, template-engine
escapevelocity
A subset reimplementation of Apache Velocity with a much simpler API.
Stars: ✭ 28 (+460%)
Mutual labels:  template-engine, template-language
Awesome Twig
A curated list of amazingly awesome Twig extensions, snippets and tutorials
Stars: ✭ 63 (+1160%)
Mutual labels:  template-engine, template-language
bart
A compile time templating language for Rust inspired by Mustache
Stars: ✭ 29 (+480%)
Mutual labels:  template-engine, template-language
kirby-blade
Enable Laravel Blade Template Engine for Kirby 3
Stars: ✭ 20 (+300%)
Mutual labels:  template-engine, view
Pongo2
Django-syntax like template-engine for Go
Stars: ✭ 2,111 (+42120%)
Mutual labels:  template-engine, template-language
Twirl
Twirl is Play's default template engine
Stars: ✭ 498 (+9860%)
Mutual labels:  template-engine, template-language
Phptal
PHP Template Attribute Language — template engine for XSS-proof well-formed XHTML and HTML5 pages
Stars: ✭ 155 (+3000%)
Mutual labels:  template-engine, template-language
Diamond
Diamond is a full-stack web-framework written in The D Programming Language using vibe.d
Stars: ✭ 173 (+3360%)
Mutual labels:  view, template-engine
Tuxedo
Tuxedo is a template language for Swift.
Stars: ✭ 80 (+1500%)
Mutual labels:  template-engine, template-language
Android Ratingreviews
Simple star rating system bars, a view similar to the ones seen on Google Playstore. ⭐🌟✨
Stars: ✭ 110 (+2100%)
Mutual labels:  app, view
karkas
A tiny template engine based on TypeScript
Stars: ✭ 14 (+180%)
Mutual labels:  template-engine, template-language
Bladeone
The standalone version Blade Template Engine without Laravel in a single php file and without dependencies
Stars: ✭ 411 (+8120%)
Mutual labels:  view, template-engine
Blade
🔪 A standalone version of Laravel's Blade templating engine for use outside of Laravel.
Stars: ✭ 542 (+10740%)
Mutual labels:  view, template-engine
Snowboard
API blueprint toolkit
Stars: ✭ 723 (+14360%)
Mutual labels:  app

Bars

GitHub release npm version npm downloads npm downloads

Bars is a lightweight high performance HTML aware templating engine. Bars emits DOM rather than DOM-strings, this means the DOM state is preserved even if data updates happen. Bars can also emit DOM-strings for backend templating if desired. This way one can use Bars for both static content generation and dynamic web application views.

Make Bars Better

Bars is still in early development, please share any suggestions and report any bugs to the GitHub issues page, so we can continue to improve Bars. If you want to contribute to Bars, fork Bars on GitHub and send in a pull request. For ways to contribute check out the issues page on GitHub.

Install:

$ npm install bars

What Bars Looks Like

Bars Language and Docs.

index.bars:

<h2>To Do App</h2>
<input id="new-list" todos:{{todos}} placeholder="Add something to your list..." />
<ul>
{{#each todos as |todo index todos|}}
  <li class="{{todo.del ? 'del' : ''}}">
    <div>
      <span class="list-complete {{todo.complete ? 'done' : ''}}" todo:{{todo}}></span>
      <span class="list">{{todo.text}}</span>
      <span class="list-del" todo:{{todo}} todos:{{todos}}>x</span>
    </div>
  </li>
{{else}}
  <li>
    <span>You have nothing left to do.</span>
  </li>
{{/each}}
</ul>

app.js:

var App = require('bars/app');

var app = new App(
    // options
    {
        index: require('./index.bars'),
        // partials: {},
        // transforms: {}
    },

    // State
    {
        todos: [
            {
                text: 'Buy eggs'
            }
        ]
    }
);

app.view.on('click', '.list-complete', function (evt, target){
    var todo = target.data('todo');
    todo.complete = !todo.complete;
    app.render();
});

app.view.on('click', '.list-del', function (evt, target){
    var todo = target.data('todo');
    var todos = target.data('todos');

    todo.del = true;
    app.render();

    setTimeout(function () {
        todos.splice(todos.indexOf(todo), 1);

        app.render();
    }, 200);
});

app.view.on('change', '#new-list', function (evt, target){
    var todos = target.data('todos');

    var todo = {
        del: true,
        text: target.value
    };

    todos.unshift(todo);
    app.render();
    target.value = '';

    setTimeout(function () {
        delete todo.del;
        app.render();
    }, 0);
});

app.appendTo(document.body);
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].