eta_plugin_mixins
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-0 • Public • Published

eta_plugin_mixins

GitHub package.json version (master) deno module Travis All Contributors Coveralls

Adds mixin support to the Eta template engine

🌟 Examples

A simple example

<% /* Define the mixin */ %>
 
<% let body = {%>
This is the template body
<% @} %>
 
<% /* Use the mixin */ %>
<%~ body() %>

Passing data to a mixin

<% let greeting = {%>
Hi <%= it.name %>
<% @} %>
 
<%= greeting({name: "Your Name"}) %>

📜 Usage

import mixins from 'eta_plugin_mixins'
// Or, with Deno
import mixins from 'https://deno.land/x/eta_plugin_mixins/mod.ts'
 
eta.configure({
  plugins: [mixins()]
})

✔️ Tests

Tests can be run with npm test. Multiple tests check that parsing, rendering, and compiling return expected results, formatting follows guidelines, and code coverage is at the expected level.

Resources

To be added

Projects using eta_plugin_mixins

Contributors

Made with ❤ by @nebrelbug and all these wonderful contributors (emoji key):


Ben Gubler

💻 💬 📖 ⚠️

This project follows the all-contributors specification. Contributions of any kind are welcome!

Credits

Package Sidebar

Install

npm i eta_plugin_mixins

Homepage

eta.js.org/

Weekly Downloads

4

Version

1.0.0-0

License

MIT

Unpacked Size

12.3 kB

Total Files

14

Last publish

Collaborators

  • nebrelbug