textlint-plugin-rst
Version:
reStructuredText support for textlint
47 lines (38 loc) • 1.83 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
var _rstToAst = require("./rst-to-ast");
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
var ReSTProcessor = function () {
function ReSTProcessor(config) {
_classCallCheck(this, ReSTProcessor);
this.config = config;
}
_createClass(ReSTProcessor, [{
key: "processor",
value: function processor(ext) {
return {
preProcess: function preProcess(text, filePath) {
return (0, _rstToAst.parse)(text);
},
postProcess: function postProcess(messages, filePath) {
return {
messages: messages,
filePath: filePath ? filePath : "<rst>"
};
}
};
}
}], [{
key: "availableExtensions",
value: function availableExtensions() {
return [".rst", ".rest"];
}
}]);
return ReSTProcessor;
}();
exports.default = ReSTProcessor;
module.exports = exports['default'];
//# sourceMappingURL=ReSTProcessor.js.map