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