Comments plugin for SourceJS for commenting Spec examples.
Compatible with SourceJS v.0.5.6+.
To install, run npm in sourcejs/user
folder:
npm install sourcejs-comments --save
Then run build command in SourceJS root:
cd sourcejs
npm run build
After installation, all your Specs pages will have "Add description" tumbler in inner menu, that will active the plugin.
As MongoDB is not essential dependency for SourceJS, you must install it separately, to work with plugins that expect data storage.
Install MongoDB locally or get it from MongoLab and configure your SourceJS in sourcejs/user/options.js
:
core: {
"production": {
"host": "localhost",
"dbName": "sourcejs"
}
}
Host could point to remote service. Database name could be custom as well.
Then prepare mongoose
dependency - as it must be common for every plugins, install it in sourcejs/user
npm install mongoose --save
And edit /sourcejs/user/core/app.js
, that extends main SourceJS application. Just add this code snippet, for connection to database:
/* Connect to DB */
var mongoose = require('mongoose');
var dbAdress = 'mongodb://' + global.opts.core.production.host + '/' + global.opts.core.production.dbName;
mongoose.connection.on("connecting", function() {
return console.log("Started connection on " + (dbAdress).cyan + ", waiting for it to open...".grey);
});
mongoose.connection.on("open", function() {
return console.log("MongoDB connection opened!".green);
});
mongoose.connection.on("error", function(err) {
console.log("Could not connect to mongo server!".red);
return console.log(err.message.red);
});
mongoose.connect(dbAdress);
/* /Connect to DB */
For SourceJS v0.3.* use older plugin version 0.0.x.