JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 34151
  • Score
    100M100P100Q156034F
  • License MIT

Remark plugin for Textr — modular tool to make your typography better.

Package Exports

  • remark-textr

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (remark-textr) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

remark-textr Build Status Coverage Status Chat

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