Skip to content

Use Javascript as templating language #1

Open
@lucasdinonolte

Description

@lucasdinonolte

lazy currently uses handlebars as its templating language, as it was easy enough to get started with. However, in the effort to streamline things and remove external dependencies JavaScript – more specifically template string literals – should be used, making it easier for everybody to just create lazy snippets, without needing to learn how string manipulation works in handlebars.

More so, the configuration files .lazy-config.json should also be moved to javascript, again to make it simpler to represent conditionals and configuration (maybe even allow for templates to be inlined).

Ideally a template is "just" a function that receives options and outputs a string:

const myTemplate = (opts) => `export const ${opts.name.toUpperCase()} = ${opts.value};`;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions