Client side in browser compiling and rendering

This is the documentation for 1.20.0 version, which is not the latest version. Consider upgrading to 3.4.0.

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 rosaenlg_tiny_fr_FR_*\_comp.js:

  • 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.

Packaged version of RosaeNLG for client side usage

RosaeNLG provides browser ready "tinyified" packages per language in dist/browser:

Table 1. Available packages per language
Language Rendering only With compilation

en_US

392K

1.5M

fr_FR

308K

8.3M

de_DE

280K

43M

it_IT

288K

9.7M

es_ES

288K

1.4M

OTHER

240K

1.3M

en_US rendering only version is a little larger as it includes a/an linguistic resource.

Well, the German version with compilation support is too large indeed.