fis-parser-include-html

0.0.4 • Public • Published

fis-parser-include-html

a parser plugin for fis to compile html file 在 parser 阶段,解析自行定义include语法

usage

支持格式

<!--{include file="../../common/nav.html"}-->
<!--{include file="../../common/nav.html"/}-->
<!--{include "../../common/nav.html"}-->
<!--{include ../../common/nav.html}-->
<!--{include common/nav.html}-->
<!--{include file="common/nav.html"}-->
...

install

npm install fis-parser-include-html

use

  fis.match('**.html', {
    rExt: '.html',
    parser: fis.plugin('include-html', {
      root: ["src/html/", "src/"], // 引用文件的目录前缀
      start: "#{", // 引用开始标记
      end: "/}" // 引用结束标记
    })
  });

Package Sidebar

Install

npm i fis-parser-include-html

Weekly Downloads

1

Version

0.0.4

License

MIT

Last publish

Collaborators

  • maxming2333