Source

soycompiler /

Filename Size Date modified Message
examples
lib
soy
99 B
9.5 KB
1.3 KB
638 B

Soy Compiler

Soy compiler is simple little npm package that can be included to compile soy templates in a source directory to a target directory. This is useful to compile soy templates for inclusion on the client-side (to allow for client-side templates).

https://bitbucket.org/knecht_andreas/soycompiler

Installation

Simply run npm install soycompiler.

Usage

var soycompiler = require("../lib/soycompiler.js");

soycompiler.compileTemplates({
    "sourceDir":__dirname + "/source",
    "targetDir":__dirname + "/target",
    "autorecompile":true
}, function (err) {
    if (err) {
        throw new err;
    }
});

See examples/example.js. The autorecompile flag is optional and may only be necessary in development. Setting this flag to true will automatically recompile all soy templates on any file change. (Currently changing any template will recompile all templates)

License

Copyright 2012 Andreas Knecht.

Licensed under the Apache License, Version 2.0. See the top-level file LICENSE.txt and http://www.apache.org/licenses/LICENSE-2.0.

Thanks

Ideas and some code constructs were inspired by the excellent https://github.com/Obvious/soynode.

Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.