"description":"List of French words that are \"aspiré\" (vs. \"muet\")\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[D\u001b[Dstarting with a h that is \"aspiré\" vs \"muet\"",
Helps to compile rosaeNLG templates in js files for client side in browser rendering.
It can be used independantly of gulp. For an example of integration with gulp see `rosaenlg-browser-poc` technical demo project.
For documentation, see [RosaeNLG main doc](https://rosaenlg.org).
## Installation
```sh
npm install gulp-freenlpg
```
## Usage
`compileTemplates` will compile and package one or multiple RosaeNLG templates for browser side rendering in a stream and returns that stream:
*`sourcesAndNames` (array, mandatory): each entry must have 2 properties, `source` for the filename of the template and `name` for the name of the generated function
*`language` (string, mandatory): any supported rosaeNLG language (all templates must have the same language)
*`dest` (string, mandatory): the destination js filename
*`holderName` (string, mandatory): the name of the package that will hold all the functions
*`tinyify` (boolean, optional): put true if you want to tinyify the output
`renderTemplateInFile` renders a RosaeNLG template into a file:
*`template` (string, mandatory): the filename of the template to render
*`dest` (string, mandatory): the filename that will contain the output
*`options` (mandatory): the parameters that will be given to `renderFile`; typically put `language` and most often some data.
`packageTemplateJson` packages (and optionnaly compiles) templates into a single object, generally for JSON serialization. One single `PackagedTemplateParams` param:
*`templateId`: string; will be just kept as is (not used during the packaging process)
*`entryTemplate`: string; the main template; do not put the full path
*`folderWithTemplates`: string; the folder containing all the templates (including the `entryTemplate`)
*`compileInfo`: mandatory as at some point compilation will occur
*`activate`: boolean; if set, the template will be compiled, and included in the output
*`compileDebug`: boolean; activate Pug debug
*`language`: language
*`autotest`: all fields will just be copied as is in the output (not used during packaging)
*`activate`: boolean
*`input`: object that is a valid input to render the template
*`expected`: string[]; strings that should be in the rendered template
$ cat fruits.pug | docker run -i registry.gitlab.com/rosaenlg-projects/docker-rosaenlg -l en_US
cat fruits.pug | docker run -i registry.gitlab.com/rosaenlg-projects/docker-rosaenlg -l en_US
....
You should obtain `<p>I love apples, bananas, apricots and pears!</p>`.
For more advanced usages, read link:https://gitlab.com/rosaenlg-projects/docker-rosaenlg/blob/master/README.md[Docker RosaeNLG documentation]:
For more advanced usages, read xref:docker-cli:docker-cli.adoc[Docker image for CLI]:
* render files that contain `include` (which is very common)
* watch for templates files changes and render them continuously
== Other integrations: Java, API, etc.
If you want to use RosaeNLG in a Java application, or call RosaeNLG through an API, or just use Docker, see xref:integration:integration.adoc[the complete integration guide].
It is a multi package repo (lerna) which is a fork of Pug @2.0.3 (forked the 06/04/2018). 03/06/2019, @2.0.3 is still the official released version of Pug. 29/09/2019 @2.0.4 has been publshed.
If you can't or don't want to use node.js, and if client side execution is not an option either, RosaeNLG can run in a Java Virtual Machine using link:https://www.graalvm.org/[Graal VM].
You can choose between different bundled js versions of RosaeNLG to run on Graal:
* See all versions on xref:browser:intro.adoc[browser doc]. Most tinyfied versions were designed to be run in a browser, but will work well on Graal.
* If you don't want to bother, or need compilation or runtime ability in multiple output languages, you can also use the full version, with compilation ability on every supported language: `rosaenlg_fat_VERSION_comp.js` (about 75 Mb)
See sample projects:
* link:https://gitlab.com/rosaenlg-projects/rosaenlg-graal-poc[Graal POC] which makes the tutorial run in a JVM