GithubHelp home page GithubHelp logo

isabella232 / dust-makara-helpers Goto Github PK

View Code? Open in Web Editor NEW

This project forked from krakenjs/dust-makara-helpers

0.0 0.0 0.0 44 KB

Server-side configuration of helpers for makara

Home Page: http://krakenjs.com/makara

JavaScript 100.00%

dust-makara-helpers's Introduction

dust-makara-helpers

Makes it easy to set up the complementary dust @useContent and @message helpers, with configuration that loads data from kraken-js-style .properties bundles.

The content lookups are stored in the dust cache if it is enabled.

This module requires the full build of dust, with the compiler, since the @message helper compiles strings with dust.

@useContent and @message can be used in the browser, but will need to be configured with other ways to load content, such as using requirejs.

Use

var dust = require('dustjs-linkedin');
require('dust-makara-helpers').registerWith(dust, {
    enableMetadata: true,
    autoloadTemplateContent: false,
    localeFromContext: function (ctx) {
      var locale;
      //anything special you want to do
      return locale;
    }
});

Options

  • enableMetadata: defaults to false. Turns on support for <edit> metadata tags in dust-message-helper to support in-place content editing.
  • autoloadTemplateContent: defaults to true. Allows you to disable automatic loading of content per template, allowing you to have a completely disjoint mapping between templates and content bundles, rather than a 1:1 mapping of template name to content bundle filename.
  • localeFromContext: Function. takes context as a parameter. Return a bcp47-style object or a locale string like en-US. Please see localeFromContext in this module's index.js file to see what you would be overriding.

dust-makara-helpers's People

Contributors

aredridel avatar grawk 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.