Git Product home page Git Product logo

twitter-bootstrap-node's Introduction

twitter-bootstrap-node

Twitter Bootstrap for Node.js(now only support express template)

This tool can build template that support 'Twitter Bootstrap'

Installation

$ npm install -g twitter-bootstrap-node

Quick Start

Create the project: (Default css engine is "less",And template engine is "jade")

$ twitter-bootstrap project
$ cd project
$ npm install
$ node app.js

command screen shot

Change template engine:

$ twitter-bootstrap -t ejs project

Future

  • build template(not only supported express template)
  • bootstrap's image files copy to "public/images/bootstrap/"
  • CSS(bootstrap.css or bootstrap.min.css) is dynamically built using "Less"

What should add "bootstrap.css/bootstrap.min.css" where?

bootstrap.css(bootstrap.min.css) is as 'public/stylesheets/style.css' that already added views/layout.jade(layout.ejs)

// public/stylesheets/style.css
@import "bootstrap.less";
// Padding for fixed-navbar
body {
padding-top: 60px;
padding-bottom: 40px;
}
@import "responsive.less";
@iconSpritePath: "/images/bootstrap/glyphicons-halflings.png";
@iconWhiteSpritePath:     "/images/bootstrap/glyphicons-halflings-white.png";

Based Application

Express (bin/express)

https://github.com/visionmedia/express

Copyright (c) 2009-2011 TJ Holowaychuk <[email protected]>

License

(The MIT License)

Copyright (c) 2012 Shinya Takimoto <[email protected]>

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

twitter-bootstrap-node's People

Contributors

takimo avatar tamanyan avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

twitter-bootstrap-node's Issues

wiring it into express

I have installed and added twitter-bootstrap-node and less-middleware.

Here is what I added to app.configure

app.use(require('less-middleware')({ src: __dirname + '/public' }));

I also have verified that less is compiling correctly.

How though do I wire it into layout?

doctype 5
html
    head
        title= title

        // How do I link to bootstrap files?
        link(rel='stylesheet', href='/css/bootstrap/bootstrap.min.css')
        link(rel='stylesheet', href='/stylesheets/style.css')           

500 error after installed

I got 500 error code and following error infos

500 Error: /var/www/site/myblog/views/layout.jade:1 > 1| !!! 2| html 3| head 4| title= title !!! is deprecated, you must now use doctype

1| !!!
2| html
3| head
4| title= title
!!! is deprecated, you must now use doctype
at Object.Lexer.doctype (/var/www/site/myblog/node_modules/jade/lib/lexer.js:249:13)
at Object.Lexer.next (/var/www/site/myblog/node_modules/jade/lib/lexer.js:846:15)
at Object.Lexer.lookahead (/var/www/site/myblog/node_modules/jade/lib/lexer.js:114:46)
at Parser.lookahead (/var/www/site/myblog/node_modules/jade/lib/parser.js:100:23)
at Parser.peek (/var/www/site/myblog/node_modules/jade/lib/parser.js:77:17)
at Parser.parse (/var/www/site/myblog/node_modules/jade/lib/parser.js:115:26)
at parse (/var/www/site/myblog/node_modules/jade/lib/jade.js:95:62)
at Object.exports.compile (/var/www/site/myblog/node_modules/jade/lib/jade.js:154:9)
at Function.exports.compile (/var/www/site/myblog/node_modules/express/lib/view.js:68:33)
at ServerResponse.res._render (/var/www/site/myblog/node_modules/express/lib/view.js:417:18)

I only install it, and run it, and then I get this error.

BTW, how can I uninstall? just remove the code from my project?

Thanks.

TypeError: Cannot call method 'toCSS' of undefined

Hi, I have just created and run a new project by calling node app.js.
After I go to the site, it only return a page without CSS.
And the node process on the server is stop and shows

/home/ubuntu/new/app.js:38
    parser.parse(str, function(err, root){fn(err, root.toCSS());});
                                                       ^
TypeError: Cannot call method 'toCSS' of undefined
    at /home/ubuntu/new/app.js:38:56
    at Object.finish [as _finish] (/home/ubuntu/new/node_modules/less/lib/less/parser.js:475:21)
    at Object.subFinish [as _finish] (/home/ubuntu/new/node_modules/less/lib/less/import-visitor.js:56:47)
    at Object.subFinish [as _finish] (/home/ubuntu/new/node_modules/less/lib/less/import-visitor.js:56:47)
    at Object.tree.importVisitor.run (/home/ubuntu/new/node_modules/less/lib/less/import-visitor.js:25:22)
    at /home/ubuntu/new/node_modules/less/lib/less/import-visitor.js:63:34
    at /home/ubuntu/new/node_modules/less/lib/less/parser.js:97:17
    at /home/ubuntu/new/node_modules/less/lib/less/index.js:141:13
    at finish (/home/ubuntu/new/node_modules/less/lib/less/parser.js:478:21)
    at Object.Parser.parser.parse (/home/ubuntu/new/node_modules/less/lib/less/parser.js:486:17)

toCSS undefined?

Hi there, first of all I'm running node.js on windows.

I've installed twitter-bootstrap from npmjs.org with

npm install twitter-bootstrap-node

and I've run it using

$ twitter-bootstrap project
$ cd project
$ npm install
$ node app.js

When I try to open the site on my browser i get the error;

H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap>node app.js
Express server listening on port 3000 in development mode

H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\app.js:38
    parser.parse(str, function(err, root){fn(err, root.toCSS());});
                                                       ^
TypeError: Cannot call method 'toCSS' of undefined
    at H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\app.js:38:56
    at Object.finish [as _finish] (H:\Coding\cointurk.net\tests\bootstrap\twitte
r-bootstrap\node_modules\less\lib\less\parser.js:538:28)
    at Object.subFinish [as _finish] (H:\Coding\cointurk.net\tests\bootstrap\twi
tter-bootstrap\node_modules\less\lib\less\import-visitor.js:63:47)
    at Object.subFinish [as _finish] (H:\Coding\cointurk.net\tests\bootstrap\twi
tter-bootstrap\node_modules\less\lib\less\import-visitor.js:63:47)
    at Object.tree.importVisitor.run (H:\Coding\cointurk.net\tests\bootstrap\twi
tter-bootstrap\node_modules\less\lib\less\import-visitor.js:25:22)
    at H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\node_modules\les
s\lib\less\import-visitor.js:72:38
    at fileParsedFunc (H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\
node_modules\less\lib\less\parser.js:80:17)
    at H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\node_modules\les
s\lib\less\parser.js:103:29
    at finish (H:\Coding\cointurk.net\tests\bootstrap\twitter-bootstrap\node_mod
ules\less\lib\less\parser.js:541:28)
    at Object.Parser.parser.parse (H:\Coding\cointurk.net\tests\bootstrap\twitte
r-bootstrap\node_modules\less\lib\less\parser.js:549:24)

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.