trucks-generator-page

Inject output files into HTML templates

Usage no npm install needed!

<script type="module">
  import trucksGeneratorPage from 'https://cdn.skypack.dev/trucks-generator-page';
</script>

README

Page Transform

Inject output files into HTML templates

Install

npm i trucks-transform-page --save-dev

For the command line interface see trucks-cli.



Usage

Use the page key to configure this transform:

const trucks = require('trucks-compiler');

trucks(
  {
    files: ['components.html'],
    transforms: ['page'],
    page: {
      files: {
        'template.html': 'index.html'
      }
    }
  }, (err, state) => {
    if(err) {
      throw err; 
    }
    console.log(state);
  }
);

API

page

public page(state, conf)

Replace processing instructions in input files with markup.

Returns map of visitor functions.

  • state Object compiler state.
  • conf Object transform plugin configuration.

Options

  • files Array list of files to process.

License

MIT


Created by mkdoc on August 3, 2016