PostXML to import html files.
npm i postxml-import --save-dev
Query selector.
Type: String
Default: import[src]
Attribute that contains path.
Type: String
Default: src
Function that get value of attr and returns absolute path to file.
Type: Function
Default:
function(attr){returnattr;}<importsrc="block.htm"></import><divclass="b-block"><divclass="b-block__element"></div></div><divclass="b-block"><divclass="b-block__element"></div></div><importsrc="block.htm"><p>Content</p></import><divclass="b-block"><divclass="b-block__element"></div><content></content></div><divclass="b-block"><divclass="b-block__element"></div><p>Content</p></div><importcomponent="componentName"></import>{selector: 'import[component]',attr: 'component',path: function(componentName){return'blocks/'+componentName+'/'+componentName+'.htm'}}<imgsrc="image.svg">{selector: 'img[src$=".svg"]',path: function(src){return'cwd/'+src}}<svgwidth="100" height="100"><circlecx="50" cy="50" r="40" stroke="green" stroke-width="4" fill="yellow" /></svg>MIT