0.2.9 • Published 10 years ago

postxml v0.2.9

Weekly downloads
6
License
MIT
Repository
github
Last release
10 years ago

Postxml

It is a tool for transforming html/xml with JS plugins based on cheerio.

Instalation

npm i postxml --save-dev

Usage

Nodejs

var postxml = require('postxml');
var cheerioOptions = {};

var output = postxml([
      require('postxml-plugin')(pluginOptions)
   ])
   .process('<div class="b-block"></div>', cheerioOptions);
);

Gulp

Use gulp-postxml

var postxml = require('gulp-postxml');
var postxmlPlugins = [
      require('postxml-plugin')(pluginOptions)
   ];
var cheerioOptions = {};

gulp.task('html', function () {
   gulp.src('index.htm')
      .pipe(postxml(postxmlPlugins, cheerioOptions))
      .pipe(gulp.dest('out'));
})

API

Process(html, cheerioOptions)

Transform html with plugins

Use(plugin)

Add plugin

Boilerplate for new plugins

Plugins

Ideas for plugins

  • postxml-inline-data - replace images and files with data uri
  • postxml-template - added template for postxml-repeat
  • postxml-lazyload - shortcut syntax for lazyload
  • postxml-prefix - add prefix to all classes
  • postxml-size - shortcut width & height
  • postxml-variables - html variables

Examples of usage postxml in real projects

0.2.9

10 years ago

0.2.7

10 years ago

0.2.6

10 years ago

0.2.5

10 years ago

0.2.4

10 years ago

0.2.3

10 years ago

0.1.3

10 years ago

0.1.1

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago