bowtie-js

0.0.15 • Public • Published

Bowtie

Build Status Coverage Status

Expressive template engine for Node.js heavily inspired by Jade.

Goals

This project aims to develop an expressive template language to write html documents using the dry and kiss principles. And of course, remove the pain of writing angle brackets.

Current status

This project is currently in it's pre-alpha stage. Current features:

  • Basic html output
  • Loops
  • If-Else
  • Mixins
  • Extending
  • Importing
  • Variables

Installation

$ npm install bowtie-js
Syntax highlighting

Syntax highlighting and auto completion is available for Atom editor. Syntax highlighting is triggered on .bow-files.

Install:

$ apm install atom-language-bowtie

Usage

With Gulp

Gulp compatible compiling comes out of the box with Bowtie, example:

var gulp = require('gulp');
var bowtie = require('bowtie-js').gulp;
 
gulp.task('bowtie', function() {
  return gulp.src('*.bow')
    .pipe(bowtie({
      // Pretty output
      "pretty": true,
      // Object to pass to template engine
      "locals": {
        "title": "Example application"
      }
    }))
    .pipe(gulp.dest('./dist'));
});

Example

!doctype("html")
html {
  head {
    title: $title
  }
  body {
    div.className {
      h1: "Example"
      p: "Hello world!"
    }
  }
}

The example above outputs:

<html>
    <head>
        <title>Example application</title>
    </head>
    <body>
        <div class="className">
            <h1>Example</h1>
            <p>Hello world!</p>
        </div>
    </body>
</html>
 

License

The MIT License

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.150latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.150
0.0.140
0.0.130
0.0.120
0.0.110
0.0.100
0.0.90
0.0.80
0.0.70
0.0.60
0.0.50
0.0.40
0.0.30
0.0.21
0.0.10

Package Sidebar

Install

npm i bowtie-js

Weekly Downloads

1

Version

0.0.15

License

MIT

Last publish

Collaborators

  • victorzki