unified

Project:retextjs/retext-syntax-mentions

Package:retext-syntax-mentions@2.0.0

  1. Dependencies:3·Dependents:4
  2. retext plugin to classify @mentions as syntax, not natural language
  1. unified 135
  2. plugin 123
  3. retext 33
  4. syntax 30
  5. retext-plugin 20
  6. github 6
  7. source 3
  8. mention 2
  9. twitter 2

retext-syntax-mentions

Build Coverage Downloads Size Sponsors Backers Chat

retext plugin to classify @mentions as syntax, not natural language.

Install

npm:

npm install retext-syntax-mentions

Use

Without syntax-mentions:

var dictionary = require('dictionary-en-gb')
var unified = require('unified')
var english = require('retext-english')
var stringify = require('retext-stringify')
var spell = require('retext-spell')
var mentions = require('retext-syntax-mentions')
var report = require('vfile-reporter')

unified()
  .use(english)
  .use(spell, dictionary)
  .use(stringify)
  .process('Misspelt? @wooorm.', function(err, file) {
    console.log(report(err || file))
  })

Yields:

  1:12-1:18  warning  `wooorm` is misspelt; did you mean `worm`?  retext-spell  retext-spell

⚠ 1 warning

With syntax-mentions:

   .use(english)
+  .use(mentions)
   .use(spell, dictionary)

Yields:

no issues found

API

retext().use(mentions)

Classify @mentions as source, which represent “external (ungrammatical) values” instead of natural language. This hides mentions from retext-spell, retext-readability, retext-equality, and more.

Contribute

See contributing.md in retextjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer