Giter Site home page Giter Site logo

grunt-zetzer's Introduction

grunt-zetzer

Grunt plugin for Zetzer. More documentation in the Zetzer repository.

After installing the module with npm, load the task with:

grunt.loadNpmTasks('grunt-zetzer');

Examples

In your project's Gruntfile, add a section named zetzer to the data object passed into grunt.initConfig().

grunt.initConfig({
  zetzer: {
    options: {
      // Task-specific options go here.
    },
    your_target: {
      // Target-specific file lists and/or options go here.
    },
  },
})

All possible options are listed in the main Zetzer project.

Grunt's rules for defining target and destination files apply, but care needs to be taken to make sure each input page maps to a single output file.

Custom Options

In this example, doT's it object is used to specify the location of script files and the main title of all pages; and the location of partials and templates is given. All pages in pages/ will be compiled to .html files in tmp.

grunt.initConfig({
  zetzer: {
    main: {
      options: {
        env: {
          title: "Zetzer",
        },
        partials: "content",
        templates: "templates"
      },
      files: [
        {
          expand: true,
          cwd: "src/pages/",
          src: "**/*.html",
          dest: "tmp",
          ext: ".html",
          flatten: true
        }
      ]
    },
  }
})

Contributing

You can run the test suite with npm test.

Each new feature ough to have full test coverage. We usually start by writing a fixture which is a pair of two files: the one to process (the fixture) and it's expected output. Fixtures are html or md files in spec/fixtures. Any partials and templates required by this fixture should be stored in spec/partials and spec/templates, respectively. The expected output of a fixture should be put in spec/expected.

Actual features should be implemented in zetzer as this is just Grunt "front-end".

grunt-zetzer's People

Contributors

elisehein avatar szymonrw avatar verdammelt avatar

Stargazers

Ke Chang avatar Adriano Cahete avatar Valery Qwertovsky avatar Ramesh avatar Xavier Valarino avatar Grégory NICOL avatar Michal Svatos avatar Michael Kühnel avatar zackn9ne avatar

Watchers

James Cloos avatar  avatar Grégory NICOL avatar

Forkers

daniellarsennz

grunt-zetzer's Issues

UTF8 Encoding

Hi so, when I was using Stencil I had a major issue with it saving all files as not UTF-8.
It obviously cause major issues with spacing and characters.
Just wondering if you have solved this issue? If not, can you please?

Ta.

Warning: Unexpected token <

Hi. I was having this same problem when using grunt-stencil, but still having it with zetzer.

I'm running node 0.10.29, grunt 0.4.5, and zetzer 2.0.0-alpha2
I keep getting this error:

Running "zetzer:build" (zetzer) task
Verifying property zetzer.build exists in config...OK
Files: src/templates/templateBody/gpv-main-tmpl.dot.html -> build/temp/templates/gpv-main-tmpl.html
Options: partials="src/templates/partials", templates="src/templates/base", env={}, dot_template_settings={}, meta_data_separator={}
Reading ./src/templates/templateBody/gpv-main-tmpl.dot.html...OK
Warning: Unexpected token < Use --force to continue.

Aborted due to warnings.

Here is my grunt setup:

zetzer: {
            build: {
              options: {
                env: {},
                partials: 'src/templates/partials',
                templates: 'src/templates/base'
              },
              files: [
                {
                  expand: true,
                  cwd: 'src/templates/templateBody/',
                  src: '**/*.html',
                  dest: 'build/temp/templates',
                  ext: '.html',
                  flatten: true
                }
              ]
            }
        },

Any help would be appreciated. I'm at a loss as to what it could be.

Thanks for your time!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.