4.1.0 • Published 3 years ago

gulp-typograf v4.1.0

Weekly downloads
115
License
MIT
Repository
github
Last release
3 years ago

gulp-typograf

NPM version NPM downloads

Prepare texts with Typograf using Gulp.

Install

npm install gulp-typograf --save-dev

Usage

const typograf = require('gulp-typograf');

gulp.task('typograf', function() {
    gulp.src('./src/*.html')
        .pipe(typograf({ locale: ['ru', 'en-US'] }))
        .pipe(gulp.dest('./public/'));
});

With additional options

.pipe(typograf({
    locale: ['ru', 'en-US'],
    // Type of HTML entities: 'digit' -  , 'name' -  , 'default' - UTF-8
    htmlEntity: { type: 'digit' },
    disableRule: ['ru/optalign/*'],
    enableRule: ['ru/money/ruble'],
    safeTags: [
        ['<\\?php', '\\?>'],
        ['<no-typography>', '</no-typography>']
    ],
    // Own rules
    rules: [
        {
            name: 'common/other/typographicalEmoticon',
            handler: function(text, settings) {
                return text.replace(/:-\)/, ':—)');
        },
        {
            name: 'common/other/trimLeft'
            handler: function(text, settings) {
                return text.trimLeft();
            }
        }
    ]
}))

Links

4.1.0

3 years ago

4.0.3

6 years ago

4.0.2

6 years ago

4.0.1

7 years ago

4.0.0

7 years ago

3.1.0

9 years ago

3.0.0

9 years ago

2.0.1

9 years ago

2.0.0

10 years ago

1.2.0

10 years ago

1.1.0

11 years ago

1.0.5

11 years ago

1.0.4

11 years ago

1.0.2

11 years ago

1.0.1

11 years ago

1.0.0

11 years ago