Commit 8c818184 authored by Ludan Stoecklé's avatar Ludan Stoecklé

1.4.0

parent b275b6a8
{
"name": "english-determiners",
"version": "2.3.3",
"version": "2.4.0",
"description": "English determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-adjectives",
"version": "2.3.3",
"version": "2.4.0",
"description": "Agreement of adjectives in French",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -45,7 +45,7 @@
},
"dependencies": {
"debug": "^4.1.1",
"french-h-muet-aspire": "2.3.3"
"french-h-muet-aspire": "2.4.0"
},
"keywords": [
"french",
......
{
"name": "french-determiners",
"version": "2.3.3",
"version": "2.4.0",
"description": "French determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-h-muet-aspire",
"version": "2.3.3",
"version": "2.4.0",
"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\"",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-ordinals",
"version": "2.3.3",
"version": "2.4.0",
"description": "Ordinal numbers in French: 12 => douzième",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "french-verbs",
"version": "2.3.3",
"version": "2.4.0",
"description": "French verbs: conjugation, based on the Lefff contents, and list of transitive and intransitive verbs",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -50,7 +50,7 @@
},
"dependencies": {
"debug": "^4.1.1",
"french-h-muet-aspire": "2.3.3"
"french-h-muet-aspire": "2.4.0"
},
"devDependencies": {
"copyfiles": "^2.1.0",
......
{
"name": "french-words-gender",
"version": "2.3.3",
"version": "2.4.0",
"description": "Gender of French words, based on the Lefff",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-adjectives",
"version": "2.3.3",
"version": "2.4.0",
"description": "German adjectives, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-determiners",
"version": "2.3.3",
"version": "2.4.0",
"description": "German determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-dict-helper",
"version": "2.3.3",
"version": "2.4.0",
"description": "Helper functions on an included database derived from german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-ordinals",
"version": "2.3.3",
"version": "2.4.0",
"description": "Ordinal numbers in German: 12 => zwölfte",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-verbs",
"version": "2.3.3",
"version": "2.4.0",
"description": "German verbs, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "german-words",
"version": "2.3.3",
"version": "2.4.0",
"description": "Gender and case of German words, based on german-pos-dict",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
# gulp-rosaenlg
# Gulp module for RosaeNLG
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
```javascript
var gulpFreenlpg = require('gulp-rosaenlg');
const fs = require('fs');
const tmpFile = 'tmp.js';
let os = gulpFreenlpg.compileTemplates([{source: 'test/test.pug', name:'test'}], 'en_US', tmpFile, 'templates_holder');
os.on('finish', function() {
console.log('DONE');
const compiledString = fs.readFileSync(tmpFile, 'utf-8');
console.log(`done: ${compiledString.length}`);
// fs.unlinkSync(tmpFile);
});
```
## Todo
Make `renderTemplateInFile` asynchronous.
## Dependancies
* rosaeNLG
* browserify
const gulpFreenlpg = require('./dist/index.js');
const gulpRosaeNLG = require('./dist/index.js');
const fs = require('fs');
const tmpFile = 'tmp.js';
const os = gulpFreenlpg.compileTemplates(
const os = gulpRosaeNLG.compileTemplates(
[{ source: 'test/test.pug', name: 'test' }],
'en_US',
tmpFile,
......
{
"name": "gulp-rosaenlg",
"version": "2.3.3",
"version": "2.4.0",
"description": "RosaeNLG client side packaging helper",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -60,6 +60,6 @@
"browserify": "^16.2.3",
"debug": "^4.1.1",
"minify-stream": "^1.2.0",
"rosaenlg": "1.3.3"
"rosaenlg": "1.4.0"
}
}
{
"name": "italian-adjectives",
"version": "2.3.3",
"version": "2.4.0",
"description": "Italian adjectives, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -58,6 +58,6 @@
"license": "MIT",
"dependencies": {
"debug": "^4.1.1",
"rosaenlg-filter": "2.3.3"
"rosaenlg-filter": "2.4.0"
}
}
{
"name": "italian-determiners",
"version": "2.3.3",
"version": "2.4.0",
"description": "Italian determiners",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-ordinals-cardinals",
"version": "2.3.3",
"version": "2.4.0",
"description": "Ordinal and cardinal numbers in Italian",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-verbs",
"version": "2.3.3",
"version": "2.4.0",
"description": "Italian verbs, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "italian-words",
"version": "2.3.3",
"version": "2.4.0",
"description": "Gender and plural of Italian words, based on morph-it",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "lefff-helper",
"version": "2.3.3",
"version": "2.4.0",
"description": "Helper functions on an included database derived from Lefff",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "morph-it-helper",
"version": "2.3.3",
"version": "2.4.0",
"description": "Helper functions on an included database derived from morph-it (Free Morphological Lexicon for the Italian Language)",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......
{
"name": "rosaenlg-filter",
"version": "2.3.3",
"version": "2.4.0",
"description": "Filtering feature of RosaeNLG",
"main": "dist/index.js",
"types": "dist/index.d.ts",
......@@ -43,7 +43,7 @@
"better-title-case": "^1.0.1",
"compromise": "^11.14.3",
"debug": "^4.1.1",
"french-h-muet-aspire": "2.3.3",
"french-h-muet-aspire": "2.4.0",
"titlecase-french": "^1.0.1"
},
"keywords": [
......
{
"name": "rosaenlg-pug-code-gen",
"version": "3.3.3",
"version": "3.4.0",
"description": "Default code-generator for pug. It generates HTML via a JavaScript template function. - RosaeNLG fork",
"scripts": {
"build": "tsc && cp lib/index.js dist/",
......@@ -53,13 +53,13 @@
"constantinople": "^3.1.2",
"debug": "^4.1.1",
"doctypes": "^1.1.0",
"french-verbs": "2.3.3",
"german-adjectives": "2.3.3",
"german-verbs": "2.3.3",
"german-words": "2.3.3",
"italian-adjectives": "2.3.3",
"italian-verbs": "2.3.3",
"italian-words": "2.3.3",
"french-verbs": "2.4.0",
"german-adjectives": "2.4.0",
"german-verbs": "2.4.0",
"german-words": "2.4.0",
"italian-adjectives": "2.4.0",
"italian-verbs": "2.4.0",
"italian-words": "2.4.0",
"js-stringify": "^1.0.1",
"pug-attrs": "^2.0.3",
"pug-error": "^1.3.2",
......
{
"name": "rosaenlg-pug-filters",
"version": "4.3.3",
"version": "4.4.0",
"description": "Code for processing filters in pug templates - RosaeNLG fork",
"scripts": {},
"keywords": [
......@@ -12,7 +12,7 @@
"jstransformer": "1.0.0",
"pug-error": "^1.3.2",
"resolve": "^1.1.6",
"rosaenlg-pug-walk": "2.2.3",
"rosaenlg-pug-walk": "2.3.0",
"snyk": "^1.232.0"
},
"devDependencies": {
......@@ -21,9 +21,9 @@
"jstransformer-less": "^2.3.0",
"jstransformer-markdown-it": "^2.1.0",
"jstransformer-stylus": "^1.0.0",
"rosaenlg-pug-lexer": "5.2.3",
"rosaenlg-pug-load": "3.2.3",
"rosaenlg-pug-parser": "6.2.3"
"rosaenlg-pug-lexer": "5.3.0",
"rosaenlg-pug-load": "3.3.0",
"rosaenlg-pug-parser": "6.3.0"
},
"repository": {
"type": "git",
......
{
"name": "rosaenlg-pug-lexer",
"version": "5.2.3",
"version": "5.3.0",
"description": "The pug lexer (takes a string and converts it to an array of tokens) - RosaeNLG fork",
"keywords": [
"pug"
......
{
"name": "rosaenlg-pug-linker",
"version": "4.2.3",
"version": "4.3.0",
"description": "Link multiple pug ASTs together using include/extends - RosaeNLG fork",
"keywords": [
"pug"
......@@ -8,12 +8,12 @@
"scripts": {},
"dependencies": {
"pug-error": "^1.3.2",
"rosaenlg-pug-walk": "2.2.3"
"rosaenlg-pug-walk": "2.3.0"
},
"devDependencies": {
"rosaenlg-pug-lexer": "5.2.3",
"rosaenlg-pug-load": "3.2.3",
"rosaenlg-pug-parser": "6.2.3"
"rosaenlg-pug-lexer": "5.3.0",
"rosaenlg-pug-load": "3.3.0",
"rosaenlg-pug-parser": "6.3.0"
},
"repository": {
"type": "git",
......
{
"name": "rosaenlg-pug-load",
"version": "3.2.3",
"version": "3.3.0",
"description": "The Pug loader is responsible for loading the depenendencies of a given Pug file. - RosaeNLG fork",
"keywords": [
"pug"
......@@ -8,11 +8,11 @@
"scripts": {},
"dependencies": {
"object-assign": "^4.1.0",
"rosaenlg-pug-walk": "2.2.3"
"rosaenlg-pug-walk": "2.3.0"
},
"devDependencies": {
"rosaenlg-pug-lexer": "5.2.3",
"rosaenlg-pug-parser": "6.2.3"
"rosaenlg-pug-lexer": "5.3.0",
"rosaenlg-pug-parser": "6.3.0"
},
"repository": {
"type": "git",
......
{
"name": "rosaenlg-pug-parser",
"version": "6.2.3",
"version": "6.3.0",
"description": "The pug parser (takes an array of tokens and converts it to an abstract syntax tree) - RosaeNLG fork",
"keywords": [
"pug"
......
{
"name": "rosaenlg-pug-walk",
"version": "2.2.3",
"version": "2.3.0",
"description": "Walk and transform a pug AST - RosaeNLG fork",
"keywords": [
"pug"
],
"scripts": {},
"devDependencies": {
"rosaenlg-pug-lexer": "5.2.3",
"rosaenlg-pug-parser": "6.2.3"
"rosaenlg-pug-lexer": "5.3.0",
"rosaenlg-pug-parser": "6.3.0"
},
"dependencies": {
"debug": "^4.1.1"
......
{
"name": "rosaenlg-yseop",
"version": "2.3.3",
"version": "2.4.0",
"description": "Yseop code generator for RosaeNLG. It generates Yseop Text compatible templates. Derived from rosaenlg-pug-code-gen.",
"scripts": {},
"keywords": [
......
name: rosaenlg
version: '1.3.3'
version: '1.4.0'
title: RosaeNLG
nav:
- modules/ROOT/nav.adoc
- modules/about/nav.adoc
- modules/tutorials/nav.adoc
- modules/integration/nav.adoc
- modules/mixins_ref/nav.adoc
- modules/browser/nav.adoc
- modules/random/nav.adoc
- modules/yseop/nav.adoc
- modules/about/nav.adoc
- modules/advanced/nav.adoc
= Change log
= Change log of the RosaeNLG npm module
////
https://keepachangelog.com/en/0.3.0/
......@@ -8,6 +8,17 @@ https://keepachangelog.com/en/0.3.0/
=== Changed
////
== [1.4.0] - 2019-11-07
=== Changed
* large reorganization of the documentation
=== Added
* more doc on how to integrate, Java Wrapper, Java Server etc.
== [1.3.3] - 2019-10-29
=== Fixed
......
= Quick Start
[#nodejs]
== Using node.js
In some js file:
[source,javascript]
....
const rosaenlgPug = require('rosaenlg');
......@@ -53,13 +56,19 @@ p
....
On your local command line:
[source,bash]
....
$ 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].
* Advanced
** xref:other_languages.adoc[Other Languages]
** xref:yseop.adoc[Yseop Template Generator]
** xref:performance.adoc[Performance]
** xref:related_projects.adoc[Related Projects]
** xref:graal.adoc[GraalVM runtime]
** xref:params.adoc[Global Parameters]
** xref:howitworks.adoc[How it works]
** xref:pug.adoc[Why Pug?]
** xref:random.adoc[Random Numbers (and why it matters)]
** xref:filter.adoc[Filter mechanism]
** xref:resources.adoc[Linguistic resources]
** xref:contrib.adoc[Contribute]
......
......@@ -7,8 +7,8 @@ Alternatively, as the author, this is my own personal doc when I forget how thin
On Gitlab:
* Project group: https://gitlab.com/rosaenlg-projects
* Main project: https://gitlab.com/rosaenlg-projects/rosaenlg
* link:https://gitlab.com/rosaenlg-projects[Project group]
* link:https://gitlab.com/rosaenlg-projects/rosaenlg[Main project]
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.
......
= GraalVM runtime
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
* link:https://gitlab.com/rosaenlg-p