-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
README.html
132 lines (91 loc) · 4.98 KB
/
README.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>README.html</title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
</head>
<body>
<p><a href="https://www.gnu.org/licenses/gpl-3.0"><img src="https://img.shields.io/badge/License-GPL%20v3-blue.svg" alt="License: GPL v3" /></a>
<a href="https://melpa.org/#/flymake-languagetool"><img src="https://melpa.org/packages/flymake-languagetool-badge.svg" alt="MELPA" /></a>
<a href="https://stable.melpa.org/#/flymake-languagetool"><img src="https://stable.melpa.org/packages/flymake-languagetool-badge.svg" alt="MELPA Stable" /></a></p>
<p><img align="right" src="./etc/logo.png" with="138" height="46"></p>
<h1>flymake-languagetool</h1>
<blockquote><p>Flymake support for LanguageTool.</p></blockquote>
<p><a href="https://github.com/emacs-languagetool/flymake-languagetool/actions/workflows/test.yml"><img src="https://github.com/emacs-languagetool/flymake-languagetool/actions/workflows/test.yml/badge.svg" alt="CI" /></a></p>
<h2>Installation</h2>
<p>The instruction to use this plugin.</p>
<ol>
<li>Download LanguageTool from https://languagetool.org/download/ and
extract on to your local machine (skip this step if using a remote
server).</li>
<li>Consider adding the following snippet to your configuration.</li>
</ol>
<p>```el
(use-package flymake-languagetool
:ensure t
:hook ((text-mode . flymake-languagetool-load)
(latex-mode . flymake-languagetool-load)
(org-mode . flymake-languagetool-load)
(markdown-mode . flymake-languagetool-load))
:init
;; Remote server config with LanguageTool’s free API
;; (setq flymake-languagetool-url “https://api.languagetool.org”)
;; (setq flymake-languagetool-server-port nil)
;; (setq flymake-languagetool-server-jar nil)</p>
<p> ;; Local server config
(setq flymake-languagetool-server-jar “path/to/LanguageTool-X.X/languagetool-server.jar”))
```</p>
<ol>
<li>:tada: Done! Now open a text file and hit <code>M-x flymake-mode</code>!</li>
</ol>
<p>otherwise you can call <code>flymake-languagetool-maybe-load</code> like the snippet below.</p>
<p><code>el
(add-hook 'find-file-hook 'flymake-languagetool-maybe-load)
</code></p>
<h2>Configuration</h2>
<ul>
<li><code>flymake-languagetool-server-jar</code></li>
<li><code>flymake-languagetool-active-modes</code></li>
<li><code>flymake-languagetool-check-spelling</code></li>
<li><code>flymake-languagetool-language</code> (Default <code>"en-US"</code>)</li>
</ul>
<h3>Spellchecking</h3>
<p>LanguageTool’s spellchecking is disabled by default. If
<code>flymake-languagetool-check-spelling</code> is non-nil LanguageTool will check
for spelling mistakes.</p>
<h3>Disabling Rules</h3>
<p>Specific rules can be disabled using
<code>flymake-languagetool--disabled-rules</code>. For example, LanguageTool’s
whitespace rule can be a bit verbose in <code>org-mode</code> and it can be
disabled by adding its ID to this variable.</p>
<p><code>el
(push "WHITESPACE_RULE" flymake-languagetool--disabled-rules)
</code></p>
<p>The full list of rules and their IDs can be found <a href="https://community.languagetool.org/rule/list?lang=en">here</a>.</p>
<p>You can also disable rules using..</p>
<h3>Corrections</h3>
<p>Suggestions from LanguageTool can be applied with:</p>
<p><code>flymake-languagetool-correct</code>: select error in current buffer with
completing read</p>
<p><code>flymake-languagetool-correct-at-point</code>: correct error at point</p>
<p><code>flymake-languagetool-correct-dwim</code>: if point is on a
<code>flymake-languagetool</code> error then correct; otherwise, select one
from the current buffer.</p>
<h3>Categories</h3>
<p>By default, <code>flymake-languagetool</code> will now provide LanguageTool
category information for each identified error. If you wish to disable
this behavior, you can set <code>flymake-languagetool-use-categories = nil</code>.</p>
<p><img align="middle" src="./etc/diagnostics.png" with="500" height="700"></p>
<h2>Contribute</h2>
<p><a href="http://makeapullrequest.com"><img src="https://img.shields.io/badge/PRs-welcome-brightgreen.svg" alt="PRs Welcome" /></a>
<a href="https://github.com/bbatsov/emacs-lisp-style-guide"><img src="https://img.shields.io/badge/elisp-style%20guide-purple" alt="Elisp styleguide" /></a>
<a href="https://www.paypal.me/jcs090218"><img src="https://img.shields.io/badge/paypal-donate-1?logo=paypal&color=blue" alt="Donate on paypal" /></a>
<a href="https://www.patreon.com/jcs090218"><img src="https://img.shields.io/badge/patreon-become%20a%20patron-orange.svg?logo=patreon" alt="Become a patron" /></a></p>
<p>If you would like to contribute to this project, you may either
clone and make pull requests to this repository. Or you can
clone the project and establish your own branch of this tool.
Any methods are welcome!</p>
</body>
</html>