typograf-loader
v0.1.1-1
Published
Typograf loader for Webpack
Downloads
4
Maintainers
Readme
typograf-loader
Typograf loader module for webpack. Uses https://github.com/typograf/typograf
Issues with the output should be reported on the typograf issue tracker.
Install
$ npm install --save-dev typograf-loader
Usage
In your webpack.config.js, add the typograf-loader, chained with the other loaders.
This outputs processed html file with file-loader:
loaders: [
{
test: /ru\.html$/,
loaders: [
'file?name=[name].[ext]',
'typograf?lang=ru&mode=name'
]
}
]
Or to process markdown texts:
loaders: [
{
test: /ru\.md$/,
loaders: [
'html',
'typograf?lang=ru&mode=name',
'markdown'
]
}
]
Options
Full documentation can be found here: https://github.com/typograf/typograf
lang
Set text language.
Type: string
Default: en
Options: en
| ru
mode
Set output style.
Type: string
Default: default
Options: default
| name
| digit
default
: utf-8 symbolsname
: html special characters with name:&hellip
digit
: html special characters in numbers form:…
enable
Enables rule.
Type: string
| [ string, ... ]
Default: []
Options: *
| Rules
disable
Disables rule.
Type: string
| [ string, ... ]
Default: []
Options: *
| Rules
Examples
Passing options as query string:
...
loaders: [
{
test: /ru\.html$/,
loaders: [
'typograf?lang=ru&mode=name&enable[]=ru/optalign/*&disable[]=ru/money/ruble',
]
}
]
...
Passing options from object as JSON string:
...
loaders: [
{
test: /ru\.html$/,
loaders: [
'typograf?' + JSON.stringify({
lang: 'ru',
mode: 'name',
enable: [ 'ru/optalign/*' ],
disable: [ 'ru/money/ruble' ]
}),
]
}
]
...