0.0.2 • Published 8 years ago

fis-parser-velocity-cms v0.0.2

Weekly downloads
4
License
MIT
Repository
-
Last release
8 years ago

fis-parser-html-ejs

a parser plugin for fis to compile html file with ejs

usage

  1. install

    npm install -g fis-parser-html-ejs
  2. configure

    //tell fis that parse `.html` file by using `fis-parser-html-ejs` plugin
    fis.config.set('modules.parser.html', 'html-ejs');
  3. inline html file

    • source:

      /**********************************
       * index.html content:
       **********************************
       <ul>
          <script type="text/ejs" data-json="config/data.json">
              <%
                  for(var i=0;i<list.length;i++){
                      %><li><img src="<%=list[i]%>" /></li><%
                  }
              %>
          </script>
       </ul>
       **********************************/
      /**********************************
       * src/config/data.json content:
       **********************************
       {
          "list":["img/1.jpg","img/2.jpg"]
       }
      **********************************/
    • release:

      /**********************************
       * index.html content:
       **********************************
       <ul>
          <li><img src="img/1.jpg" /></li>
          <li><img src="img/2.jpg" /></li>
       </ul>
       **********************************/
0.0.2

8 years ago

0.0.1

8 years ago