Client side in browser compiling and rendering
Both compilation and rendering are made in the browser: templates can be authored directly in the browser, or dynamically generated, compiled in the browser and the texts can also be rendered in the browser.
To be able to do that, you must use a js version of RosaeNLG that is larger, with
_comp at the end, like
it includes the templates compiler
but also all linguistic resources that are associated with a language
|Client side compilation is for exotic usecases. You should favor server side compilation.|
It can be used to create a 100% client side editor and renderer, like in this demo.
Works with Firefox and Edge, but not with older IE.
|German version with compiling does not work under Firefox (probably due to the huge size of the file), but works on Chrome and Edge (recent versions).|
RosaeNLG provides browser ready tinyified packages per language in
2 packages per language: classic (rendering only) and
\_compversion can compile templates. For browser usage, you should compile the templates upstream and use the classic version, as the
\_compare very large.
en_USrendering only version is a little larger as it includes
the German version with compilation support is huge.
200K rosaenlg_tiny_de_DE_1.20.2.js 43M rosaenlg_tiny_de_DE_1.20.2_comp.js 308K rosaenlg_tiny_en_US_1.20.2.js 1,4M rosaenlg_tiny_en_US_1.20.2_comp.js 204K rosaenlg_tiny_es_ES_1.20.2.js 1,3M rosaenlg_tiny_es_ES_1.20.2_comp.js 224K rosaenlg_tiny_fr_FR_1.20.2.js 8,2M rosaenlg_tiny_fr_FR_1.20.2_comp.js 216K rosaenlg_tiny_it_IT_1.20.2.js 9,7M rosaenlg_tiny_it_IT_1.20.2_comp.js 120K rosaenlg_tiny_OTHER_1.20.2.js 1,2M rosaenlg_tiny_OTHER_1.20.2_comp.js
All versions are available on
unpkg.com CDN, for instance: