Remark plugin for Textr — modular tool to make your typography better.
Process your markdown with Textr plugins, skipping code.
Install
npm install --save remark-textr
Usage
import remark from 'remark';
import remarkTextr from 'remark-textr';
const ellipses = input => input.replace(/\.{3}/gim, '…');
const text = `
## spread operator...
function(...args) { return args; }
`.trim();
remark.use(remarkTextr, { plugins: [ ellipses ] }).process(text);
API
Type: Object
Default: {}
Contain plugins
and options
which are Textr’s options. Check out Textr usage section.
Type: Array
Default: []
Array of Textr plugins. They are available on npm, labelled with textr keyword. Also you can easily create new one. Don’t be scared.
Type: Object
Default: {}
Any option was set in options
will be passed into Textr as it's options.
For example, you may want to set your ISO 639 locale code. It's important for right correction, basically for proper primary and secondary quotes.
CLI
remark-textr
as remark plugin has no CLI itself, so you are gonna use remark CLI instead. So check the remark-cli docs first. remark
and remark-textr
both have to be installed. Also you have to define textr
plugins as Array of Strings, but you are lucky and remark-textr
will require them for you!
inline
remark --use "textr=plugins:['typographic-base']" README.md --output README.md
config
remark README.md --output README.md
With this .remarkrc
config defined:
{
"plugins": {
"textr": {
"plugins": [ "typographic-base"],
"options": { "locale": "en-us" }
}
}
}
License
MIT © Denys Dovhan