node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org ยป



A broccoli plugin for splitting text into new files.

Sample usage

Following configuration reads parts of index.html from inside and ember-cli app directory and creates two PHP files out if it:

var splitHtmlToPHP = brocSplitter(
            'input': 'index.html'
            'from': '<!-- split: Header begin -->',
            'to': '<!-- split: Header end -->',
            'output': 'header.php'
            'input': 'index.html'
            'from': '<!-- split: Body begin -->',
            'to': '<!-- split: Body end -->',
            'output': 'body.php'

when index.html looks like following:

<!DOCTYPE html>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- split: Header begin -->

    {{content-for 'head'}}

    <link rel="stylesheet" href="assets/vendor.css">
    <link rel="stylesheet" href="assets/main.css">

    {{content-for 'head-footer'}}

    <!-- split: Header end -->
    <!-- split: Body begin -->

    {{content-for 'body'}}

    <script src="assets/vendor.js"></script>
    <script src="assets/main.js"></script>

    {{content-for 'body-footer'}}

    <!-- split: Body end -->