Closed pofider closed 8 years ago
looks very clean to me :+1:
in toner the API for registering an extension is:
toner.engine("jsrender", require("toner-jsrender"));
toner.recipe("wkhtmltopdf", require("toner-wkhtmltopdf")());
is very clear what key/name to use in jsreport.render
, do you think is a good idea to document (in each extension) the name that each extension register in jsreport?
for example, mention in the jsreport-phantom-pdf documentation that its name is phantom-pdf
You are right. I was thinking about it as well.
It should be in every extensions' docs. And also it should be mentioned in this doc it is convention to name the repository with jsreport-
but the recipe/engine is just the second part.
I will improve docs in this manner.
cool, i'll keep an eye on this because i would like to update jsreport-jade
docs (and make sure that it works on the latest version of jsreport)
I united also jsreport-core
initialization now and removed bootstrapper
.
Only one approach now to initialize is:
var jsreport = require('jsreport-core')({options})
jsreport.init()
This applies only configuration passed as options and configuration passed directly to extensions. If you want to apply configuration file / env variables / command line args. You should set loadConfig:true
in the options.
var jsreport = require('jsreport-core')({loadConfig: true})
jsreport.init()
//jsreport is now initialized based on [prod|dev].config
If there is nothing more to change...
I will start to update extensions to support the new manual use in jsreport-core. Publish the new version and update articles.
a good change!, i think the jsreport-core
API is done
Changes released in 0.2
I have slightly updated the readme of jsreport core and described the API.
I think that now
jsreport-core
can be nicely used in node.js applications (instead of toner) and together with other extensions it can be also distributed as wholejsreport
.@bjrmatos - Do you have any comments, ideas or improvements about
jsreport-core
api?When we agree on the final version, I will merge toner sources into jsreport core and update articles to instruct readers how to use jsreport-core in nodejs instead of toner.