All Projects → jonschlinkert → dry

jonschlinkert / dry

Licence: MIT license
Dry is a new template engine and language, and is a superset of Shopify's Liquid, with first-class support for advanced inheritance features, and more. From the creators of Enquirer, Assemble, Remarkable, and Micromatch.

Programming Languages

javascript
184084 projects - #8 most used programming language
HTML
75241 projects

Projects that are alternatives of or similar to dry

liquidpy
A port of liquid template engine for python
Stars: ✭ 49 (-25.76%)
Mutual labels:  template-engine, liquid, shopify, liquid-templating-engine
Mikado
Mikado is the webs fastest template library for building user interfaces.
Stars: ✭ 323 (+389.39%)
Mutual labels:  template-engine, templates, templating, rendering-engine
liquid
A Python engine for the Liquid template language.
Stars: ✭ 40 (-39.39%)
Mutual labels:  template-engine, templates, liquid, liquid-templating-engine
gulp-shopify-theme
Shopify theme synchronisation during development
Stars: ✭ 26 (-60.61%)
Mutual labels:  liquid, shopify, liquid-templating-engine
mechanic-tasks
Public task repository for Mechanic (https://mechanic.dev)
Stars: ✭ 42 (-36.36%)
Mutual labels:  liquid, shopify, liquid-templating-engine
Jmmasw
Just make me a static website
Stars: ✭ 13 (-80.3%)
Mutual labels:  templates, templating, static-site
Preview Email
Automatically opens your browser to preview Node.js email messages sent with Nodemailer. Made for Lad!
Stars: ✭ 112 (+69.7%)
Mutual labels:  engine, templates, render
bootstrap-shopify-theme
🛍 A free Shopify Theme built with Bootstrap, BEM, Liquid, Sass, ESNext, Theme Tools, ... and Webpack.
Stars: ✭ 41 (-37.88%)
Mutual labels:  liquid, shopify
Pupa
Simple micro templating
Stars: ✭ 231 (+250%)
Mutual labels:  template-engine, templating
Jade
Jade.go - pug template engine for Go (golang)
Stars: ✭ 251 (+280.3%)
Mutual labels:  template-engine, templates
statiq-starter-kontent-lumen
Lumen is a minimal, lightweight, and mobile-first starter for creating blogs using Statiq and Kontent by Kentico.
Stars: ✭ 22 (-66.67%)
Mutual labels:  headless, static-site
Pongo2
Django-syntax like template-engine for Go
Stars: ✭ 2,111 (+3098.48%)
Mutual labels:  template-engine, templates
Phptal
PHP Template Attribute Language — template engine for XSS-proof well-formed XHTML and HTML5 pages
Stars: ✭ 155 (+134.85%)
Mutual labels:  template-engine, templating
Jxls
Java library for creating Excel reports using Excel templates
Stars: ✭ 128 (+93.94%)
Mutual labels:  template-engine, templating
Tempy
Python Object Oriented Html Templating System
Stars: ✭ 126 (+90.91%)
Mutual labels:  template-engine, templating
htmldoom
An intuitive, high performance HTML rendering framework
Stars: ✭ 36 (-45.45%)
Mutual labels:  template-engine, rendering-engine
express-edge
🔤  Use Edge templating engine with Express
Stars: ✭ 45 (-31.82%)
Mutual labels:  template-engine, templating
pixie
Tiny template functions.
Stars: ✭ 14 (-78.79%)
Mutual labels:  engine, templating
hypertag
HTML templates with Python-like concise syntax, code reuse & modularity. The Pythonic way to web templating.
Stars: ✭ 27 (-59.09%)
Mutual labels:  templates, templating
vscode-liquid
💧Liquid language support for VS Code
Stars: ✭ 137 (+107.58%)
Mutual labels:  liquid, shopify

dry NPM version NPM monthly downloads NPM total downloads

Dry is superset of the Liquid templating language, with first-class support for advanced inheritance features, and more.

Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your ❤️ and support.

Install

Install with npm (requires Node.js >=14):

$ npm install --save dry

Getting started

The simplest way to get started is with the render method, which takes a template string and a data object (the "context").

const { render } = require('dry'); // render is async
console.log(await render('Hello, {{ name }}!', { name: 'Brian' })); //=> Hello, Brian!

Using the code above, you can do almost everything you need to do with Dry.

Tags, Filters, Variables, and more!

See the docs for Shopify's Liquid to learn about all of the features in the Liquid templating language. If you can do it with Liquid, you should be able to do it with Dry. (and if you can't do it with Dry, it's a bug, and we kindly ask that you please create an issue, thanks!)


Full Documentation

Docs are on the way. In the meantime, you can use this Liquid docs to learn about all language features, and use the code snippet above to render your templates!


2.0 Notes

🎉 This release took a while. Here are some highlights!

First things first

I'm back! I know I haven't been around a lot lately, but all of that is about to change! Thank you to @doowb all of my sponsors and friends on GitHub who have provided the encouragement and support I needed to begin making this comeback.

Please consider following me and this repository to receive updates, and consider contributing to Dry so we can make this the most powerful templating library in Node.js!

Why Dry? Aren't React and Vue the future?

Yes, yes they are. Dry doesn't compete with them. We use Dry the same way Shopify and Jekyll use Liquid, many end-users don't know how to write JavaScript, and many developers would prefer not to write JavaScript - I love writing JavaScript, and I enjoy Vue and React, but there is something satisfying about deploying a site in 5 minutes using plain text html templates. We also use Dry to design and render email templates, configuration-based system messages, and so on.

What's different about Dry?

Dry is A Superset of Shopify's Liquid with first-class support for template inheritance (ahem... so you don't have to repeat yourself. So it's "dry". I know... it's all I have at the moment).

Highlights of this PR

  • Ported directly from Shopify/liquid - Wherever possible, and practical, I attempted to retain the same structure and code decisions as Shopify's Liquid. Since Ruby has a number of language features that aren't available in JavaScript, I had to find arounds or do things differently in a few places.
  • Powerful template inheritance: layouts, extends, blocks, macros, embed, imports, and even complex reassignments like {% from 'fields' import input as input_field, textarea %}
  • More than 750 unit tests so far
  • Filters: >70 filters, including all Liquid filters and more
  • Tags: >30 Tags, including all Liquid tags and a several new ones! See the list below!
  • More powerful comparisons and conditionals (more about this soon!)

Lots more!


Tags

The tags with leading + were added to Dry:

(We'll be adding more tags soon! Like section and other tags used by Shopify)

+Apply
Assign
+Block
Break
Capture
Case
Comment
+Content
Continue
Cycle
Decrement
Echo
+Embed
+Extends
For
+From
If
Ifchanged
+Import
Include
Increment
+Layout
Liquid
+Macro
+Paginate
Raw
Render
+Set
+Switch
TableRow
Unless
+Verbatim
+With

About

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue.

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Running Tests

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test
Building docs

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Author

Jon Schlinkert

License

Copyright © 2021, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.8.0, on July 20, 2021.

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