boilerplate project is a standard NLG project using RosaeNLG and following (my) best practices that you can fork to start your own RosaeNLG project.
It is based on the content of the English tutorial.
At some point you have to load into data and also pre process it. You can use
init.js for that.
One possible organization for your templates:
phoneForJson.pugare technical entrypoints: they are almost the same, and mainly call the
includes.pugcentralizes all your includes: this is handy when you refactor
phones.pugis the real entrypoint for NLG: it generates the text for a phone
phone_refexpr.pugcontains the reference and referring expressions for phones. Create one file per object you describe (
sentences (most of the textual content) are in
colors.puggenerates the sentence about the colors,
intro.pugis the introduction sentence etc.
If you have longer sentences and paragraphs you should create a more sophisticated hierarchy, but I recommend to keep 1 file per sentence.
You should (really) have some regression testing on your texts. It just compares texts with reference texts previously generated.
gulp nonregto regenerate the reference file in
tests/phonesNonreg.json. It contains texts along with the random seed (the same random seed has to be used when running the tests).
Run the tests using
npm run testor