Coder Social home page Coder Social logo

broccoli-jade's Introduction

Deprecated

The project was renamed to Pug. Use broccoli-pug instead.


broccoli-jade Build Status

Compile Jade templates

Issues with the output should be reported on the Jade issue tracker.

Install

$ npm install --save-dev broccoli-jade

Usage

var jade = require('broccoli-jade');
tree = jade(tree, options);

A note about include paths

Include paths are resolved relative to the root of the tree, not to the Jade file itself. There are however workarounds to this, for example by using broccoli-static-compiler - here's an example.

API

jade(tree, [options])

options

See the Jade options.

In addition you can pass in options.data that will be used as locals for your HTML compilation.

License

MIT © Sindre Sorhus

broccoli-jade's People

Contributors

davidfou avatar fredrikekelund avatar sindresorhus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

broccoli-jade's Issues

Include paths are relative to Brocfile, not to jade file

I have a project layout like this:

Brocfile.js
app/
    index.jade
    views/
        my-file-to-include.jade
build/

When running broccoli from the root of my project, an broccoli-jade throws an error that the include path views/my-file-to-include.jade in index.jade can't be resolved. If I instead write it as app/views/my-file-to-include.jade, it's resolved. I would consider this behavior a bug, since I expect import paths to be resolved relative to the jade file, not to the Brocfile.

support for extend

Does this plugin supports auto recompilation of jade files that uses extend directive? I have following simple set of templates and Brocfile.js

app/_layout.jade

doctype html
html
  head
    meta(http-equiv='Content-Type', content='text/html; charset=utf-8')
    meta(name="viewport", content="width=device-width, initial-scale=1, maximum-scale=1")

  body
    h1 Broccoli-jade
    block content

app/index.jade

extends _layout
block content
  p This allows you to use index.static.jade instead of index.html for brunch! ...

Brocfile.js

var pickFiles = require('broccoli-static-compiler')
var processJade = require('broccoli-jade')

appFiles = pickFiles('app', {
  srcDir: '/',
  destDir: ''
})
module.exports = processJade(appFiles, {filename: 'app/_layout'})

It recompiles _layout.jade into _layout.html. However, the dependent template (index.jade) is left as it is unless broccoli is restarted.

Load included files from Broccoli input tree

Currently, this plug-in does not appear to notice included files changing to realize a rebuild is necessary. This suggests that it is not currently loading those included files from the broccoli input tree, but rather is looking past broccoli, directly to the file system. I'm not sure if this diagnosis is correct, but it does seem to explain that the problematic (and I'm pretty confident, erroneous) behavior.

I think this is also related to another open item, but I'm not 100% sure. Fix wanted.

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.