grunt-swig icon indicating copy to clipboard operation
grunt-swig copied to clipboard

Customize grunt-swig with additional tags.

Open colthreepv opened this issue 10 years ago • 3 comments

I hope to have make this as customizable as possible.

What you can achieve is:

Have a project called XYZ that requires grunt-swig AND swig-sometag (as siblings).
XYZ\Gruntfile.js:

grunt.initConfig({
  swig: {
    documentation: {
      dest: 'test/dest',
      src: ['**/*.swig', '!templates/*.swig'],
      tags: {
        sometag: require('swig-sometag')
      }
    }
  }
});

Or you could use a custom swig-tag made by yourself! Just using:

grunt.initConfig({
  swig: {
    documentation: {
      dest: 'test/dest',
      src: ['**/*.swig', '!templates/*.swig'],
      tags: {
        personal: require('./my-personal-tag')
      }
    }
  }
});

colthreepv avatar Mar 21 '14 12:03 colthreepv

Added another commit, this is a refactor, and now the PR also supports swig-extras and swig-extensions

I even added a test using swig-extras, putting it as a dependency in the dev-dependencies, i hope this is not a problem

colthreepv avatar Mar 24 '14 10:03 colthreepv

This looks awesome.

I've been neglecting this package b/c I don't use it any more. I'll try to spend a few hours and get everything updated and push out a shiny new release.

rtgibbons avatar May 21 '14 14:05 rtgibbons

Curious how this would work along side #24

rtgibbons avatar May 21 '14 14:05 rtgibbons