Wondering what‚Äôs next for npm?Check out our public roadmap! ¬Ľ

    gulp-typograf

    4.0.3¬†‚Äʬ†Public¬†‚Äʬ†Published

    gulp-typograf

    NPM version NPM downloads Build Status Dependency Status

    Prepare texts with Typograf using Gulp.

    Install

    npm install gulp-typograf --save-dev
    

    Usage

    'use strict';
     
    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

    Install

    npm i gulp-typograf

    DownloadsWeekly Downloads

    158

    Version

    4.0.3

    License

    MIT

    Unpacked Size

    7.89 kB

    Total Files

    7

    Last publish

    Collaborators

    • avatar