Skip to content

Plates (fork?) with some DSL #111

@Vinze

Description

@Vinze

I really don't know if this is the right place for my question, but I can't think of a better place.

The past couple of days I've been doing some research and testing with different Javascript templating engines. So far Plates looks like the best choice for me, it's really great! However, there is one thing I would like to see different. For example:

// Some dummy data
var messages = [
    {"username": "John", "message": "Lorem ipsum #1"},
    {"username": "Kate", "message": "Lorem ipsum #2"}
];

// Plates:
var template = '<p><span class="username"></span>: <span class="message"></span></p>';

// Plates with some DSL
var template = '<p>{{username}}: {{message}}</p>';

// Create the output
var output = Plates.bind(template, messages);
$('#messages').append(output);

As you can see, I'd like to use some domain specific language with Plates, because it makes the code just a bit more compact and I don't have to add additional tags. I understand this is against the motivation of Plates, so please don't think I'd like to see this implemented in the main project. I tried fork the project and update the code to work with {{Mustache}} tags, but I don't have a clue where to start.

If it's not to much work or time consuming, could someone of the dev team create a alternative version of Plates? Or at least give me some advice how I could implement it myself?

Oh and one more thing: I've also looked into other templating engines which use DSL out of the box, but I really don't like the way they handle looping over collections.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions