Skip to content

Rendering yakshave.edn maps to leiningen templates #1

@johnwalker

Description

@johnwalker

The data contained in yakshave maps is clearly less than what could appear in a leiningen template, but there is enough to render full leiningen templates. This would make it easy to maintain compatibility between leiningen and yakshave templates, and also to test that the yakshave templates work as expected (since we could generate safe leiningen templates, run them, and compare output).

One way that we can do this is to take the mustache files used in "lein new template" and modify them to have placeholders for values like variable names and their corresponding forms. So we'll use templates to build renderable templates! :)

The "lein new template" mustache files in question are available here:

https://github.com/technomancy/leiningen/tree/master/resources/leiningen/new/template

A smaller but important piece of the puzzle is writing a function that converts [:identity :sanitize-ns] to a form like (-> project :identity :sanitize-ns) or (sanitize-ns (identity project)). This would be useful for the submap associated to :data in most yakshave.edn files.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions