This commit is contained in:
Stephen Dolan committed 2012-09-19 00:40:35 +01:00
commit 9df9e719d2
22 files changed
+11523

No files matched your search

File diff suppressed because it is too large. Load diff
+9
View File
@@ -0,0 +1,9 @@
/*!
* Bootstrap Responsive v2.1.1
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.hidden{display:none;visibility:hidden}.visible-phone{display:none!important}.visible-tablet{display:none!important}.hidden-desktop{display:none!important}.visible-desktop{display:inherit!important}@media(min-width:768px) and (max-width:979px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-tablet{display:inherit!important}.hidden-tablet{display:none!important}}@media(max-width:767px){.hidden-desktop{display:inherit!important}.visible-desktop{display:none!important}.visible-phone{display:inherit!important}.hidden-phone{display:none!important}}@media(min-width:1200px){.row{margin-left:-30px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:30px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:1170px}.span12{width:1170px}.span11{width:1070px}.span10{width:970px}.span9{width:870px}.span8{width:770px}.span7{width:670px}.span6{width:570px}.span5{width:470px}.span4{width:370px}.span3{width:270px}.span2{width:170px}.span1{width:70px}.offset12{margin-left:1230px}.offset11{margin-left:1130px}.offset10{margin-left:1030px}.offset9{margin-left:930px}.offset8{margin-left:830px}.offset7{margin-left:730px}.offset6{margin-left:630px}.offset5{margin-left:530px}.offset4{margin-left:430px}.offset3{margin-left:330px}.offset2{margin-left:230px}.offset1{margin-left:130px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.564102564102564%;*margin-left:2.5109110747408616%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.45299145299145%;*width:91.39979996362975%}.row-fluid .span10{width:82.90598290598291%;*width:82.8527914166212%}.row-fluid .span9{width:74.35897435897436%;*width:74.30578286961266%}.row-fluid .span8{width:65.81196581196582%;*width:65.75877432260411%}.row-fluid .span7{width:57.26495726495726%;*width:57.21176577559556%}.row-fluid .span6{width:48.717948717948715%;*width:48.664757228587014%}.row-fluid .span5{width:40.17094017094017%;*width:40.11774868157847%}.row-fluid .span4{width:31.623931623931625%;*width:31.570740134569924%}.row-fluid .span3{width:23.076923076923077%;*width:23.023731587561375%}.row-fluid .span2{width:14.52991452991453%;*width:14.476723040552828%}.row-fluid .span1{width:5.982905982905983%;*width:5.929714493544281%}.row-fluid .offset12{margin-left:105.12820512820512%;*margin-left:105.02182214948171%}.row-fluid .offset12:first-child{margin-left:102.56410256410257%;*margin-left:102.45771958537915%}.row-fluid .offset11{margin-left:96.58119658119658%;*margin-left:96.47481360247316%}.row-fluid .offset11:first-child{margin-left:94.01709401709402%;*margin-left:93.91071103837061%}.row-fluid .offset10{margin-left:88.03418803418803%;*margin-left:87.92780505546462%}.row-fluid .offset10:first-child{margin-left:85.47008547008548%;*margin-left:85.36370249136206%}.row-fluid .offset9{margin-left:79.48717948717949%;*margin-left:79.38079650845607%}.row-fluid .offset9:first-child{margin-left:76.92307692307693%;*margin-left:76.81669394435352%}.row-fluid .offset8{margin-left:70.94017094017094%;*margin-left:70.83378796144753%}.row-fluid .offset8:first-child{margin-left:68.37606837606839%;*margin-left:68.26968539734497%}.row-fluid .offset7{margin-left:62.393162393162385%;*margin-left:62.28677941443899%}.row-fluid .offset7:first-child{margin-left:59.82905982905982%;*margin-left:59.72267685033642%}.row-fluid .offset6{margin-left:53.84615384615384%;*margin-left:53.739770867430444%}.row-fluid .offset6:first-child{margin-left:51.28205128205128%;*margin-left:51.175668303327875%}.row-fluid .offset5{margin-left:45.299145299145295%;*margin-left:45.1927623204219%}.row-fluid .offset5:first-child{margin-left:42.73504273504273%;*margin-left:42.62865975631933%}.row-fluid .offset4{margin-left:36.75213675213675%;*margin-left:36.645753773413354%}.row-fluid .offset4:first-child{margin-left:34.18803418803419%;*margin-left:34.081651209310785%}.row-fluid .offset3{margin-left:28.205128205128204%;*margin-left:28.0987452264048%}.row-fluid .offset3:first-child{margin-left:25.641025641025642%;*margin-left:25.53464266230224%}.row-fluid .offset2{margin-left:19.65811965811966%;*margin-left:19.551736679396257%}.row-fluid .offset2:first-child{margin-left:17.094017094017094%;*maLine truncated
+5774
View File
File diff suppressed because it is too large. Load diff
+9
View File
@@ -0,0 +1,9 @@
/*!
* Bootstrap v2.1.1
*
* Copyright 2012 Twitter, Inc
* Licensed under the Apache License v2.0
* http://www.apache.org/licenses/LICENSE-2.0
*
* Designed and built with all the love in the world @twitter by @mdo and @fat.
*/article,aside,details,figcaption,figure,footer,header,hgroup,nav,section{display:block}audio,canvas,video{display:inline-block;*display:inline;*zoom:1}audio:not([controls]){display:none}html{font-size:100%;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}a:focus{outline:thin dotted #333;outline:5px auto -webkit-focus-ring-color;outline-offset:-2px}a:hover,a:active{outline:0}sub,sup{position:relative;font-size:75%;line-height:0;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{width:auto\9;height:auto;max-width:100%;vertical-align:middle;border:0;-ms-interpolation-mode:bicubic}#map_canvas img{max-width:none}button,input,select,textarea{margin:0;font-size:100%;vertical-align:middle}button,input{*overflow:visible;line-height:normal}button::-moz-focus-inner,input::-moz-focus-inner{padding:0;border:0}button,input[type="button"],input[type="reset"],input[type="submit"]{cursor:pointer;-webkit-appearance:button}input[type="search"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box;-webkit-appearance:textfield}input[type="search"]::-webkit-search-decoration,input[type="search"]::-webkit-search-cancel-button{-webkit-appearance:none}textarea{overflow:auto;vertical-align:top}.clearfix{*zoom:1}.clearfix:before,.clearfix:after{display:table;line-height:0;content:""}.clearfix:after{clear:both}.hide-text{font:0/0 a;color:transparent;text-shadow:none;background-color:transparent;border:0}.input-block-level{display:block;width:100%;min-height:30px;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}body{margin:0;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;line-height:20px;color:#333;background-color:#fff}a{color:#08c;text-decoration:none}a:hover{color:#005580;text-decoration:underline}.img-rounded{-webkit-border-radius:6px;-moz-border-radius:6px;border-radius:6px}.img-polaroid{padding:4px;background-color:#fff;border:1px solid #ccc;border:1px solid rgba(0,0,0,0.2);-webkit-box-shadow:0 1px 3px rgba(0,0,0,0.1);-moz-box-shadow:0 1px 3px rgba(0,0,0,0.1);box-shadow:0 1px 3px rgba(0,0,0,0.1)}.img-circle{-webkit-border-radius:500px;-moz-border-radius:500px;border-radius:500px}.row{margin-left:-20px;*zoom:1}.row:before,.row:after{display:table;line-height:0;content:""}.row:after{clear:both}[class*="span"]{float:left;min-height:1px;margin-left:20px}.container,.navbar-static-top .container,.navbar-fixed-top .container,.navbar-fixed-bottom .container{width:940px}.span12{width:940px}.span11{width:860px}.span10{width:780px}.span9{width:700px}.span8{width:620px}.span7{width:540px}.span6{width:460px}.span5{width:380px}.span4{width:300px}.span3{width:220px}.span2{width:140px}.span1{width:60px}.offset12{margin-left:980px}.offset11{margin-left:900px}.offset10{margin-left:820px}.offset9{margin-left:740px}.offset8{margin-left:660px}.offset7{margin-left:580px}.offset6{margin-left:500px}.offset5{margin-left:420px}.offset4{margin-left:340px}.offset3{margin-left:260px}.offset2{margin-left:180px}.offset1{margin-left:100px}.row-fluid{width:100%;*zoom:1}.row-fluid:before,.row-fluid:after{display:table;line-height:0;content:""}.row-fluid:after{clear:both}.row-fluid [class*="span"]{display:block;float:left;width:100%;min-height:30px;margin-left:2.127659574468085%;*margin-left:2.074468085106383%;-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box}.row-fluid [class*="span"]:first-child{margin-left:0}.row-fluid .span12{width:100%;*width:99.94680851063829%}.row-fluid .span11{width:91.48936170212765%;*width:91.43617021276594%}.row-fluid .span10{width:82.97872340425532%;*width:82.92553191489361%}.row-fluid .span9{width:74.46808510638297%;*width:74.41489361702126%}.row-fluid .span8{width:65.95744680851064%;*width:65.90425531914893%}.row-fluid .span7{width:57.44680851063829%;*width:57.39361702127659%}.row-fluid .span6{width:48.93617021276595%;*width:48.88297872340425%}.row-fluid .span5{width:40.42553191489362%;*width:40.37234042553192%}.row-fluid .span4{width:31.914893617021278%;*width:31.861702127659576%}.row-fluid .span3{width:23.404255319148934%;*width:23.351063829787233%}.row-fluid .span2{width:14.893617021276595%;*width:14.840425531914894%}.row-fluid .span1{width:6.382978723404255%;*width:6.329787234042553%}.row-fluid .offset12{margin-left:104.25531914893617%;*margin-left:104.14893617021275%}.row-fluid .offset12:first-child{margin-left:102.12765957446808%;*margin-left:102.02127659574467%}.row-fluid .offset11{margin-left:95.74468085106382%;*margin-left:95.6382978723404%}.row-fluid .offset11:first-child{margin-left:93.61702127659574%;*margin-left:93.51063829787232%}.row-fluid .offset10{margin-left:87.23404255319149%;*margin-left:87.12765957446807%}.row-fluid .offset10:first-child{margin-left:85.1063829787234%;*margin-left:84.99999999999999%}.row-fluid .offset9{margin-left:78.72340425531914%;*margin-left:78.61702127659572%}.row-fluid .offset9:first-child{margin-left:76.59574468085106%;*margin-left:76.48936170212764%}.row-fluiLine truncated
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

+2027
View File
File diff suppressed because it is too large. Load diff
+6
View File
@@ -0,0 +1,6 @@
/*!
* Bootstrap.js by @fat & @mdo
* Copyright 2012 Twitter, Inc.
* http://www.apache.org/licenses/LICENSE-2.0.txt
*/
!function(e){e(function(){"use strict";e.support.transition=function(){var e=function(){var e=document.createElement("bootstrap"),t={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"},n;for(n in t)if(e.style[n]!==undefined)return t[n]}();return e&&{end:e}}()})}(window.jQuery),!function(e){"use strict";var t='[data-dismiss="alert"]',n=function(n){e(n).on("click",t,this.close)};n.prototype.close=function(t){function s(){i.trigger("closed").remove()}var n=e(this),r=n.attr("data-target"),i;r||(r=n.attr("href"),r=r&&r.replace(/.*(?=#[^\s]*$)/,"")),i=e(r),t&&t.preventDefault(),i.length||(i=n.hasClass("alert")?n:n.parent()),i.trigger(t=e.Event("close"));if(t.isDefaultPrevented())return;i.removeClass("in"),e.support.transition&&i.hasClass("fade")?i.on(e.support.transition.end,s):s()},e.fn.alert=function(t){return this.each(function(){var r=e(this),i=r.data("alert");i||r.data("alert",i=new n(this)),typeof t=="string"&&i[t].call(r)})},e.fn.alert.Constructor=n,e(function(){e("body").on("click.alert.data-api",t,n.prototype.close)})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.button.defaults,n)};t.prototype.setState=function(e){var t="disabled",n=this.$element,r=n.data(),i=n.is("input")?"val":"html";e+="Text",r.resetText||n.data("resetText",n[i]()),n[i](r[e]||this.options[e]),setTimeout(function(){e=="loadingText"?n.addClass(t).attr(t,t):n.removeClass(t).removeAttr(t)},0)},t.prototype.toggle=function(){var e=this.$element.closest('[data-toggle="buttons-radio"]');e&&e.find(".active").removeClass("active"),this.$element.toggleClass("active")},e.fn.button=function(n){return this.each(function(){var r=e(this),i=r.data("button"),s=typeof n=="object"&&n;i||r.data("button",i=new t(this,s)),n=="toggle"?i.toggle():n&&i.setState(n)})},e.fn.button.defaults={loadingText:"loading..."},e.fn.button.Constructor=t,e(function(){e("body").on("click.button.data-api","[data-toggle^=button]",function(t){var n=e(t.target);n.hasClass("btn")||(n=n.closest(".btn")),n.button("toggle")})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=n,this.options.slide&&this.slide(this.options.slide),this.options.pause=="hover"&&this.$element.on("mouseenter",e.proxy(this.pause,this)).on("mouseleave",e.proxy(this.cycle,this))};t.prototype={cycle:function(t){return t||(this.paused=!1),this.options.interval&&!this.paused&&(this.interval=setInterval(e.proxy(this.next,this),this.options.interval)),this},to:function(t){var n=this.$element.find(".item.active"),r=n.parent().children(),i=r.index(n),s=this;if(t>r.length-1||t<0)return;return this.sliding?this.$element.one("slid",function(){s.to(t)}):i==t?this.pause().cycle():this.slide(t>i?"next":"prev",e(r[t]))},pause:function(t){return t||(this.paused=!0),this.$element.find(".next, .prev").length&&e.support.transition.end&&(this.$element.trigger(e.support.transition.end),this.cycle()),clearInterval(this.interval),this.interval=null,this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(t,n){var r=this.$element.find(".item.active"),i=n||r[t](),s=this.interval,o=t=="next"?"left":"right",u=t=="next"?"first":"last",a=this,f=e.Event("slide",{relatedTarget:i[0]});this.sliding=!0,s&&this.pause(),i=i.length?i:this.$element.find(".item")[u]();if(i.hasClass("active"))return;if(e.support.transition&&this.$element.hasClass("slide")){this.$element.trigger(f);if(f.isDefaultPrevented())return;i.addClass(t),i[0].offsetWidth,r.addClass(o),i.addClass(o),this.$element.one(e.support.transition.end,function(){i.removeClass([t,o].join(" ")).addClass("active"),r.removeClass(["active",o].join(" ")),a.sliding=!1,setTimeout(function(){a.$element.trigger("slid")},0)})}else{this.$element.trigger(f);if(f.isDefaultPrevented())return;r.removeClass("active"),i.addClass("active"),this.sliding=!1,this.$element.trigger("slid")}return s&&this.cycle(),this}},e.fn.carousel=function(n){return this.each(function(){var r=e(this),i=r.data("carousel"),s=e.extend({},e.fn.carousel.defaults,typeof n=="object"&&n),o=typeof n=="string"?n:s.slide;i||r.data("carousel",i=new t(this,s)),typeof n=="number"?i.to(n):o?i[o]():s.interval&&i.cycle()})},e.fn.carousel.defaults={interval:5e3,pause:"hover"},e.fn.carousel.Constructor=t,e(function(){e("body").on("click.carousel.data-api","[data-slide]",function(t){var n=e(this),r,i=e(n.attr("data-target")||(r=n.attr("href"))&&r.replace(/.*(?=#[^\s]+$)/,"")),s=!i.data("modal")&&e.extend({},i.data(),n.data());i.carousel(s),t.preventDefault()})})}(window.jQuery),!function(e){"use strict";var t=function(t,n){this.$element=e(t),this.options=e.extend({},e.fn.collapse.defaults,n),this.options.parent&&(this.$parent=e(this.options.parent)),this.options.toggle&&this.toggle()};t.prototype={constructor:t,dimension:function(){var e=this.$element.hLine truncated
+69
View File
@@ -0,0 +1,69 @@
body {
padding-top: 60px; }
footer {
background-color: #F5F5F5;
padding: 40px 0;
height: 100px;
margin-top: 40px;
color: #999999; }
section {
padding-top: 30px; }
.manual-example {
border-top: 1px solid #E5E5E5; }
.manual-example td {
white-space: pre-wrap;
font-family: Monaco, Menlo, Consolas, "Courier New", monospace; }
.manual-example td.jqprogram {
font-weight: bold; }
.manual-example th {
text-align: right;
padding-right: 10px; }
.tutorial-example {
position: relative;
margin-bottom: 10px; }
.tutorial-example pre {
margin-bottom: 0px; }
.tutorial-example a {
position: absolute;
top: 0px;
right: 0px;
padding: 15px 8px;
color: #777777;
font-weight: bold;
line-height: 10px;
font-size: 12px;
border-left: 1px solid #DDDDDD;
bottom: 0;
display: block; }
#blurb {
padding-top: 40px;
padding-right: 50px; }
#blurb p {
font-size: 20pt; }
#blurb .btn-group {
margin-top: 20px; }
#multiblurb {
line-height: 1.7;
text-align: center;
font-size: 12pt; }
#multiblurb code {
border: 0;
font-size: 12pt; }
h3 code {
border: 0;
font-size: 20px; }
+88
View File
@@ -0,0 +1,88 @@
@charset "utf-8";
body {
padding-top: 60px;
}
footer {
background-color: #F5F5F5;
padding: 40px 0;
height: 100px;
margin-top: 40px;
color: #999999;
}
section {
padding-top: 30px;
}
.manual-example {
border-top: 1px solid #E5E5E5;
}
.manual-example td {
white-space: pre-wrap;
font-family: Monaco, Menlo, Consolas, "Courier New", monospace;
}
.manual-example td.jqprogram {
font-weight: bold;
}
.manual-example th {
text-align: right;
padding-right: 10px;
}
.tutorial-example {
position: relative;
margin-bottom: 10px;
}
.tutorial-example pre {
margin-bottom: 0px;
}
.tutorial-example a {
position: absolute;
top: 0px;
right: 0px;
padding: 15px 8px;
color: #777777;
font-weight: bold;
line-height: 10px;
font-size: 12px;
border-left: 1px solid #DDDDDD;
bottom: 0;
display: block;
}
#blurb {
padding-top: 40px;
padding-right: 50px;
}
#blurb p {
font-size: 20pt;
}
#blurb .btn-group {
margin-top: 20px;
}
#multiblurb {
line-height: 1.7;
text-align: center;
font-size: 12pt;
}
#multiblurb code {
border: 0;
font-size: 12pt;
}
h3 code {
border: 0;
font-size: 20px;
}
+95
View File
@@ -0,0 +1,95 @@
@charset "utf-8";
/* HTML resets */
body, html, div, p, img, h1, h2, h3, h4, h5, h6, ol, ul, li { margin: 0; padding: 0; font-weight: normal; font-size: 100%; outline: none; border: none;}
/* HTML5 block elements */
header, section, article, footer, aside, nav { display: block; }
/* Put your styles below here */
#wrapper { margin: 0 auto; width: 660px; }
body { font-family: "Helvetica Neue", Helvetica, Arial, Geneva, sans-serif; }
header {
margin-top: 5em;
#logo {
width: 145px;
height: 145px;
margin: 0 auto;
-moz-border-radius: 72px;
-webkit-border-radius: 72px;
background-color: black;
a {
position: absolute;
margin: 1em 0 0em 1.5em;
color: white;
text-align: center;
text-transform: lowercase;
text-decoration: none;
font-weight: 100;
}
}
#navigation {
margin: 5em 0;
text-transform: lowercase;
text-align: center;
font-style: italic;
font-size: 0.8em;
li:not(:last-child):after { content: " /"; }
a { color: black; text-decoration: none; }
a:hover { text-decoration: underline; }
}
}
nav li { display: inline; list-style-type: none; }
#breadcrumbs, footer { color: gray; font-size: 0.7em; }
#breadcrumbs {
li:not(:last-child):after { content: " ➔";}
border-top: 1px solid lightgray;
padding-top:5px;
a { color: inherit; }
}
#sub-navigation{
font-size: 0.8em;
li { display: block; margin-bottom: 5px; }
}
nav, footer { margin: 1em 0; }
/* Typesetting */
h1, h2, h3, h4, h5, h6 { margin: 1.25em 0; }
h1 { font-size: 2em; }
h2 { font-size: 1.6em; }
h3 { font-size: 1.4em; }
h4 { font-size: 1.2em; }
h5 { font-size: 1em; }
h6 { font-size: 0.9em; }
a { color: #256ec4; }
p { font-size: 0.8em; line-height: 140%; margin-bottom: 10px; color: #333;}
/* Floating the Magic template */
.magic article {
width: 450px;
float: left;
border-right: 1px solid lightgray;
margin-right: 14px;
padding-right: 15px;
}
.magic aside {
width: 180px;
float: left
}
.clear{ clear: both; }
+117
View File
@@ -0,0 +1,117 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=UTF-8>
<title>Download jq | jq</title>
<!-- disable for local development to make the links work -->
<base href="http://stedolan.github.com/jq" />
<link rel="stylesheet" href="/bootstrap/css/bootstrap.css" type="text/css">
<link rel="stylesheet" href="/css/base.css" type="text/css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="/bootstrap/js/bootstrap.js"></script>
</head>
<body id="download">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="/">jq</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li >
<a href="/tutorial/">Tutorial</a>
</li>
<li class="active" >
<a href="/download/">Download</a>
</li>
<li >
<a href="/manual/">Manual</a>
</li>
<li><a href="https://github.com/stedolan/jq/issues">Issues</a></li>
<li><a href="https://github.com/stedolan/jq">Source</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<h1>Download jq</h1>
<p>jq is written in C and has no runtime dependencies, so it should be possible to build it for nearly any platform. Prebuilt binaries are available for Linux (64-bit x86) and OS X.</p>
<ul>
<li><a href='/download/linux_x86_64/jq'>Download binary for 64-bit Linux</a></li>
<li><a href='/download/osx_64/jq'>Download binary for OS X</a></li>
<li><a href='/download/source/jq.tgz'>Download source</a></li>
</ul>
<p>The binaries should just run, but you may need to make them executable first using:</p>
<pre><code>chmod +x jq</code></pre>
<p>jq is licensed under the MIT license. For all of the gory details, read the file <code>COPYING</code> in the source distribution.</p>
<h1 id='hacking_on_jq'>Hacking on jq</h1>
<p>If you want to work on jq, grab the source from <a href='https://github.com/stedolan/jq'>https://github.com/stedolan/jq</a>.</p>
<p>To build it from a git clone, you&#8217;ll need to install a few packages first:</p>
<ul>
<li><a href='http://www.gnu.org/software/flex/'>Flex</a></li>
<li><a href='http://www.gnu.org/software/bison/'>Bison</a></li>
<li><a href='http://www.python.org'>Python</a></li>
<li><a href='http://gcc.gnu.org'>GCC</a></li>
<li><a href='http://www.gnu.org/software/make'>Make</a></li>
</ul>
<p>Most of these aren&#8217;t necessary if you&#8217;re just trying to compile jq from the released tarball - that version has the non-platform-specific build steps already done, so you&#8217;ll only need a C compiler and <code>make</code> to finish it off.</p>
<p>For Linux systems, these will all be in your system&#8217;s package manager, and if you do development on the machine they&#8217;re most likely already installed. I have no idea how to get these installed on OS X, you&#8217;re on your own there.</p>
<p><code>flex</code> and <code>bison</code> are used to generate the lexer and parser for jq, and some python scripts generate the UTF8 encoding tables needed for JSON parsing.</p>
<h2 id='building_the_documentation'>Building the documentation</h2>
<p>jq&#8217;s documentation is compiled into static HTML using <a href='http://www.tinytree.info'>Bonsai</a>. To view the documentation locally, run <code>rake serve</code> from the docs/ subdirectory.</p>
</div>
</div>
<footer>
<div class="container">
<p>This website is made with <a href='http://www.tinytree.info'>Bonsai</a> and <a href='http://twitter.github.com/bootstrap/'>Twitter Boostrap</a>. jq is licensed under the MIT license (code) and the <a href='http://creativecommons.org/licenses/by/3.0/'>CC-BY-3.0</a> license (docs).</p>
</div>
</footer>
</body>
</html>
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
+93
View File
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=UTF-8>
<title>jq | jq</title>
<!-- disable for local development to make the links work -->
<base href="http://stedolan.github.com/jq" />
<link rel="stylesheet" href="/bootstrap/css/bootstrap.css" type="text/css">
<link rel="stylesheet" href="/css/base.css" type="text/css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="/bootstrap/js/bootstrap.js"></script>
</head>
<body id="index">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="/">jq</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li >
<a href="/tutorial/">Tutorial</a>
</li>
<li >
<a href="/download/">Download</a>
</li>
<li >
<a href="/manual/">Manual</a>
</li>
<li><a href="https://github.com/stedolan/jq/issues">Issues</a></li>
<li><a href="https://github.com/stedolan/jq">Source</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="hero-unit">
<img src="/jq.png" style="width: 400px; height: 220px; float: left; margin-right: 60px">
<div id="blurb">
<p>jq is a lightweight and flexible command-line JSON processor.</p>
<div class="btn-group" style="float:right">
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#">
Download jq-1.0
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="/download/linux_x86_64/jq">Linux (x86_64)</a></li>
<li><a href="/download/osx_64/jq">OS X (64-bit)</a></li>
<li><a href="/download">Other platforms and source</a></li>
</ul>
</div>
</div>
<div style="clear:both;"></div>
</div>
</div>
<div class="row" id="multiblurb">
<div class="span4"><p>jq is like <code>sed</code> for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that <code>sed</code>, <code>awk</code>, <code>grep</code> and friends let you play with text.</p></div>
<div class="span4"><p>jq is written in portable C, and it has zero runtime dependencies. You can download a single binary, <code>scp</code> it to a far away machine, and expect it to work.</p></div>
<div class="span4"><p>jq can mangle the data format that you have into the one that you want with very little effort, and the program to do so is often shorter and simpler than you&#8217;d expect.</p></div>
</div>
<div class="row" style="text-align:center; margin-top: 30px">
<p>Go read the <a href='/tutorial'>tutorial</a> for more, or the <a href='/manual'>manual</a> for <em>way</em> more.</p>
</div>
</div>
<footer>
<div class="container">
<p>This website is made with <a href='http://www.tinytree.info'>Bonsai</a> and <a href='http://twitter.github.com/bootstrap/'>Twitter Boostrap</a>. jq is licensed under the MIT license (code) and the <a href='http://creativecommons.org/licenses/by/3.0/'>CC-BY-3.0</a> license (docs).</p>
</div>
</footer>
</body>
</html>
+93
View File
@@ -0,0 +1,93 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=UTF-8>
<title>jq | jq</title>
<!-- disable for local development to make the links work -->
<base href="http://stedolan.github.com/jq" />
<link rel="stylesheet" href="/bootstrap/css/bootstrap.css" type="text/css">
<link rel="stylesheet" href="/css/base.css" type="text/css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="/bootstrap/js/bootstrap.js"></script>
</head>
<body id="index">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="/">jq</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li >
<a href="/tutorial/">Tutorial</a>
</li>
<li >
<a href="/download/">Download</a>
</li>
<li >
<a href="/manual/">Manual</a>
</li>
<li><a href="https://github.com/stedolan/jq/issues">Issues</a></li>
<li><a href="https://github.com/stedolan/jq">Source</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="hero-unit">
<img src="/jq.png" style="width: 400px; height: 220px; float: left; margin-right: 60px">
<div id="blurb">
<p>jq is a lightweight and flexible command-line JSON processor.</p>
<div class="btn-group" style="float:right">
<a class="btn btn-primary dropdown-toggle" data-toggle="dropdown" href="#">
Download jq-1.0
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<li><a href="/download/linux_x86_64/jq">Linux (x86_64)</a></li>
<li><a href="/download/osx_64/jq">OS X (64-bit)</a></li>
<li><a href="/download">Other platforms and source</a></li>
</ul>
</div>
</div>
<div style="clear:both;"></div>
</div>
</div>
<div class="row" id="multiblurb">
<div class="span4"><p>jq is like <code>sed</code> for JSON data - you can use it to slice and filter and map and transform structured data with the same ease that <code>sed</code>, <code>awk</code>, <code>grep</code> and friends let you play with text.</p></div>
<div class="span4"><p>jq is written in portable C, and it has zero runtime dependencies. You can download a single binary, <code>scp</code> it to a far away machine, and expect it to work.</p></div>
<div class="span4"><p>jq can mangle the data format that you have into the one that you want with very little effort, and the program to do so is often shorter and simpler than you&#8217;d expect.</p></div>
</div>
<div class="row" style="text-align:center; margin-top: 30px">
<p>Go read the <a href='/tutorial'>tutorial</a> for more, or the <a href='/manual'>manual</a> for <em>way</em> more.</p>
</div>
</div>
<footer>
<div class="container">
<p>This website is made with <a href='http://www.tinytree.info'>Bonsai</a> and <a href='http://twitter.github.com/bootstrap/'>Twitter Boostrap</a>. jq is licensed under the MIT license (code) and the <a href='http://creativecommons.org/licenses/by/3.0/'>CC-BY-3.0</a> license (docs).</p>
</div>
</footer>
</body>
</html>
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 8.0 KiB

+1709
View File
File diff suppressed because it is too large. Load diff
+2
View File
@@ -0,0 +1,2 @@
User-agent: *
Allow: /
View File
Whitespace-only changes.
+374
View File
@@ -0,0 +1,374 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset=UTF-8>
<title>Tutorial | jq</title>
<!-- disable for local development to make the links work -->
<base href="http://stedolan.github.com/jq" />
<link rel="stylesheet" href="/bootstrap/css/bootstrap.css" type="text/css">
<link rel="stylesheet" href="/css/base.css" type="text/css">
<!--[if IE]>
<script src="http://html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js"></script>
<script src="/bootstrap/js/bootstrap.js"></script>
</head>
<body id="tutorial">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="brand" href="/">jq</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li class="active" >
<a href="/tutorial/">Tutorial</a>
</li>
<li >
<a href="/download/">Download</a>
</li>
<li >
<a href="/manual/">Manual</a>
</li>
<li><a href="https://github.com/stedolan/jq/issues">Issues</a></li>
<li><a href="https://github.com/stedolan/jq">Source</a></li>
</ul>
</div>
</div>
</div>
</div>
<div class="container">
<div class="row">
<h1>Tutorial</h1>
<p>Twitter have a JSON API, so let&#8217;s play with that. This URL gets us the last 5 tweets about JSON:</p>
<div class="tutorial-example">
<div class="accordion-heading">
<pre>curl 'http://search.twitter.com/search.json?q=json&rpp=5&include_entities=true'</pre>
<a data-toggle="collapse" href="#result1">Show result</a>
</div>
<div id="result1" class="accordion-body collapse"><pre>{"completed_in":0.108,"max_id":247677287108067328,"max_id_str":"247677287108067328","next_page":"?page=2&max_id=247677287108067328&q=json&rpp=5&include_entities=1","page":1,"query":"json","refresh_url":"?since_id=247677287108067328&q=json&include_entities=1","results":[{"created_at":"Mon, 17 Sep 2012 12:44:01 +0000","entities":{"hashtags":[],"urls":[{"url":"http:\/\/t.co\/XRvh1ZVw","expanded_url":"http:\/\/jase.im\/Ri7I0M","display_url":"jase.im\/Ri7I0M","indices":[112,132]}],"user_mentions":[{"screen_name":"imagemechanics","name":"Jason Cotterell","id":57271393,"id_str":"57271393","indices":[3,18]}]},"from_user":"_AaronNg","from_user_id":79771704,"from_user_id_str":"79771704","from_user_name":"NgChenChong","geo":null,"id":247677287108067328,"id_str":"247677287108067328","iso_language_code":"en","metadata":{"result_type":"recent"},"profile_image_url":"http:\/\/a0.twimg.com\/profile_images\/2523558403\/ek8mo4j4beq84iw28gjl_normal.jpeg","profile_image_url_https":"https:\/\/si0.twimg.com\/profile_images\/2523558403\/ek8mo4j4beq84iw28gjl_normal.jpeg","source":"&lt;a href=&quot;http:\/\/twitter.com\/&quot;&gt;web&lt;\/a&gt;","text":"RT @imagemechanics: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt;.\nhttp:\/\/t.co\/XRvh1ZVw","to_user":null,"to_user_id":0,"to_user_id_str":"0","to_user_name":null}, ...
</pre></div>
</div>
<p>There&#8217;s lots of info and no whitespace, so to make it a bit more legible we pipe it through jq, telling jq to just spit the input back at us using the expression <code>.</code>:</p>
<div class="tutorial-example">
<div class="accordion-heading">
<pre>curl 'http://search.twitter.com/search.json?q=json&rpp=5&include_entities=true' | jq '.'</pre>
<a data-toggle="collapse" href="#result2">Show result</a>
</div>
<div id="result2" class="accordion-body collapse"><pre>
{
"since_id_str": "0",
"since_id": 0,
"results_per_page": 5,
"completed_in": 0.108,
"max_id": 247677287108067330,
"max_id_str": "247677287108067328",
"next_page": "?page=2&max_id=247677287108067328&q=json&rpp=5&include_entities=1",
"page": 1,
"query": "json",
"refresh_url": "?since_id=247677287108067328&q=json&include_entities=1",
"results": [
{
"from_user_name": "NgChenChong",
"from_user_id_str": "79771704",
"from_user_id": 79771704,
"from_user": "_AaronNg",
"iso_language_code": "en",
"text": "RT @imagemechanics: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt;.\nhttp://t.co/XRvh1ZVw",
"to_user": null
/* lots more fields... */
},
/* lots more results... */
]
}
</pre></div>
</div>
<p>Let&#8217;s pull out the first tweet:</p>
<div class="tutorial-example">
<div class="accordion-heading">
<pre>curl 'http://search.twitter.com/search.json?q=json&rpp=5&include_entities=true' | jq '.results[0]'</pre>
<a data-toggle="collapse" href="#result3">Show result</a>
</div>
<div id="result3" class="accordion-body collapse"><pre>{
"from_user_name": "NgChenChong",
"from_user_id_str": "79771704",
"from_user_id": 79771704,
"from_user": "_AaronNg",
"iso_language_code": "en",
"text": "RT @imagemechanics: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt;.\nhttp://t.co/XRvh1ZVw",
"to_user": null
/* lots more fields... */
},
</pre></div>
</div>
<p>For the rest of the examples, I&#8217;ll leave out the <code>curl</code> command - it&#8217;s not going to change.</p>
<p>There&#8217;s still a lot of info we don&#8217;t care about there, so we&#8217;ll restrict it down to the most interesting fields.</p>
<div class="tutorial-example">
<div class="accordion-heading">
<pre>jq '.results[0] | {from_user, text}'</pre>
<a data-toggle="collapse" href="#result4">Show result</a>
</div>
<div id="result4" class="accordion-body collapse"><pre>{
"text": "RT @imagemechanics: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt;.\nhttp://t.co/XRvh1ZVw",
"from_user": "_AaronNg"
}
</pre></div>
</div>
<p>The <code>|</code> operator in jq feeds the output of one filter (<code>.results[0]</code> which gets the first element of the results array) into the input of another (<code>{from_user, text}</code> which builds an object of those two fields).</p>
<p>Now let&#8217;s get the rest of the tweets:</p>
<div class="tutorial-example">
<div class="accordion-heading">
<pre>jq '.results[] | {from_user, text}'</pre>
<a data-toggle="collapse" href="#result5">Show result</a>
</div>
<div id="result5" class="accordion-body collapse"><pre>{
"text": "RT @imagemechanics: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt;.\nhttp://t.co/XRvh1ZVw",
"from_user": "_AaronNg"
}
{
"text": "RT @_kud: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt; -- http://t.co/Lhp92IqD",
"from_user": "blouerat"
}
{
"text": "Dynamic Forms Mobile App by pmadiset: Few Forms details are hosted on our server in the form of JSON. This JSON ... http://t.co/7KALdWaX",
"from_user": "cebu_iphone"
}
{
"text": "iPhone 5 website insanity - Video compressing using JPEG, JSON, and &lt;canvas&gt; http://t.co/28Jesbio (Oh #Apple, U So #Awesome...)",
"from_user": "dieswaytoofast"
}
{
"text": "RT @umutm: A very nice web-based JSON editor - http://t.co/M70snaIf",
"from_user": "Leolik"
}
</pre></div>
</div>
<p><code>.results[]</code> returns each element of the results array, one at a time, which are all fed into <code>{from_user, text}</code>.</p>
<p>Data in jq is represented as streams of JSON values - every jq expression runs for each value in its input stream, and can produce any number of values to its output stream.</p>
<p>Streams are serialised by just separating JSON values with whitespace. This is a <code>cat</code>-friendly format - you can just join two JSON streams together and get a valid JSON stream.</p>
<p>If you want to get the output as a single array, you can tell jq to &#8220;collect&#8221; all of the answers by wrapping the filter in square brackets:</p>
<div class="tutorial-example">
<div class="accordion-heading">
<pre>jq '[.results[] | {from_user, text}]'</pre>
<a data-toggle="collapse" href="#result6">Show result</a>
</div>
<div id="result6" class="accordion-body collapse"><pre>[
{
"text": "RT @imagemechanics: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt;.\nhttp://t.co/XRvh1ZVw",
"from_user": "_AaronNg"
},
{
"text": "RT @_kud: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt; -- http://t.co/Lhp92IqD",
"from_user": "blouerat"
},
{
"text": "Dynamic Forms Mobile App by pmadiset: Few Forms details are hosted on our server in the form of JSON. This JSON ... http://t.co/7KALdWaX",
"from_user": "cebu_iphone"
},
{
"text": "iPhone 5 website insanity - Video compressing using JPEG, JSON, and &lt;canvas&gt; http://t.co/28Jesbio (Oh #Apple, U So #Awesome...)",
"from_user": "dieswaytoofast"
},
{
"text": "RT @umutm: A very nice web-based JSON editor - http://t.co/M70snaIf",
"from_user": "Leolik"
}
]
</pre></div>
</div>
<hr />
<p>Next, let&#8217;s try getting the URLs out of those API results as well. In each tweet, the Twitter API includes a field called &#8220;entities&#8221; which looks like this:</p>
<pre><code>{
&quot;user_mentions&quot;: [],
&quot;urls&quot;: [{
&quot;indices&quot;: [83, 103],
&quot;display_url&quot;: &quot;bit.ly/StniqT&quot;,
&quot;expanded_url&quot;: &quot;http://bit.ly/StniqT&quot;,
&quot;url&quot;: &quot;http://t.co/28Jesbio&quot;
}],
&quot;hashtags&quot;: [
{&quot;indices&quot;: [108, 114], &quot;text&quot;: &quot;Apple&quot; },
{&quot;indices&quot;: [121, 129], &quot;text&quot;: &quot;Awesome&quot;}
]
}</code></pre>
<p>We want to pull out all of the &#8220;url&#8221; fields inside that array of url objects, and make a simple list of strings to go along with the &#8220;from_user&#8221; and &#8220;text&#8221; fields we already have.</p>
<div class="tutorial-example">
<div class="accordion-heading">
<pre>jq '.results[] | {from_user, text, urls: [.entities.urls[].url]}'</pre>
<a data-toggle="collapse" href="#result7">Show result</a>
</div>
<div id="result7" class="accordion-body collapse"><pre>{
"urls": [
"http://t.co/XRvh1ZVw"
],
"text": "RT @imagemechanics: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt;.\nhttp://t.co/XRvh1ZVw",
"from_user": "_AaronNg"
}
{
"urls": [
"http://t.co/Lhp92IqD"
],
"text": "RT @_kud: iPhone 5 website teardown: How Apple compresses video using JPEG, JSON, and &lt;canvas&gt; -- http://t.co/Lhp92IqD",
"from_user": "blouerat"
}
{
"urls": [
"http://t.co/7KALdWaX"
],
"text": "Dynamic Forms Mobile App by pmadiset: Few Forms details are hosted on our server in the form of JSON. This JSON ... http://t.co/7KALdWaX",
"from_user": "cebu_iphone"
}
{
"urls": [
"http://t.co/28Jesbio"
],
"text": "iPhone 5 website insanity - Video compressing using JPEG, JSON, and &lt;canvas&gt; http://t.co/28Jesbio (Oh #Apple, U So #Awesome...)",
"from_user": "dieswaytoofast"
}
{
"urls": [
"http://t.co/M70snaIf"
],
"text": "RT @umutm: A very nice web-based JSON editor - http://t.co/M70snaIf",
"from_user": "Leolik"
}
</pre></div>
</div>
<p>Here we&#8217;re making an object as before, but this time the urls field is being set to <code>[.entities.urls[].url]</code>, which collects all of the URLs defined in the entities object.</p>
<hr />
<p>Here endeth the tutorial! There&#8217;s lots more to play with, go read <a href='/manual'>the manual</a> if you&#8217;re interested, and <a href='/download'>download jq</a> if you haven&#8217;t already.</p>
</div>
</div>
<footer>
<div class="container">
<p>This website is made with <a href='http://www.tinytree.info'>Bonsai</a> and <a href='http://twitter.github.com/bootstrap/'>Twitter Boostrap</a>. jq is licensed under the MIT license (code) and the <a href='http://creativecommons.org/licenses/by/3.0/'>CC-BY-3.0</a> license (docs).</p>
</div>
</footer>
</body>
</html>