Replace :app write with :checkers grammar

This commit is contained in:
Henrik Lissner 2020-01-09 16:43:03 -05:00
parent 8ac4320e0b
commit a680a4c96d
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395
9 changed files with 104 additions and 250 deletions

View file

@ -0,0 +1,68 @@
#+TITLE: checkers/grammar
#+DATE: January 9, 2020
#+SINCE: v3.0.0
#+STARTUP: inlineimages nofold
* Table of Contents :TOC_3:noexport:
- [[#description][Description]]
- [[#maintainers][Maintainers]]
- [[#module-flags][Module Flags]]
- [[#plugins][Plugins]]
- [[#prerequisites][Prerequisites]]
- [[#features][Features]]
- [[#language-tool][Language Tool]]
- [[#commands][Commands]]
- [[#writegood-mode][writegood-mode]]
- [[#configuration][Configuration]]
- [[#troubleshooting][Troubleshooting]]
* Description
This module adds grammar checking to Emacs to aid your writing by combining
=lang-tool= and =writegood-mode=.
** Maintainers
This module has no dedicated maintainers.
** Module Flags
This module provides no flags.
** Plugins
+ [[https://github.com/mhayashi1120/Emacs-langtool][langtool]]
+ [[https://github.com/bnbeckwith/writegood-mode][writegood-mode]]
* Prerequisites
This module requires langtool (which requires =Java 1.8+=).
It can be acquired either from https://languagetool.org/ or your OS's package
manager:
+ macOS: ~brew install languagetool~
+ Arch Linux: ~pacman -S languagetool~
This module tries to guess the location of languagetool-commandline.jar. If you
get a warning that Doom =couldn't find languagetool-commandline.jar=, you will
need to set ~langtool-language-tool-jar~ to its location.
* Features
An in-depth list of features, how to use them, and their dependencies.
** Language Tool
[[https://www.languagetool.org/][Language Tool]] is a polyglot proofreader service that checks for grammar and
stylistic issues in your writing. This requires Java 1.8+.
#+begin_quote
This requires Java 1.8+
#+end_quote
*** Commands
- ~langtool-check~
- ~langtool-correct-buffer~
** writegood-mode
This minor mode highlights weasel words, duplication and passive voice.
* Configuration
How to configure this module, including common problems and how to address them.
* Troubleshooting
Common issues and their solution, or places to look for help.

View file

@ -0,0 +1,28 @@
;;; checkers/grammar/config.el -*- lexical-binding: t; -*-
(use-package! langtool
:commands (langtool-check
langtool-check-done
langtool-show-message-at-point
langtool-correct-buffer)
:init (setq langtool-default-language "en-US")
:config
(unless langtool-language-tool-jar
(setq langtool-language-tool-jar
(cond (IS-MAC
(locate-file "libexec/languagetool-commandline.jar"
(doom-files-in "/usr/local/Cellar/languagetool"
:type 'dirs
:depth 2)))
(IS-LINUX
"/usr/share/java/languagetool/languagetool-commandline.jar")))))
;; Detects weasel words, passive voice and duplicates
(use-package! writegood-mode
:hook (org-mode markdown-mode rst-mode asciidoc-mode latex-mode)
:config
(map! :localleader
:map writegood-mode-map
"g" #'writegood-grade-level
"r" #'writegood-reading-ease))

View file

@ -0,0 +1,5 @@
;; -*- no-byte-compile: t; -*-
;;; checkers/grammar/packages.el
(package! langtool)
(package! writegood-mode)