Socket
Socket
Sign inDemoInstall

remark-textr

Package Overview
Dependencies
2
Maintainers
5
Versions
15
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    remark-textr

remark plugin to integrate with Textr


Version published
Maintainers
5
Install size
54.1 kB
Created

Readme

Source

remark-textr

Build Coverage Downloads Size Sponsors Backers Chat

remark plugin to make your typography better with Textr.

Install

npm:

npm install remark-textr

Use

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')

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

// Textr plugin: just a function to replace triple dots to ellipses.
function ellipses(input) {
  return input.replace(/\.{3}/gim, '…')
}

Yields:

## spread operator…

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

API

remark().use(textr[, config])

Make your typography better with Textr.

config
config.plugins

List of Textr plugins (Array.<string|Function>?). If strings are passed in, those are loaded with require. Textr plugins are available on npm, labelled with textr keyword. You can also create them yourself, as shown in the example above.

config.options

Textr options (Object?). For example, you may want to set the ISO 639 locale code of the content, which is important for stuff like the correct primary and secondary quotes.

Contribute

See contributing.md in remarkjs/.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, organisation, or community you agree to abide by its terms.

License

MIT © Denys Dovhan

Keywords

FAQs

Last updated on 18 Jun 2019

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc