posthtml-block
PostHTML plugin that to create block element (like a component)
Install
npm install posthtml-block
Usage
Create .html file.
example content 1 example content 2
Transform it.
const fs = ;const posthtml = ;const block = ;const pretty = ; const html = fs; ;
Output like this.
title 1 example content 1 1 1 1 title 2 example content 2 2 2 2
Attributes
block-name
Set block name.
block-tag
Change tag after transformed. default by div
.
block-text
That element set text. (like element.innerText
)
block-content
That element set html. (like element.innerHTML
)
block-attr-*
That selement set *
. if not defined *
, then set ''
Run to example
1 Close this repository
git clone git@github.com:totora0155/posthtml-block.git
2 Change current directory
cd posthtml-block
3 Install modules
npm install
4 Run script
cd examples && node posthtml.js
ChangeLog
version | log |
---|---|
1.0.1 | Add attr to block-attr-* |
1.0.0 | Rewrite with es2015 & Implemented block-* attrs |