Create new PostHTML plugins
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 6 commits ahead of jonathantneal:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.editorconfig
.gitignore
.mversion
.npmignore
.travis.yml
CHANGELOG.md
CONTRIBUTING.md
LICENSE
README.md
package.json

README.md

PostHTML Plugin Boilerplate

NPM Deps Build Coverage Standard Code Style Chat

Clone this repo and explain what your plugin do and why thousands of people need it ;)

Before:

<html>
  <body>
    <p class="wow">OMG</p>
  </body>
</html>

After:

<svg xmlns="http://www.w3.org/2000/svg">
  <text class="wow" id="wow_id" fill="#4A83B4" fill-rule="evenodd" font-family="Verdana">
    OMG
  </text>
</svg>

Install

Describe how big guys can install your plugin.

npm i posthtml posthtml-plugin

Usage

Describe how people can use this plugin. Include info about build systems if it's necessary.

const fs = require('fs');
const posthtml = require('posthtml');
const posthtmlPlugin = require('posthtml-plugin');

posthtml()
    .use(posthtmlPlugin({ /* options */ }))
    .process(html/*, options */)
    .then(result => fs.writeFileSync('./after.html', result.html));

Options

Describe all features of your plugin with examples of usage.

Feature

Before:

<html>
  <body>
    <p>OMG</p>
  </body>
</html>

Add option:

const fs = require('fs');
const posthtml = require('posthtml');
const posthtmlPlugin = require('posthtml-plugin');

posthtml()
    .use(posthtmlPlugin({ feature: 'wow' }))
    .process(html/*, options */)
    .then(result => fs.writeFileSync('./after.html', result.html));

After:

<html>
  <body>
    <p class="wow">OMG</p>
  </body>
</html>

Contributing

See PostHTML Guidelines and contribution guide.

License MIT