A plugin for gulp that enables spelling & grammar checks on html and markdown files.
Alpha This is a prototype and due a refactor. See Todo for more info.
var gulp = require('gulp');
var lt = require('gulp-language-tool');
gulp.task('default', function() {
gulp.src('/posts/*{.md}')
.pipe(lt());
});
gulp-language-tool
accepts an optional object of configuration, it has the following configuration:
- interface - The URL of Language Tool
It is highly recommended that you run your own local Language Tool instance, as the public API is rate limited. For instructions see https://languagetool.org/ or:
$ wget https://languagetool.org/download/LanguageTool-3.3.zip
$ unzip LanguageTool-3.3.zip
$ cd LanguageTool-3.3/
$ java -cp languagetool-server.jar org.languagetool.server.HTTPServer --port 8081
You can then specify you local instance as an interface:
gulp.task('default', function() {
gulp.src('/posts/*{.md}')
.pipe(lt({ interface: 'http://localhost:8081' }));
});
- Investigate issue with
.on('end')
not being called unlessgulp-plumber
is used - Create a
Reporter
interface and define a default - Move
lib\language-tool-interface
into it's own module - Add a
failOnErrors
option - Add a
stripContextCR
option to remove newlines from context - Improve & extend file parsers