docpad-plugin-combiner

A Docpad plugin that adds the ability to combine parts to create a final master file

npm install docpad-plugin-combiner
32 downloads in the last month

Combiner Plugin for DocPad

Build Status NPM version Dependency Status Gittip donate button Bitdeli Badge

Convention:

Join file parts together of any type. Can be any file type. Can be mixed with layouts too

Example:

  • test.js
    ---
    combine: true
    outPath: scripts/myScript.js
    write: false # prevents "Rename one of them to avoid an over-write" message
    ---
    function foo(){}
  • anothTest.js.coffee
    ---
    combine: true
    outPath: scripts/myScript.js
    write: false # prevents "Rename one of them to avoid an over-write" message
    ---
    ### coffeescript ###
    bar ->
  • out: scripts/myScript.js:

      function foo(){}
    
      /* coffeescript
      */
    
      bar(function() {});
    

Install

npm install --save docpad-plugin-combiner

Configure

combiner:
    # default collection name
    collectionName: "combineOut"
    # default sort comparator
    comparator: [filename: 1]

For more info on the sort comparator see Query Engine Guide

License

Licensed under the incredibly permissive MIT License
Copyright © 2013+ [Stringz Solutions Ltd]
Copyright © 2013+ Peter Flannery

npm loves you