sass-twitter-bootstrap 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.gitignore +4 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +14 -0
- data/LICENSE +176 -0
- data/Makefile +94 -0
- data/README.md +217 -0
- data/Rakefile +52 -0
- data/bootstrap-2.0.4.css +4661 -0
- data/bootstrap-2.0.4.min.css +9 -0
- data/bootstrap-responsive-2.0.4.css +932 -0
- data/bootstrap-responsive-2.0.4.min.css +9 -0
- data/docs/assets/css/bootstrap-responsive.css +932 -0
- data/docs/assets/css/bootstrap.css +4661 -0
- data/docs/assets/css/docs.css +846 -0
- data/docs/assets/ico/apple-touch-icon-114-precomposed.png +0 -0
- data/docs/assets/ico/apple-touch-icon-144-precomposed.png +0 -0
- data/docs/assets/ico/apple-touch-icon-57-precomposed.png +0 -0
- data/docs/assets/ico/apple-touch-icon-72-precomposed.png +0 -0
- data/docs/assets/ico/favicon.ico +0 -0
- data/docs/assets/img/bird.png +0 -0
- data/docs/assets/img/bootstrap-mdo-sfmoma-01.jpg +0 -0
- data/docs/assets/img/bootstrap-mdo-sfmoma-02.jpg +0 -0
- data/docs/assets/img/bootstrap-mdo-sfmoma-03.jpg +0 -0
- data/docs/assets/img/browsers.png +0 -0
- data/docs/assets/img/example-sites/fleetio.png +0 -0
- data/docs/assets/img/example-sites/jshint.png +0 -0
- data/docs/assets/img/example-sites/kippt.png +0 -0
- data/docs/assets/img/example-sites/soundready.png +0 -0
- data/docs/assets/img/examples/bootstrap-example-fluid.jpg +0 -0
- data/docs/assets/img/examples/bootstrap-example-hero.jpg +0 -0
- data/docs/assets/img/examples/bootstrap-example-starter.jpg +0 -0
- data/docs/assets/img/github-16px.png +0 -0
- data/docs/assets/img/glyphicons-halflings-white.png +0 -0
- data/docs/assets/img/glyphicons-halflings.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_009_magic.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_042_group.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_079_podium.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_082_roundabout.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_155_show_thumbnails.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_163_iphone.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_214_resize_small.png +0 -0
- data/docs/assets/img/glyphicons/glyphicons_266_book_open.png +0 -0
- data/docs/assets/img/grid-18px-masked.png +0 -0
- data/docs/assets/img/icon-css3.png +0 -0
- data/docs/assets/img/icon-github.png +0 -0
- data/docs/assets/img/icon-html5.png +0 -0
- data/docs/assets/img/icon-twitter.png +0 -0
- data/docs/assets/img/less-logo-large.png +0 -0
- data/docs/assets/img/less-small.png +0 -0
- data/docs/assets/img/responsive-illustrations.png +0 -0
- data/docs/assets/js/README.md +106 -0
- data/docs/assets/js/application.js +184 -0
- data/docs/assets/js/bootstrap-alert.js +90 -0
- data/docs/assets/js/bootstrap-button.js +96 -0
- data/docs/assets/js/bootstrap-carousel.js +169 -0
- data/docs/assets/js/bootstrap-collapse.js +157 -0
- data/docs/assets/js/bootstrap-dropdown.js +100 -0
- data/docs/assets/js/bootstrap-modal.js +218 -0
- data/docs/assets/js/bootstrap-popover.js +98 -0
- data/docs/assets/js/bootstrap-scrollspy.js +151 -0
- data/docs/assets/js/bootstrap-tab.js +135 -0
- data/docs/assets/js/bootstrap-tooltip.js +275 -0
- data/docs/assets/js/bootstrap-transition.js +61 -0
- data/docs/assets/js/bootstrap-typeahead.js +285 -0
- data/docs/assets/js/bootstrap.js +1825 -0
- data/docs/assets/js/bootstrap.min.js +6 -0
- data/docs/assets/js/google-code-prettify/prettify.css +30 -0
- data/docs/assets/js/google-code-prettify/prettify.js +28 -0
- data/docs/assets/js/jquery.js +9252 -0
- data/docs/base-css.html +1710 -0
- data/docs/build/index.js +44 -0
- data/docs/build/node_modules/.bin/hulk +93 -0
- data/docs/build/node_modules/hogan.js/.git_ignore +1 -0
- data/docs/build/node_modules/hogan.js/.gitmodules +3 -0
- data/docs/build/node_modules/hogan.js/LICENSE +177 -0
- data/docs/build/node_modules/hogan.js/Makefile +62 -0
- data/docs/build/node_modules/hogan.js/README.md +93 -0
- data/docs/build/node_modules/hogan.js/bin/hulk +93 -0
- data/docs/build/node_modules/hogan.js/lib/compiler.js +348 -0
- data/docs/build/node_modules/hogan.js/lib/hogan.js +20 -0
- data/docs/build/node_modules/hogan.js/lib/template.js +233 -0
- data/docs/build/node_modules/hogan.js/package.json +20 -0
- data/docs/build/node_modules/hogan.js/test/html/list.html +8 -0
- data/docs/build/node_modules/hogan.js/test/index.html +13 -0
- data/docs/build/node_modules/hogan.js/test/index.js +848 -0
- data/docs/build/node_modules/hogan.js/test/mustache.js +90 -0
- data/docs/build/node_modules/hogan.js/test/spec.js +77 -0
- data/docs/build/node_modules/hogan.js/test/spec/Changes +31 -0
- data/docs/build/node_modules/hogan.js/test/spec/README.md +65 -0
- data/docs/build/node_modules/hogan.js/test/spec/Rakefile +27 -0
- data/docs/build/node_modules/hogan.js/test/spec/TESTING.md +46 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/comments.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/comments.yml +103 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/delimiters.yml +158 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/interpolation.yml +230 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/inverted.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/inverted.yml +193 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/partials.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/partials.yml +109 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/sections.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/sections.yml +256 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.json +1 -0
- data/docs/build/node_modules/hogan.js/test/spec/specs/~lambdas.yml +149 -0
- data/docs/build/node_modules/hogan.js/test/templates/list.mustache +8 -0
- data/docs/build/node_modules/hogan.js/tools/release.js +74 -0
- data/docs/build/node_modules/hogan.js/tools/web_templates.js +32 -0
- data/docs/build/node_modules/hogan.js/web/1.0.0/hogan.js +500 -0
- data/docs/build/node_modules/hogan.js/web/1.0.0/hogan.min.js +14 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.js +500 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.0/hogan.min.js +14 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.js +545 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.3/hogan.min.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.amd.js +576 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.common.js +576 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.js +572 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.amd.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.common.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.min.mustache.js +5 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/hogan-1.0.5.mustache.js +619 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.js +233 -0
- data/docs/build/node_modules/hogan.js/web/builds/1.0.5/template-1.0.5.min.js +5 -0
- data/docs/build/node_modules/hogan.js/web/favicon.ico +0 -0
- data/docs/build/node_modules/hogan.js/web/images/logo.png +0 -0
- data/docs/build/node_modules/hogan.js/web/images/noise.png +0 -0
- data/docs/build/node_modules/hogan.js/web/images/small-hogan-icon.png +0 -0
- data/docs/build/node_modules/hogan.js/web/images/stripes.png +0 -0
- data/docs/build/node_modules/hogan.js/web/index.html.mustache +139 -0
- data/docs/build/node_modules/hogan.js/web/stylesheets/layout.css +206 -0
- data/docs/build/node_modules/hogan.js/web/stylesheets/skeleton.css +236 -0
- data/docs/build/node_modules/hogan.js/wrappers/amd.js.mustache +21 -0
- data/docs/build/node_modules/hogan.js/wrappers/common.js.mustache +21 -0
- data/docs/build/node_modules/hogan.js/wrappers/js.mustache +17 -0
- data/docs/build/node_modules/hogan.js/wrappers/mustache.js.mustache +64 -0
- data/docs/build/package.json +6 -0
- data/docs/components.html +1931 -0
- data/docs/download.html +454 -0
- data/docs/examples.html +147 -0
- data/docs/examples/fluid.html +162 -0
- data/docs/examples/hero.html +109 -0
- data/docs/examples/starter-template.html +79 -0
- data/docs/index.html +259 -0
- data/docs/javascript.html +1520 -0
- data/docs/less.html +1060 -0
- data/docs/scaffolding.html +671 -0
- data/docs/templates/layout.mustache +146 -0
- data/docs/templates/pages/base-css.mustache +1594 -0
- data/docs/templates/pages/components.mustache +1815 -0
- data/docs/templates/pages/download.mustache +338 -0
- data/docs/templates/pages/examples.mustache +31 -0
- data/docs/templates/pages/index.mustache +144 -0
- data/docs/templates/pages/javascript.mustache +1405 -0
- data/docs/templates/pages/less.mustache +944 -0
- data/docs/templates/pages/scaffolding.mustache +555 -0
- data/docs/templates/pages/upgrading.mustache +194 -0
- data/docs/upgrading.html +310 -0
- data/js/tests/index.html +54 -0
- data/js/tests/phantom.js +63 -0
- data/js/tests/server.js +14 -0
- data/js/tests/unit/bootstrap-alert.js +56 -0
- data/js/tests/unit/bootstrap-button.js +77 -0
- data/js/tests/unit/bootstrap-carousel.js +28 -0
- data/js/tests/unit/bootstrap-collapse.js +54 -0
- data/js/tests/unit/bootstrap-dropdown.js +87 -0
- data/js/tests/unit/bootstrap-modal.js +114 -0
- data/js/tests/unit/bootstrap-phantom.js +21 -0
- data/js/tests/unit/bootstrap-popover.js +93 -0
- data/js/tests/unit/bootstrap-scrollspy.js +31 -0
- data/js/tests/unit/bootstrap-tab.js +61 -0
- data/js/tests/unit/bootstrap-tooltip.js +155 -0
- data/js/tests/unit/bootstrap-transition.js +13 -0
- data/js/tests/unit/bootstrap-typeahead.js +148 -0
- data/js/tests/vendor/jquery.js +9252 -0
- data/js/tests/vendor/qunit.css +232 -0
- data/js/tests/vendor/qunit.js +1510 -0
- data/lib/sass-twitter-bootstrap.rb +9 -0
- data/lib/sass/twitter/bootstrap/rails.rb +14 -0
- data/lib/sass/twitter/bootstrap/version.rb +7 -0
- data/package.json +25 -0
- data/sass-twitter-bootstrap.gemspec +19 -0
- data/vendor/assets/images/glyphicons-halflings-white.png +0 -0
- data/vendor/assets/images/glyphicons-halflings.png +0 -0
- data/vendor/assets/javascripts/README.md +112 -0
- data/vendor/assets/javascripts/twitter/bootstrap-alert.js +90 -0
- data/vendor/assets/javascripts/twitter/bootstrap-button.js +96 -0
- data/vendor/assets/javascripts/twitter/bootstrap-carousel.js +169 -0
- data/vendor/assets/javascripts/twitter/bootstrap-collapse.js +157 -0
- data/vendor/assets/javascripts/twitter/bootstrap-dropdown.js +100 -0
- data/vendor/assets/javascripts/twitter/bootstrap-modal.js +218 -0
- data/vendor/assets/javascripts/twitter/bootstrap-popover.js +98 -0
- data/vendor/assets/javascripts/twitter/bootstrap-scrollspy.js +151 -0
- data/vendor/assets/javascripts/twitter/bootstrap-tab.js +135 -0
- data/vendor/assets/javascripts/twitter/bootstrap-tooltip.js +275 -0
- data/vendor/assets/javascripts/twitter/bootstrap-transition.js +61 -0
- data/vendor/assets/javascripts/twitter/bootstrap-typeahead.js +285 -0
- data/vendor/assets/javascripts/twitter/bootstrap.js +12 -0
- data/vendor/assets/stylesheets/tests/css-tests.css +52 -0
- data/vendor/assets/stylesheets/tests/css-tests.html +917 -0
- data/vendor/assets/stylesheets/tests/forms.html +179 -0
- data/vendor/assets/stylesheets/tests/navbar.html +108 -0
- data/vendor/assets/stylesheets/twitter/_accordion.scss +33 -0
- data/vendor/assets/stylesheets/twitter/_alerts.scss +58 -0
- data/vendor/assets/stylesheets/twitter/_breadcrumbs.scss +24 -0
- data/vendor/assets/stylesheets/twitter/_button-groups.scss +191 -0
- data/vendor/assets/stylesheets/twitter/_buttons.scss +191 -0
- data/vendor/assets/stylesheets/twitter/_carousel.scss +121 -0
- data/vendor/assets/stylesheets/twitter/_close.scss +29 -0
- data/vendor/assets/stylesheets/twitter/_code.scss +57 -0
- data/vendor/assets/stylesheets/twitter/_component-animations.scss +20 -0
- data/vendor/assets/stylesheets/twitter/_dropdowns.scss +143 -0
- data/vendor/assets/stylesheets/twitter/_forms.scss +582 -0
- data/vendor/assets/stylesheets/twitter/_grid.scss +5 -0
- data/vendor/assets/stylesheets/twitter/_hero-unit.scss +22 -0
- data/vendor/assets/stylesheets/twitter/_labels-badges.scss +52 -0
- data/vendor/assets/stylesheets/twitter/_layouts.scss +17 -0
- data/vendor/assets/stylesheets/twitter/_mixins.scss +643 -0
- data/vendor/assets/stylesheets/twitter/_modals.scss +90 -0
- data/vendor/assets/stylesheets/twitter/_navbar.scss +358 -0
- data/vendor/assets/stylesheets/twitter/_navs.scss +363 -0
- data/vendor/assets/stylesheets/twitter/_pager.scss +36 -0
- data/vendor/assets/stylesheets/twitter/_pagination.scss +56 -0
- data/vendor/assets/stylesheets/twitter/_popovers.scss +49 -0
- data/vendor/assets/stylesheets/twitter/_progress-bars.scss +117 -0
- data/vendor/assets/stylesheets/twitter/_reset.scss +131 -0
- data/vendor/assets/stylesheets/twitter/_responsive-1200px-min.scss +26 -0
- data/vendor/assets/stylesheets/twitter/_responsive-767px-max.scss +149 -0
- data/vendor/assets/stylesheets/twitter/_responsive-768px-979px.scss +17 -0
- data/vendor/assets/stylesheets/twitter/_responsive-navbar.scss +153 -0
- data/vendor/assets/stylesheets/twitter/_responsive-utilities.scss +41 -0
- data/vendor/assets/stylesheets/twitter/_scaffolding.scss +29 -0
- data/vendor/assets/stylesheets/twitter/_sprites.scss +191 -0
- data/vendor/assets/stylesheets/twitter/_tables.scss +155 -0
- data/vendor/assets/stylesheets/twitter/_thumbnails.scss +47 -0
- data/vendor/assets/stylesheets/twitter/_tooltip.scss +35 -0
- data/vendor/assets/stylesheets/twitter/_type.scss +232 -0
- data/vendor/assets/stylesheets/twitter/_utilities.scss +23 -0
- data/vendor/assets/stylesheets/twitter/_variables.scss +204 -0
- data/vendor/assets/stylesheets/twitter/_wells.scss +27 -0
- data/vendor/assets/stylesheets/twitter/bootstrap.scss +62 -0
- data/vendor/assets/stylesheets/twitter/responsive.scss +48 -0
- metadata +304 -0
data/docs/build/index.js
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
var hogan = require('hogan.js')
|
3
|
+
, fs = require('fs')
|
4
|
+
, prod = process.argv[2] == 'production'
|
5
|
+
, title = 'Twitter Bootstrap'
|
6
|
+
|
7
|
+
var layout, pages
|
8
|
+
|
9
|
+
// compile layout template
|
10
|
+
layout = fs.readFileSync(__dirname + '/../templates/layout.mustache', 'utf-8')
|
11
|
+
layout = hogan.compile(layout, { sectionTags: [{o:'_i', c:'i'}] })
|
12
|
+
|
13
|
+
// retrieve pages
|
14
|
+
pages = fs.readdirSync(__dirname + '/../templates/pages')
|
15
|
+
|
16
|
+
// iterate over pages
|
17
|
+
pages.forEach(function (name) {
|
18
|
+
|
19
|
+
if (!name.match(/\.mustache$/)) return
|
20
|
+
|
21
|
+
var page = fs.readFileSync(__dirname + '/../templates/pages/' + name, 'utf-8')
|
22
|
+
, context = {}
|
23
|
+
|
24
|
+
context[name.replace(/\.mustache$/, '')] = 'active'
|
25
|
+
context._i = true
|
26
|
+
context.production = prod
|
27
|
+
context.title = name
|
28
|
+
.replace(/\.mustache/, '')
|
29
|
+
.replace(/\-.*/, '')
|
30
|
+
.replace(/(.)/, function ($1) { return $1.toUpperCase() })
|
31
|
+
|
32
|
+
if (context.title == 'Index') {
|
33
|
+
context.title = title
|
34
|
+
} else {
|
35
|
+
context.title += ' · ' + title
|
36
|
+
}
|
37
|
+
|
38
|
+
page = hogan.compile(page, { sectionTags: [{o:'_i', c:'i'}] })
|
39
|
+
page = layout.render(context, {
|
40
|
+
body: page
|
41
|
+
})
|
42
|
+
|
43
|
+
fs.writeFileSync(__dirname + '/../' + name.replace(/mustache$/, 'html'), page, 'utf-8')
|
44
|
+
})
|
@@ -0,0 +1,93 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
/*
|
4
|
+
* Copyright 2011 Twitter, Inc.
|
5
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
6
|
+
* you may not use this file except in compliance with the License.
|
7
|
+
* You may obtain a copy of the License at
|
8
|
+
*
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
10
|
+
*
|
11
|
+
* Unless required by applicable law or agreed to in writing, software
|
12
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
13
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
14
|
+
* See the License for the specific language governing permissions and
|
15
|
+
* limitations under the License.
|
16
|
+
*/
|
17
|
+
|
18
|
+
var hogan = require('../lib/hogan.js'),
|
19
|
+
path = require('path'),
|
20
|
+
fs = require('fs');
|
21
|
+
|
22
|
+
var specials = ['/', '.', '*', '+', '?', '|','(', ')', '[', ']', '{', '}', '\\'],
|
23
|
+
specialsRegExp = new RegExp('(\\' + specials.join('|\\') + ')', 'g'),
|
24
|
+
templates;
|
25
|
+
|
26
|
+
|
27
|
+
// Escape special regexp characters
|
28
|
+
function esc(text) {
|
29
|
+
return text.replace(specialsRegExp, '\\$1');
|
30
|
+
}
|
31
|
+
|
32
|
+
|
33
|
+
// Check for dirs and correct ext (<3 for windows)
|
34
|
+
function extractFiles(args) {
|
35
|
+
var usage = 'USAGE: hulk ./templates/*.mustaches\n' +
|
36
|
+
'NOTE: hulk supports the "*" wildcard and allows you to target specific extensions too',
|
37
|
+
files = [];
|
38
|
+
|
39
|
+
if (!args.length) {
|
40
|
+
console.log(usage);
|
41
|
+
process.exit(-1);
|
42
|
+
}
|
43
|
+
|
44
|
+
args.forEach(function (arg) {
|
45
|
+
|
46
|
+
if (/\*/.test(arg)) {
|
47
|
+
arg = arg.split('*');
|
48
|
+
return files = files.concat(
|
49
|
+
fs.readdirSync(arg[0] || '.')
|
50
|
+
.map(function (f) {
|
51
|
+
return new RegExp(esc(arg[1]) + '$').test(f) && path.join(arg[0], f);
|
52
|
+
})
|
53
|
+
.filter(function (f) {
|
54
|
+
return f;
|
55
|
+
})
|
56
|
+
);
|
57
|
+
}
|
58
|
+
|
59
|
+
files.push(arg);
|
60
|
+
|
61
|
+
})
|
62
|
+
|
63
|
+
return files;
|
64
|
+
}
|
65
|
+
|
66
|
+
|
67
|
+
// Remove utf-8 byte order mark, http://en.wikipedia.org/wiki/Byte_order_mark
|
68
|
+
function removeByteOrderMark(text) {
|
69
|
+
if (text.charCodeAt(0) === 0xfeff) {
|
70
|
+
return text.substring(1);
|
71
|
+
}
|
72
|
+
return text;
|
73
|
+
}
|
74
|
+
|
75
|
+
|
76
|
+
// Write a template foreach file that matches template extension
|
77
|
+
templates = extractFiles(process.argv.slice(2))
|
78
|
+
.map(function (file) {
|
79
|
+
var openedFile = fs.readFileSync(file, 'utf-8'), name;
|
80
|
+
if (!openedFile) return;
|
81
|
+
name = file.replace(/\..*$/, '');
|
82
|
+
openedFile = removeByteOrderMark(openedFile.trim());
|
83
|
+
return 'templates.' + name + ' = new Hogan.Template(' + hogan.compile(openedFile, { asString: 1 }) + ');';
|
84
|
+
})
|
85
|
+
.filter(function (t) {
|
86
|
+
return t;
|
87
|
+
});
|
88
|
+
|
89
|
+
|
90
|
+
// Output templates
|
91
|
+
if (!templates.length) return;
|
92
|
+
console.log('var templates = {};');
|
93
|
+
console.log(templates.join('\n'));
|
@@ -0,0 +1 @@
|
|
1
|
+
node_modules
|
@@ -0,0 +1,177 @@
|
|
1
|
+
|
2
|
+
Apache License
|
3
|
+
Version 2.0, January 2004
|
4
|
+
http://www.apache.org/licenses/
|
5
|
+
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
7
|
+
|
8
|
+
1. Definitions.
|
9
|
+
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
12
|
+
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
14
|
+
the copyright owner that is granting the License.
|
15
|
+
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
17
|
+
other entities that control, are controlled by, or are under common
|
18
|
+
control with that entity. For the purposes of this definition,
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
20
|
+
direction or management of such entity, whether by contract or
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
23
|
+
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
25
|
+
exercising permissions granted by this License.
|
26
|
+
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
28
|
+
including but not limited to software source code, documentation
|
29
|
+
source, and configuration files.
|
30
|
+
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
32
|
+
transformation or translation of a Source form, including but
|
33
|
+
not limited to compiled object code, generated documentation,
|
34
|
+
and conversions to other media types.
|
35
|
+
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
37
|
+
Object form, made available under the License, as indicated by a
|
38
|
+
copyright notice that is included in or attached to the work
|
39
|
+
(an example is provided in the Appendix below).
|
40
|
+
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
47
|
+
the Work and Derivative Works thereof.
|
48
|
+
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
50
|
+
the original version of the Work and any modifications or additions
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
62
|
+
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
65
|
+
subsequently incorporated within the Work.
|
66
|
+
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
73
|
+
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
79
|
+
where such license applies only to those patent claims licensable
|
80
|
+
by such Contributor that are necessarily infringed by their
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
83
|
+
institute patent litigation against any entity (including a
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
86
|
+
or contributory patent infringement, then any patent licenses
|
87
|
+
granted to You under this License for that Work shall terminate
|
88
|
+
as of the date such litigation is filed.
|
89
|
+
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
92
|
+
modifications, and in Source or Object form, provided that You
|
93
|
+
meet the following conditions:
|
94
|
+
|
95
|
+
(a) You must give any other recipients of the Work or
|
96
|
+
Derivative Works a copy of this License; and
|
97
|
+
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
99
|
+
stating that You changed the files; and
|
100
|
+
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
103
|
+
attribution notices from the Source form of the Work,
|
104
|
+
excluding those notices that do not pertain to any part of
|
105
|
+
the Derivative Works; and
|
106
|
+
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
109
|
+
include a readable copy of the attribution notices contained
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
112
|
+
of the following places: within a NOTICE text file distributed
|
113
|
+
as part of the Derivative Works; within the Source form or
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
115
|
+
within a display generated by the Derivative Works, if and
|
116
|
+
wherever such third-party notices normally appear. The contents
|
117
|
+
of the NOTICE file are for informational purposes only and
|
118
|
+
do not modify the License. You may add Your own attribution
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
121
|
+
that such additional attribution notices cannot be construed
|
122
|
+
as modifying the License.
|
123
|
+
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
125
|
+
may provide additional or different license terms and conditions
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
129
|
+
the conditions stated in this License.
|
130
|
+
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
134
|
+
this License, without any additional terms or conditions.
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
136
|
+
the terms of any separate license agreement you may have executed
|
137
|
+
with Licensor regarding such Contributions.
|
138
|
+
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
141
|
+
except as required for reasonable and customary use in describing the
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
143
|
+
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
153
|
+
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
159
|
+
incidental, or consequential damages of any character arising as a
|
160
|
+
result of this License or out of the use or inability to use the
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
163
|
+
other commercial damages or losses), even if such Contributor
|
164
|
+
has been advised of the possibility of such damages.
|
165
|
+
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
169
|
+
or other liability obligations and/or rights consistent with this
|
170
|
+
License. However, in accepting such obligations, You may act only
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
175
|
+
of your accepting any such warranty or additional liability.
|
176
|
+
|
177
|
+
END OF TERMS AND CONDITIONS
|
@@ -0,0 +1,62 @@
|
|
1
|
+
REPO = git@github.com:twitter/hogan.js.git
|
2
|
+
BUILD := build
|
3
|
+
VERSION = ${shell node -e 'var s = JSON.parse(require("fs").readFileSync("package.json").toString()).version; console.log(s.substring(0, s.indexOf("-")));'}
|
4
|
+
|
5
|
+
#
|
6
|
+
# Run command line tests
|
7
|
+
#
|
8
|
+
test:
|
9
|
+
@ node test/index.js
|
10
|
+
|
11
|
+
#
|
12
|
+
# Run Mustache spec tests
|
13
|
+
#
|
14
|
+
spec:
|
15
|
+
@ node test/spec.js
|
16
|
+
|
17
|
+
#
|
18
|
+
# Run benchmark
|
19
|
+
#
|
20
|
+
benchmark:
|
21
|
+
@ node benchmark/console/index.js
|
22
|
+
|
23
|
+
clean:
|
24
|
+
@ rm -rf dist/*
|
25
|
+
#
|
26
|
+
# Make a new version of Hogan from the current dev version.
|
27
|
+
#
|
28
|
+
release: clean
|
29
|
+
@ echo "Creating a new version of Hogan."
|
30
|
+
@ mkdir -p dist/nodejs
|
31
|
+
@ cp -R lib dist/nodejs/lib
|
32
|
+
@ node tools/release.js
|
33
|
+
@ mkdir -p web/builds/$(VERSION)
|
34
|
+
@ cp dist/*.* web/builds/$(VERSION)/.
|
35
|
+
#
|
36
|
+
# Make the gh-pages website
|
37
|
+
#
|
38
|
+
# This target builds the hogan.js github website using hogan.js.
|
39
|
+
#
|
40
|
+
# cd into build/gh-pages to check in the new site.
|
41
|
+
#
|
42
|
+
GH_PAGES = $(BUILD)/gh-pages
|
43
|
+
web: | pages
|
44
|
+
@cp -R web/* $(GH_PAGES)
|
45
|
+
@@ node tools/web_templates.js
|
46
|
+
@echo
|
47
|
+
@echo "Website built in $(GH_PAGES)."
|
48
|
+
|
49
|
+
#
|
50
|
+
# Checkout the gh-pages branch.
|
51
|
+
#
|
52
|
+
pages: | $(BUILD)
|
53
|
+
@if [ ! -d "$(GH_PAGES)" ]; then \
|
54
|
+
git clone -b gh-pages $(REPO) $(GH_PAGES); \
|
55
|
+
rm -rf $(GH_PAGES)/*; \
|
56
|
+
fi;
|
57
|
+
@mkdir -p $(GH_PAGES)/images
|
58
|
+
|
59
|
+
$(BUILD):
|
60
|
+
mkdir -p $(BUILD)
|
61
|
+
|
62
|
+
.PHONY: test spec benchmark web release
|
@@ -0,0 +1,93 @@
|
|
1
|
+
## Hogan.js - A mustache compiler.
|
2
|
+
|
3
|
+
[Hogan.js](http://twitter.github.com/hogan.js/) is a compiler for the
|
4
|
+
[Mustache](http://mustache.github.com/) templating language. For information
|
5
|
+
on Mustache, see the [manpage](http://mustache.github.com/mustache.5.html) and
|
6
|
+
the [spec](https://github.com/mustache/spec).
|
7
|
+
|
8
|
+
## Basics
|
9
|
+
|
10
|
+
Hogan compiles templates to HoganTemplate objects, which have a render method.
|
11
|
+
|
12
|
+
```js
|
13
|
+
var data = {
|
14
|
+
screenName: "dhg",
|
15
|
+
};
|
16
|
+
|
17
|
+
var template = Hogan.compile("Follow @{{screenName}}.");
|
18
|
+
var output = template.render(data);
|
19
|
+
|
20
|
+
// prints "Follow @dhg."
|
21
|
+
console.log(output);
|
22
|
+
```
|
23
|
+
|
24
|
+
## Features
|
25
|
+
|
26
|
+
Hogan is fast--try it on your workload.
|
27
|
+
|
28
|
+
Hogan has separate scanning, parsing and code generation phases. This way it's
|
29
|
+
possible to add new features without touching the scanner at all, and many
|
30
|
+
different code generation techniques can be tried without changing the parser.
|
31
|
+
|
32
|
+
Hogan exposes scan and parse methods. These can be useful for
|
33
|
+
pre-processing templates on the server.
|
34
|
+
|
35
|
+
```js
|
36
|
+
var text = "{{^check}}{{i18n}}No{{/i18n}}{{/check}}";
|
37
|
+
text += "{{#check}}{{i18n}}Yes{{/i18n}}{{/check}}";
|
38
|
+
var tree = Hogan.parse(Hogan.scan(text));
|
39
|
+
|
40
|
+
// outputs "# check"
|
41
|
+
console.log(tree[0].tag + " " + tree[0].name);
|
42
|
+
|
43
|
+
// outputs "Yes"
|
44
|
+
console.log(tree[1].nodes[0].nodes[0]);
|
45
|
+
```
|
46
|
+
|
47
|
+
It's also possible to use HoganTemplate objects without the Hogan compiler
|
48
|
+
present. That means you can pre-compile your templates on the server, and
|
49
|
+
avoid shipping the compiler. However, the optional lambda features from the
|
50
|
+
Mustache spec do require the compiler to be present.
|
51
|
+
|
52
|
+
## Why Hogan.js?
|
53
|
+
|
54
|
+
Why another templating library?
|
55
|
+
|
56
|
+
Hogan.js was written to meet three templating library requirements: good
|
57
|
+
performance, standalone template objects, and a parser API.
|
58
|
+
|
59
|
+
## Issues
|
60
|
+
|
61
|
+
Have a bug? Please create an issue here on GitHub!
|
62
|
+
|
63
|
+
https://github.com/twitter/hogan.js/issues
|
64
|
+
|
65
|
+
## Versioning
|
66
|
+
|
67
|
+
For transparency and insight into our release cycle, releases will be numbered with the follow format:
|
68
|
+
|
69
|
+
`<major>.<minor>.<patch>`
|
70
|
+
|
71
|
+
And constructed with the following guidelines:
|
72
|
+
|
73
|
+
* Breaking backwards compatibility bumps the major
|
74
|
+
* New additions without breaking backwards compatibility bumps the minor
|
75
|
+
* Bug fixes and misc changes bump the patch
|
76
|
+
|
77
|
+
For more information on semantic versioning, please visit http://semver.org/.
|
78
|
+
|
79
|
+
## Authors
|
80
|
+
|
81
|
+
**Robert Sayre**
|
82
|
+
|
83
|
+
+ http://github.com/sayrer
|
84
|
+
|
85
|
+
**Jacob Thornton**
|
86
|
+
|
87
|
+
+ http://github.com/fat
|
88
|
+
|
89
|
+
## License
|
90
|
+
|
91
|
+
Copyright 2011 Twitter, Inc.
|
92
|
+
|
93
|
+
Licensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0
|