Skip to content

Commit fac712a

Browse files
committed
Add docs for messages
1 parent 0c87806 commit fac712a

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

readme.md

+31
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,35 @@ body’s reading level.
110110
This plugin works on a per-sentence basis and that makes the results quite
111111
skewered when a short sentence has a few long words or some unknown ones.
112112

113+
### Messages
114+
115+
Each message is emitted as a [`VFileMessage`][message] on `file`, with the
116+
following fields:
117+
118+
###### `message.source`
119+
120+
Name of this plugin (`'retext-readability'`).
121+
122+
###### `message.ruleId`
123+
124+
Name of this rule (`'readability'`).
125+
126+
###### `message.actual`
127+
128+
Current not ok sentence (`string`).
129+
130+
###### `message.expected`
131+
132+
Empty array as there is no direct fix for `actual` (`[]`).
133+
134+
###### `message.confidence`
135+
136+
Number between `0` and `1` to represent how many algorithms agreed (`number`).
137+
138+
###### `message.confidenceLabel`
139+
140+
String representing the fraction of `confidence` (`string`, such as `4/7`).
141+
113142
## Related
114143

115144
* [`retext-syntax-mentions`](https://github.com/retextjs/retext-syntax-mentions)
@@ -177,6 +206,8 @@ abide by its terms.
177206

178207
[retext]: https://github.com/retextjs/retext
179208

209+
[message]: https://github.com/vfile/vfile-message
210+
180211
[dale-chall]: https://github.com/words/dale-chall-formula
181212

182213
[automated-readability]: https://github.com/words/automated-readability

0 commit comments

Comments
 (0)