Remark plugin for Textr — modular tool to make your typography better.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.editorconfig
.gitignore
.prettierignore
.travis.yml
index.js
license
package.json
readme.md
test.js
yarn.lock

readme.md

remark-textr

Build Coverage Downloads Chat Sponsors Backers

Make your typography better with remark and Textr (skipping code).

Installation

npm:

npm install remark-textr

Usage

Say we have the following file, example.md:

## spread operator...

```js
function(...args) { return args; }
```

And our script, example.js, looks as follows:

var vfile = require('to-vfile')
var remark = require('remark')
var textr = require('remark-textr')

// textr plugin — just function to replace triple dots to ellipses
function ellipses(input) {
  return input.replace(/\.{3}/gim, '')
}

remark()
  .use(textr, {plugins: [ellipses]})
  .process(vfile.readSync('example.md'), function(err, file) {
    if (err) throw err
    console.log(String(file))
  })

Yields:

## spread operator…

```js
function(...args) { return args; }
```

API

remark.use(textr[, config])

config.plugins

List of Textr plugins (Array.<string|Function>?). They are available on npm, labelled with textr keyword. Also you can easily create new one, as shown in the example above. If strings are passed in, those are required.

config.options

Passed to Textr as it’s options (Object?). For example, you may want to set your ISO 639 locale code. It’s important for stuff like the correct primary and secondary quotes.

Contribute

See contributing.md in remarkjs/remark for ways to get started.

This organisation has a Code of Conduct. By interacting with this repository, organisation, or community you agree to abide by its terms.

License

MIT © Denys Dovhan