All Projects → STRd6 → Jadelet

STRd6 / Jadelet

Licence: mit
Pure and simple clientside templates

Programming Languages

javascript
184084 projects - #8 most used programming language
coffeescript
4710 projects

Projects that are alternatives of or similar to Jadelet

Vim Template
Simple templates plugin for Vim
Stars: ✭ 328 (-12.53%)
Mutual labels:  template
Vue Typescript Admin Template
🖖 A vue-cli 3.0 + typescript minimal admin template
Stars: ✭ 4,279 (+1041.07%)
Mutual labels:  template
Fresh
Landing page starter
Stars: ✭ 368 (-1.87%)
Mutual labels:  template
Simple Resume Cv
Template for a simple resume or curriculum vitae (CV), in XeLaTeX.
Stars: ✭ 333 (-11.2%)
Mutual labels:  template
Koa Vue Notes Api
🤓 This is a simple SPA built using Koa as the backend, Vue as the first frontend, and React as the second frontend. Features MySQL integration, user authentication, CRUD note actions, and async/await.
Stars: ✭ 342 (-8.8%)
Mutual labels:  template
Laravel Enterprise Starter Kit
👔 Enterprise Web application starter kit or template using Laravel
Stars: ✭ 356 (-5.07%)
Mutual labels:  template
Mikado
Mikado is the webs fastest template library for building user interfaces.
Stars: ✭ 323 (-13.87%)
Mutual labels:  template
Openshop.io Ios
OpenShop.io
Stars: ✭ 374 (-0.27%)
Mutual labels:  template
Rendu
A simple realtime graphics playground for experimentations.
Stars: ✭ 343 (-8.53%)
Mutual labels:  template
Ant Design Landing
🚵 Landing Pages of Ant Design System
Stars: ✭ 4,425 (+1080%)
Mutual labels:  template
Tensorflow Project Template
A best practice for tensorflow project template architecture.
Stars: ✭ 3,466 (+824.27%)
Mutual labels:  template
Pug
Pug template engine for PHP
Stars: ✭ 341 (-9.07%)
Mutual labels:  template
Shards Dashboard Vue
A free Vue admin dashboard template pack featuring a modern design system and lots of custom templates and components.
Stars: ✭ 363 (-3.2%)
Mutual labels:  template
Swift5 Module Template
An opinionated starting point for awesome, reusable Swift 5 modules
Stars: ✭ 331 (-11.73%)
Mutual labels:  template
Simplefpstemplate
Simple C++ FPS Template for Unreal Engine 4
Stars: ✭ 372 (-0.8%)
Mutual labels:  template
Devportfolio
A lightweight, customizable single-page personal portfolio website template built with JavaScript and Sass
Stars: ✭ 3,582 (+855.2%)
Mutual labels:  template
Flutter template
The project of the empty template with Flutter has built the basic framework to realize the functions of internationalization, theme peeling, login and registration, etc.(Flutter空壳模板工程,已搭建基础框架,实现国际化、主题换肤、登录注册、自动路由注册等功能,可在此基础上简单修改实现自己的应用功能)
Stars: ✭ 342 (-8.8%)
Mutual labels:  template
Suspenders
A Rails template with our standard defaults, ready to deploy to Heroku.
Stars: ✭ 3,748 (+899.47%)
Mutual labels:  template
Rails Template
A best & newest & fastest rails 6.x template for senior rails developer.
Stars: ✭ 372 (-0.8%)
Mutual labels:  template
Reactnativets
Boilerplate of a React Native project in Typescript.
Stars: ✭ 364 (-2.93%)
Mutual labels:  template

Build Status

Jadelet

Pure and simple clientside templates

Jadelet is the cleanest and simplest way to describe your templates. It is a breeze to learn. Jadelet attributes correspond directly with HTML attributes. If you know HTML then you already know Jadelet.

Other libraries and frameworks put up barriers between you and the DOM. Like a dutiful servant, Jadelet brings the power of the DOM into your hands.

Jadelet is the smallest of all clientside templating libraries (< 2.5kb). But don't let its size fool you: it contains tremendous power.

Jadelet is free, MIT licensed, open source, non-GMO, and production ready.

Jadelet Hello

Examples

Header

h1= @title
HeaderTemplate = require "./header"
headerElement = HeaderTemplate
  title: "Hello world"

Button

button([email protected])
ButtonTemplate = require "./button"
buttonElement = ButtonTemplate
  sayHey: ->
    alert "heyy"

See more in the Example Playground

Getting Started

Install Jadelet:

npm install jadelet

Compile your templates:

node_modules/.bin/jadelet -d templates

This will create a .js version of each template in your templates directory.

To use the templates in a Node.js style project built with browserify you can require them normally.

// main.js
mainTemplate = require("./templates/main");

document.body.appendChild(mainTemplate(data));

Now use browserify to build the file you'll serve on your page.

browserify main.js > build.js

Road to 1.0

  • [x] Still under 2.5kb
  • [x] Don't Leak Resources
  • [x] Style Attributes
  • [x] Filters
  • [x] Changelog
  • [x] Example Playground
  • [x] | for text content
  • [x] Remove :filters
  • [x] Updated README.md
  • [ ] jadelet.com
  • [ ] Documentation
  • [ ] Getting Started Guide

FAQ

Ewww... CoffeeScript

That's not a question.

Is Jadelet safe from XSS?

Yes. Jadelet uses native DOM APIs to write string output as text nodes.

How do I use Jadelet to render HTML Elements?

Jadelet knows the type of objects it renders. When you pass an HTMLElement it will insert it into the DOM.

.content
  h1 My Canvas
  = @canvas
Template
  canvas: document.createElement('canvas')

Is it production ready?

Yes, we're currently using Jadelet to power glitch.com. (Though we still have a 'Beta' sticker up... ¯\_(ツ)_/¯)

Is it performant?

Yes! And because it's just DOM stuff you can easily drop down to the native DOM APIs for the pieces of your app that need special optimization.

How can I contribute?

Open some issues, open some pull requests, let's talk it out :)

History

Jadelet was inspired by Haml and Jade.

Gotchas

Templates must have only one root element, they will fail with multiple.

Good:

.root
  .one
  .two

Oopsies:

.one
.two

CLI

Command line interface for compiling templates.

Usage

Jadelet in, JavaScript out.

jadelet < template.jadelet > output.js

echo "h1#title= @title" | jadelet

Options

-d, --directory [directory] Compile all .jadelet files in the given directory.

jadelet -d templates

--encoding [encoding] Encoding of files being read from --directory (default 'utf-8')

--exports, -e [name] Export compiled template as (default 'module.exports')

--extension [ext] Extension to compile when compiling files from a directory. Default is jade(let)? so it should pick up both .jade and .jadelet files.

--runtime, -r [runtime_name] Specifies the name of the globally available Jadelet runtime (default is 'require("jadelet")').

jadelet -r "Jadelet" < template.jadelet > output.js

--ast, -a Output a JSON AST instead of the JavaScript template function. Useful for debugging or for using the Jadelet DSL as a frontend for other renderer backends like Mithril or React. Until 1.0 this isn't guaranteed to be a stable format.

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].