Commits

Jonathon Creenaune [Atlassian]  committed 72f2a79

SOY-40 doco

  • Participants
  • Parent commits 1626242

Comments (0)

Files changed (1)

 
 * Issues - http://ecosystem.atlassian.net/browse/SOY
 * CI - https://extranet-bamboo.internal.atlassian.com/browse/SOY
+
+## CLI
+
+This projects delivers a CLI for processing soy using the bundled Atlassian soy functions. It can be used to render soy,
+or to compile to js.
+
+The CLI requires JDK 1.7 (the rest of the project requires JDK 1.6+ only).
+
+The CLI accepts the following options:
+
+    java -jar atlassian-soy-support.jar
+        --type [render|js]
+        --basedir basedir
+        --glob glob
+        --outdir outdir
+        [--i18n i18nFile]
+        [--outputExtension outputExtension]
+        [--rootNamespace rootNamespace]
+        [--dependencies dependencies]
+        [--data data]
+
+### Options
+
+- `type` must be "render" to render the template or "js" to compile the template to js.
+- `basedir` and glob are the directory and glob pattern containing the files to render or compile.
+  - For the renderer, this will render one template per file, which is the path of the file relative to `basedir`.
+For example, a file in `basedir/a/b.soy` will attempt to render the template `a.b` in the file `a/b.soy`.
+  - For the compiler, this compiles all of the matches templates to javascript.
+- `outdir` is the directory to output rendered / compiled files to. The files will be delivered matching the location of the
+location of files under `basedir`.
+- `i18nFile` is the location of a file containing i18n values represented by the `AJS.getText()` function. This is required
+if the templates contain the `AJS.getText()` function.
+- `outputExtension` (type=render only) is the extension given to the rendered files.
+- `rootNamespace` (type=render only) is the root namespace of the templates to render.
+- `dependencies` (type=render only) is a collection of locations of dependencies for the rendered files. This param
+is in the format `dir1:glob1,dir2:glob2,...` where `dir` is the base dir of a dependency and `glob` is a glob matching files to find.
+- `data` (type=render only) is a map of data to pass to the soy renderer, in the form `key1:value1,key2:value2,...`.