Commit 365a0b58eaf04858adec331f35fe770c1ff03b18

Authored by Tariq Islam
2 parents e1026d92 d4bd994f

Merge pull request #435 from tripit/dev

Thanks @lord and everyone contributing! Slate v1.3 ftw!
.gitignore
... ... @@ -14,9 +14,11 @@ tmp
14 14 *.DS_STORE
15 15 build/
16 16 .cache
  17 +.vagrant
  18 +.sass-cache
17 19  
18 20 # YARD artifacts
19 21 .yardoc
20 22 _yardoc
21 23 doc/
22   -.idea/
23 24 \ No newline at end of file
  25 +.idea/
... ...
.travis.yml
... ... @@ -3,7 +3,8 @@ sudo: false
3 3 language: ruby
4 4  
5 5 rvm:
6   - - 1.9.3
7 6 - 2.0.0
  7 + - 2.1.0
8 8  
9 9 cache: bundler
  10 +script: bundle exec middleman build
... ...
CHANGELOG.md
1 1 # Changelog
2 2  
  3 +## Version 1.3
  4 +
  5 +*January 27th, 2016*
  6 +
  7 +We've upgraded Middleman and a number of other dependencies, which should fix quite a few bugs.
  8 +
  9 +Instead of `rake build` and `rake deploy`, you should now run `bundle exec middleman build --clean` to build your server, and `./deploy.sh` to deploy it to Github Pages.
  10 +
3 11 ## Version 1.2
4 12  
5 13 *June 20, 2015*
... ...
CONTRIBUTING.md
1   -# Contributing to Slate
  1 +# Before You Submit an Issue
2 2  
3   -Thanks for contributing to Slate! A couple of quick guidelines for submitting PRs:
  3 +- Are you using Windows? We unfortunately don't support Windows. You could try using Docker, as outlined in the `README`.
  4 +- Is your version of Slate out of date? We have [upgrade instructions](https://github.com/tripit/slate/wiki/Updating-Slate) in the wiki. You could also try seeing if your problem is reproducible on the latest version of Slate.
4 5  
5   -- Please point your pull requests at the `dev` branch, and keep your commit messages clear and informative.
  6 +If you answered "no" to each of the questions above, feel free to submit an issue! It's also helpful if you include a code example of your problem (if applicable), we can't help you if you just say "Slate stopped loading for me once I added my documentation" without telling us the problematic documentation.
  7 +
  8 +# Before You Submit a Pull Request
  9 +
  10 +Thanks for contributing to Slate! A couple of quick guidelines for submitting pull requests:
  11 +
  12 +- **Please point your pull requests at the `dev` branch.** We don't accept pull requests to `master`.
6 13 - Please make sure your contributions work in the most recent version of Chrome, Firefox, and IE.
7 14 - If you're implementing a new feature, even if it's relatively small, it's nice to open an issue before you start so that others know what you're working on and can help make sure you're on the right track.
8 15  
... ...
Dockerfile deleted
1   -FROM ubuntu:trusty
2   -
3   -RUN apt-get update
4   -RUN apt-get install -yq ruby ruby-dev build-essential git
5   -RUN gem install --no-ri --no-rdoc bundler
6   -ADD Gemfile /app/Gemfile
7   -ADD Gemfile.lock /app/Gemfile.lock
8   -RUN cd /app; bundle install
9   -ADD . /app
10   -EXPOSE 4567
11   -WORKDIR /app
12   -CMD ["bundle", "exec", "middleman", "server"]
1 1 source 'https://rubygems.org'
2 2  
3 3 # Middleman
4   -gem 'middleman', '~>3.3.10'
  4 +gem 'middleman', '~>4.0.0'
5 5 gem 'middleman-gh-pages', '~> 0.0.3'
6   -gem 'middleman-syntax', '~> 2.0.0'
7   -gem 'middleman-autoprefixer', '~> 2.4.4'
8   -gem 'rouge', '~> 1.9.0'
  6 +gem 'middleman-syntax', '~> 2.1.0'
  7 +gem 'middleman-autoprefixer', '~> 2.7.0'
  8 +gem "middleman-sprockets", "~> 4.0.0.rc"
  9 +gem 'rouge', '~> 1.10.1'
9 10 gem 'redcarpet', '~> 3.3.2'
10   -
11   -gem 'rake', '~> 10.4.2'
12   -gem 'therubyracer', '~> 0.12.1', platforms: :ruby
... ...
Gemfile.lock
1 1 GEM
2 2 remote: https://rubygems.org/
3 3 specs:
4   - activesupport (4.1.11)
5   - i18n (~> 0.6, >= 0.6.9)
  4 + activesupport (4.2.5.1)
  5 + i18n (~> 0.7)
6 6 json (~> 1.7, >= 1.7.7)
7 7 minitest (~> 5.1)
8   - thread_safe (~> 0.1)
  8 + thread_safe (~> 0.3, >= 0.3.4)
9 9 tzinfo (~> 1.1)
10   - autoprefixer-rails (5.2.0.1)
  10 + addressable (2.4.0)
  11 + autoprefixer-rails (6.3.1)
11 12 execjs
12 13 json
13   - celluloid (0.16.0)
14   - timers (~> 4.0.0)
15   - chunky_png (1.3.4)
  14 + backports (3.6.7)
  15 + capybara (2.5.0)
  16 + mime-types (>= 1.16)
  17 + nokogiri (>= 1.3.3)
  18 + rack (>= 1.0.0)
  19 + rack-test (>= 0.5.4)
  20 + xpath (~> 2.0)
16 21 coffee-script (2.4.1)
17 22 coffee-script-source
18 23 execjs
19   - coffee-script-source (1.9.1.1)
20   - compass (1.0.3)
21   - chunky_png (~> 1.2)
22   - compass-core (~> 1.0.2)
23   - compass-import-once (~> 1.0.5)
24   - rb-fsevent (>= 0.9.3)
25   - rb-inotify (>= 0.9)
26   - sass (>= 3.3.13, < 3.5)
27   - compass-core (1.0.3)
28   - multi_json (~> 1.0)
29   - sass (>= 3.3.0, < 3.5)
  24 + coffee-script-source (1.10.0)
30 25 compass-import-once (1.0.5)
31 26 sass (>= 3.2, < 3.5)
  27 + concurrent-ruby (0.9.2)
  28 + contracts (0.12.0)
32 29 erubis (2.7.0)
33   - execjs (2.5.2)
34   - ffi (1.9.8)
35   - haml (4.0.6)
  30 + execjs (2.6.0)
  31 + fastimage (1.8.1)
  32 + addressable (~> 2.3, >= 2.3.5)
  33 + ffi (1.9.10)
  34 + haml (4.0.7)
36 35 tilt
37   - hike (1.2.3)
38   - hitimes (1.2.2)
39   - hooks (0.4.0)
40   - uber (~> 0.0.4)
  36 + hamster (2.0.0)
  37 + concurrent-ruby (~> 0.8)
  38 + hashie (3.4.3)
41 39 i18n (0.7.0)
42 40 json (1.8.3)
43   - kramdown (1.7.0)
44   - libv8 (3.16.14.7)
45   - listen (2.10.1)
46   - celluloid (~> 0.16.0)
  41 + kramdown (1.9.0)
  42 + listen (3.0.5)
47 43 rb-fsevent (>= 0.9.3)
48 44 rb-inotify (>= 0.9)
49   - middleman (3.3.12)
  45 + middleman (4.0.0)
50 46 coffee-script (~> 2.2)
51   - compass (>= 1.0.0, < 2.0.0)
52 47 compass-import-once (= 1.0.5)
53   - execjs (~> 2.0)
54 48 haml (>= 4.0.5)
55 49 kramdown (~> 1.2)
56   - middleman-core (= 3.3.12)
57   - middleman-sprockets (>= 3.1.2)
  50 + middleman-cli (= 4.0.0)
  51 + middleman-core (= 4.0.0)
58 52 sass (>= 3.4.0, < 4.0)
59   - uglifier (~> 2.5)
60   - middleman-autoprefixer (2.4.4)
61   - autoprefixer-rails (~> 5.2.0)
  53 + middleman-autoprefixer (2.7.0)
  54 + autoprefixer-rails (>= 6.3.1, < 7.0.0)
62 55 middleman-core (>= 3.3.3)
63   - middleman-core (3.3.12)
64   - activesupport (~> 4.1.0)
  56 + middleman-cli (4.0.0)
  57 + thor (>= 0.17.0, < 2.0)
  58 + middleman-core (4.0.0)
  59 + activesupport (~> 4.2)
  60 + addressable (~> 2.4.0)
  61 + backports (~> 3.6)
65 62 bundler (~> 1.1)
  63 + capybara (~> 2.5.0)
  64 + contracts (~> 0.12.0)
66 65 erubis
67   - hooks (~> 0.3)
  66 + execjs (~> 2.0)
  67 + fastimage (~> 1.8)
  68 + hamster (~> 2.0)
  69 + hashie (~> 3.4)
68 70 i18n (~> 0.7.0)
69   - listen (>= 2.7.9, < 3.0)
70   - padrino-helpers (~> 0.12.3)
  71 + listen (~> 3.0)
  72 + padrino-helpers (~> 0.13.0)
71 73 rack (>= 1.4.5, < 2.0)
72   - rack-test (~> 0.6.2)
73   - thor (>= 0.15.2, < 2.0)
74   - tilt (~> 1.4.1, < 2.0)
  74 + sass (>= 3.4)
  75 + tilt (~> 1.4.1)
  76 + uglifier (~> 2.6)
75 77 middleman-gh-pages (0.0.3)
76 78 rake (> 0.9.3)
77   - middleman-sprockets (3.4.2)
78   - middleman-core (>= 3.3)
79   - sprockets (~> 2.12.1)
80   - sprockets-helpers (~> 1.1.0)
81   - sprockets-sass (~> 1.3.0)
82   - middleman-syntax (2.0.0)
83   - middleman-core (~> 3.2)
  79 + middleman-sprockets (4.0.0.rc.1)
  80 + middleman-core (>= 4.0.0.rc.1)
  81 + sprockets (~> 3.0)
  82 + middleman-syntax (2.1.0)
  83 + middleman-core (>= 3.2)
84 84 rouge (~> 1.0)
85   - minitest (5.7.0)
86   - multi_json (1.11.1)
87   - padrino-helpers (0.12.5)
  85 + mime-types (3.0)
  86 + mime-types-data (~> 3.2015)
  87 + mime-types-data (3.2015.1120)
  88 + mini_portile2 (2.0.0)
  89 + minitest (5.8.4)
  90 + nokogiri (1.6.7.2)
  91 + mini_portile2 (~> 2.0.0.rc2)
  92 + padrino-helpers (0.13.1)
88 93 i18n (~> 0.6, >= 0.6.7)
89   - padrino-support (= 0.12.5)
  94 + padrino-support (= 0.13.1)
90 95 tilt (~> 1.4.1)
91   - padrino-support (0.12.5)
  96 + padrino-support (0.13.1)
92 97 activesupport (>= 3.1)
93 98 rack (1.6.4)
94 99 rack-test (0.6.3)
95 100 rack (>= 1.0)
96 101 rake (10.4.2)
97   - rb-fsevent (0.9.5)
  102 + rb-fsevent (0.9.7)
98 103 rb-inotify (0.9.5)
99 104 ffi (>= 0.5.0)
100   - redcarpet (3.3.2)
101   - ref (1.0.5)
102   - rouge (1.9.0)
103   - sass (3.4.14)
104   - sprockets (2.12.3)
105   - hike (~> 1.2)
106   - multi_json (~> 1.0)
107   - rack (~> 1.0)
108   - tilt (~> 1.1, != 1.3.0)
109   - sprockets-helpers (1.1.0)
110   - sprockets (~> 2.0)
111   - sprockets-sass (1.3.1)
112   - sprockets (~> 2.0)
113   - tilt (~> 1.1)
114   - therubyracer (0.12.2)
115   - libv8 (~> 3.16.14.0)
116   - ref
  105 + redcarpet (3.3.4)
  106 + rouge (1.10.1)
  107 + sass (3.4.21)
  108 + sprockets (3.4.1)
  109 + rack (> 1, < 3)
117 110 thor (0.19.1)
118 111 thread_safe (0.3.5)
119 112 tilt (1.4.1)
120   - timers (4.0.1)
121   - hitimes
122 113 tzinfo (1.2.2)
123 114 thread_safe (~> 0.1)
124   - uber (0.0.13)
125   - uglifier (2.7.1)
  115 + uglifier (2.7.2)
126 116 execjs (>= 0.3.0)
127 117 json (>= 1.8.0)
  118 + xpath (2.0.0)
  119 + nokogiri (~> 1.3)
128 120  
129 121 PLATFORMS
130 122 ruby
131 123  
132 124 DEPENDENCIES
133   - middleman (~> 3.3.10)
134   - middleman-autoprefixer (~> 2.4.4)
  125 + middleman (~> 4.0.0)
  126 + middleman-autoprefixer (~> 2.7.0)
135 127 middleman-gh-pages (~> 0.0.3)
136   - middleman-syntax (~> 2.0.0)
137   - rake (~> 10.4.2)
  128 + middleman-sprockets (~> 4.0.0.rc)
  129 + middleman-syntax (~> 2.1.0)
138 130 redcarpet (~> 3.3.2)
139   - rouge (~> 1.9.0)
140   - therubyracer (~> 0.12.1)
  131 + rouge (~> 1.10.1)
  132 +
  133 +BUNDLED WITH
  134 + 1.10.6
... ...
README.md
1   -Slate
2   -========
  1 +<p align="center">
  2 + <img src="https://raw.githubusercontent.com/lord/img/master/logo-slate.png" alt="Slate: API Documentation Generator" width="226">
  3 + <br>
  4 + <a href="https://travis-ci.org/tripit/slate"><img src="https://travis-ci.org/tripit/slate.svg?branch=master" alt="Build Status"></a>
  5 +</p>
3 6  
4   -[![Build Status](https://travis-ci.org/tripit/slate.svg?branch=master)](https://travis-ci.org/tripit/slate) [![Dependency Status](https://gemnasium.com/tripit/slate.png)](https://gemnasium.com/tripit/slate)
  7 +<p align="center">Slate helps you create beautiful, intelligent, responsive API documentation.</p>
5 8  
6   -Slate helps you create beautiful API documentation. Think of it as an intelligent, responsive documentation template for your API.
  9 +<p align="center"><img src="https://dl.dropboxusercontent.com/u/95847291/github%20images/slate/slate_screenshot_new.png" width=700 alt="Screenshot of Example Documentation created with Slate"></p>
7 10  
8   -<img src="https://dl.dropboxusercontent.com/u/95847291/github%20images/slate/slate_screenshot_new.png" width=700 alt="Screenshot of Example Documentation created with Slate">
9   -
10   -*The example above was created with Slate. Check it out at [tripit.github.io/slate](http://tripit.github.io/slate).*
  11 +<p align="center"><em>The example above was created with Slate. Check it out at <a href="https://tripit.github.io/slate">tripit.github.io/slate</a>.</em></p>
11 12  
12 13 Features
13 14 ------------
14 15  
15   -* **Clean, intuitive design** — with Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [Paypal's](https://developer.paypal.com/webapps/developer/docs/api/) API docs. Slate is responsive, so it looks great on tablets, phones, and even print.
  16 +* **Clean, intuitive design** — With Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [Paypal's](https://developer.paypal.com/webapps/developer/docs/api/) API docs. Slate is responsive, so it looks great on tablets, phones, and even in print.
16 17  
17   -* **Everything on a single page** — gone are the days where your users had to search through a million pages to find what they wanted. Slate puts the entire documentation on a single page. We haven't sacrificed linkability, though. As you scroll, your browser's hash will update to the nearest header, so linking to a particular point in the documentation is still natural and easy.
  18 +* **Everything on a single page** — Gone are the days when your users had to search through a million pages to find what they wanted. Slate puts the entire documentation on a single page. We haven't sacrificed linkability, though. As you scroll, your browser's hash will update to the nearest header, so linking to a particular point in the documentation is still natural and easy.
18 19  
19   -* **Slate is just Markdown** — when you write docs with Slate, you're just writing Markdown, which makes it simple to edit and understand. Everything is written in Markdown — even the code samples are just Markdown code blocks!
  20 +* **Slate is just Markdown** — When you write docs with Slate, you're just writing Markdown, which makes it simple to edit and understand. Everything is written in Markdown — even the code samples are just Markdown code blocks.
20 21  
21   -* **Write code samples in multiple languages** — if your API has bindings in multiple programming languages, you easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown!
  22 +* **Write code samples in multiple languages** — If your API has bindings in multiple programming languages, you can easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown.
22 23  
23 24 * **Out-of-the-box syntax highlighting** for [almost 60 languages](http://rouge.jayferd.us/demo), no configuration required.
24 25  
25 26 * **Automatic, smoothly scrolling table of contents** on the far left of the page. As you scroll, it displays your current position in the document. It's fast, too. We're using Slate at TripIt to build documentation for our new API, where our table of contents has over 180 entries. We've made sure that the performance remains excellent, even for larger documents.
26 27  
27   -* **Let your users update your documentation for you** — by default, your Slate-generated documentation is hosted in a public Github repository. Not only does this mean you get free hosting for your docs with Github Pages, but it also makes it's simple for other developers to make pull requests to your docs if they find typos or other problems. Of course, if you don't want to, you're welcome to not use Github and host your docs elsewhere!
  28 +* **Let your users update your documentation for you** — By default, your Slate-generated documentation is hosted in a public Github repository. Not only does this mean you get free hosting for your docs with Github Pages, but it also makes it simple for other developers to make pull requests to your docs if they find typos or other problems. Of course, if you don't want to use GitHub, you're also welcome to host your docs elsewhere.
28 29  
29   -Getting starting with Slate is super easy! Simply fork this repository, and then follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](http://tripit.github.io/slate).
  30 +Getting started with Slate is super easy! Simply fork this repository and follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](http://tripit.github.io/slate).
30 31  
31 32 <!--As an example, you can check out the [TripIt API docs](http://tripit.github.io/api), which we create with Slate. You can also view the source of the [markdown file used to generate it](http://github.com/tripit/api/blob/master/source/index.md).-->
32 33  
... ... @@ -43,76 +44,49 @@ You&#39;re going to need:
43 44  
44 45 ### Getting Set Up
45 46  
46   - 1. Fork this repository on Github.
47   - 2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git`
48   - 3. `cd slate`
49   - 4. Install all dependencies: `bundle install`
50   - 5. Start the test server: `bundle exec middleman server`
51   -
52   -Or use the included Dockerfile! (must install Docker first)
  47 +1. Fork this repository on Github.
  48 +2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git`
  49 +3. `cd slate`
  50 +4. Initialize and start Slate. You can either do this locally, or with Vagrant:
53 51  
54 52 ```shell
55   -docker build -t slate .
56   -docker run -d -p 4567:4567 --name slate -v $(pwd)/source:/app/source slate
57   -```
  53 +# either run this to run locally
  54 +bundle install
  55 +bundle exec middleman server
58 56  
59   -You can now see the docs at <http://localhost:4567>. Whoa! That was fast!
  57 +# OR run this to run with vagrant
  58 +vagrant up
  59 +```
60 60  
61   -*Note: if you're using the Docker setup on OSX, the docs will be
62   -available at the output of `docker-machine ip <machine-name>` (port: 4567) instead of `localhost:4567`.*
  61 +You can now see the docs at http://localhost:4567. Whoa! That was fast!
63 62  
64 63 Now that Slate is all set up your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/tripit/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/tripit/slate/wiki/Deploying-Slate).
65 64  
66   -Examples of Slate in the Wild
  65 +Companies Using Slate
67 66 ---------------------------------
68 67  
69   -* [Travis-CI's API docs](http://docs.travis-ci.com/api/)
70   -* [Mozilla's localForage docs](http://mozilla.github.io/localForage/)
71   -* [Mozilla Recroom](http://mozilla.github.io/recroom/)
72   -* [Drcaban's Build a Quine tutorial](http://drcabana.github.io/build-a-quine/#introduction)
73   -* [PricePlow API docs](https://www.priceplow.com/api/documentation)
74   -* [Emerging Threats API docs](http://apidocs.emergingthreats.net/)
75   -* [Appium docs](http://appium.io/slate/en/master)
76   -* [Golazon Developer](http://developer.golazon.com)
77   -* [Dwolla API docs](https://docs.dwolla.com/)
78   -* [RozpisyZapasu API docs](http://www.rozpisyzapasu.cz/dev/api/)
79   -* [Codestar Framework Docs](http://codestarframework.com/documentation/)
80   -* [Buddycloud API](http://buddycloud.com/api)
81   -* [Crafty Clicks API](https://craftyclicks.co.uk/api/)
82   -* [Paracel API Reference](http://paracel.io/docs/api_reference.html)
83   -* [Switch Payments Documentation](http://switchpayments.com/docs/) & [API](http://switchpayments.com/developers/)
84   -* [Coinbase API Reference](https://developers.coinbase.com/api)
85   -* [Whispir.io API](https://whispir.github.io/api)
86   -* [NASA API](https://data.nasa.gov/developer/external/planetary/)
87   -* [CardPay API](https://developers.cardpay.com/)
  68 +* [NASA](https://api.nasa.gov)
88 69 * [IBM Cloudant](https://docs.cloudant.com/api.html)
89   -* [Bitrix basis components](http://bbc.bitrix.expert/)
90   -* [viagogo API Documentation](http://developer.viagogo.net/)
91   -* [Fidor Bank API Documentation](http://docs.fidor.de/)
92   -* [Market Prophit API Documentation](http://developer.marketprophit.com/)
93   -* [OAuth.io API Documentation](http://docs.oauth.io/)
94   -* [Aircall for Developers](http://developer.aircall.io/)
95   -* [SupportKit API Docs](http://docs.supportkit.io/)
96   -* [SocialRadar's LocationKit Docs](https://docs.locationkit.io/)
97   -* [SafetyCulture API Documentation](https://developer.safetyculture.io/)
98   -* [hosting.de API Documentation](https://www.hosting.de/docs/api/)
99   -* [BlockCypher's API Documentation](http://dev.blockcypher.com)
100   -* [InterServer API Documentation](https://my.interserver.net/apidoc/)
101   -* [ActionHeroJS's API Documentation](http://www.actionherojs.com/docs)
102   -* [Augur API Documentation](http://docs.augur.net)
103   -
104   -(Feel free to add your site to this list in a pull request!)
  70 +* [Travis-CI](https://docs.travis-ci.com/api/)
  71 +* [Mozilla](http://mozilla.github.io/localForage/)
  72 +* [Appium](http://appium.io/slate/en/master)
  73 +* [Dwolla](https://docs.dwolla.com/)
  74 +* [Clearbit](https://clearbit.com/docs)
  75 +* [Coinbase](https://developers.coinbase.com/api)
  76 +* [Parrot Drones](http://developer.parrot.com/docs/bebop/)
  77 +* [Fidor Bank](http://docs.fidor.de/)
  78 +
  79 +You can view more in [the list on the wiki](https://github.com/tripit/slate/wiki/Slate-in-the-Wild).
105 80  
106 81 Need Help? Found a bug?
107 82 --------------------
108 83  
109   -Just [submit a issue](https://github.com/tripit/slate/issues) to the Slate Github if you need any help. And, of course, feel free to submit pull requests with bug fixes or changes.
110   -
  84 +Read our [contribution guidelines](https://github.com/tripit/slate/blob/master/CONTRIBUTING.md), and then [submit a issue](https://github.com/tripit/slate/issues) to the Slate Github if you need any help. And, of course, feel free to submit pull requests with bug fixes or changes.
111 85  
112 86 Contributors
113 87 --------------------
114 88  
115   -Slate was built by [Robert Lord](https://lord.io) while at [TripIt](http://tripit.com).
  89 +Slate was built by [Robert Lord](https://lord.io) while at [TripIt](https://www.tripit.com/).
116 90  
117 91 Thanks to the following people who have submitted major pull requests:
118 92  
... ... @@ -127,5 +101,5 @@ Special Thanks
127 101 - [Middleman](https://github.com/middleman/middleman)
128 102 - [jquery.tocify.js](https://github.com/gfranko/jquery.tocify.js)
129 103 - [middleman-syntax](https://github.com/middleman/middleman-syntax)
130   -- [middleman-gh-pages](https://github.com/neo/middleman-gh-pages)
  104 +- [middleman-gh-pages](https://github.com/edgecase/middleman-gh-pages)
131 105 - [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
... ...
Rakefile deleted
1   -require 'middleman-gh-pages'
2   -require 'rake/clean'
3   -
4   -CLOBBER.include('build')
5   -
6   -task :default => [:build]
Vagrantfile 0 → 100644
  1 +Vagrant.configure(2) do |config|
  2 + config.vm.box = "ubuntu/trusty64"
  3 + config.vm.network :forwarded_port, guest: 4567, host: 4567
  4 +
  5 + config.vm.provision "bootstrap",
  6 + type: "shell",
  7 + inline: <<-SHELL
  8 + sudo apt-get update
  9 + sudo apt-get install -yq ruby2.0 ruby2.0-dev pkg-config build-essential nodejs git libxml2-dev libxslt-dev
  10 + sudo apt-get autoremove -yq
  11 + gem2.0 install --no-ri --no-rdoc bundler
  12 + SHELL
  13 +
  14 + # add the local user git config to the vm
  15 + config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
  16 +
  17 + config.vm.provision "install",
  18 + type: "shell",
  19 + privileged: false,
  20 + inline: <<-SHELL
  21 + echo "=============================================="
  22 + echo "Installing app dependencies"
  23 + cd /vagrant
  24 + bundle config build.nokogiri --use-system-libraries
  25 + bundle install
  26 + SHELL
  27 +
  28 + config.vm.provision "run",
  29 + type: "shell",
  30 + privileged: false,
  31 + run: "always",
  32 + inline: <<-SHELL
  33 + echo "=============================================="
  34 + echo "Starting up middleman at http://localhost:4567"
  35 + echo "If it does not come up, check the ~/middleman.log file for any error messages"
  36 + cd /vagrant
  37 + bundle exec middleman server --force-polling -l 1 &> ~/middleman.log &
  38 + SHELL
  39 +end
... ...
config.rb
... ... @@ -30,6 +30,8 @@ set :relative_links, true
30 30  
31 31 # Build Configuration
32 32 configure :build do
  33 + # If you're having trouble with Middleman hanging, commenting
  34 + # out the following two lines has been known to help
33 35 activate :minify_css
34 36 activate :minify_javascript
35 37 # activate :relative_assets
... ...
deploy.sh 0 → 100755
  1 +#!/usr/bin/env bash
  2 +set -o errexit #abort if any command fails
  3 +me=$(basename "$0")
  4 +
  5 +help_message="\
  6 +Usage: $me [-c FILE] [<options>]
  7 +Deploy generated files to a git branch.
  8 +
  9 +Options:
  10 +
  11 + -h, --help Show this help information.
  12 + -v, --verbose Increase verbosity. Useful for debugging.
  13 + -e, --allow-empty Allow deployment of an empty directory.
  14 + -m, --message MESSAGE Specify the message used when committing on the
  15 + deploy branch.
  16 + -n, --no-hash Don't append the source commit's hash to the deploy
  17 + commit's message.
  18 + -c, --config-file PATH Override default & environment variables' values
  19 + with those in set in the file at 'PATH'. Must be the
  20 + first option specified.
  21 +
  22 +Variables:
  23 +
  24 + GIT_DEPLOY_DIR Folder path containing the files to deploy.
  25 + GIT_DEPLOY_BRANCH Commit deployable files to this branch.
  26 + GIT_DEPLOY_REPO Push the deploy branch to this repository.
  27 +
  28 +These variables have default values defined in the script. The defaults can be
  29 +overridden by environment variables. Any environment variables are overridden
  30 +by values set in a '.env' file (if it exists), and in turn by those set in a
  31 +file specified by the '--config-file' option."
  32 +
  33 +bundle exec middleman build --clean
  34 +
  35 +parse_args() {
  36 + # Set args from a local environment file.
  37 + if [ -e ".env" ]; then
  38 + source .env
  39 + fi
  40 +
  41 + # Set args from file specified on the command-line.
  42 + if [[ $1 = "-c" || $1 = "--config-file" ]]; then
  43 + source "$2"
  44 + shift 2
  45 + fi
  46 +
  47 + # Parse arg flags
  48 + # If something is exposed as an environment variable, set/overwrite it
  49 + # here. Otherwise, set/overwrite the internal variable instead.
  50 + while : ; do
  51 + if [[ $1 = "-h" || $1 = "--help" ]]; then
  52 + echo "$help_message"
  53 + return 0
  54 + elif [[ $1 = "-v" || $1 = "--verbose" ]]; then
  55 + verbose=true
  56 + shift
  57 + elif [[ $1 = "-e" || $1 = "--allow-empty" ]]; then
  58 + allow_empty=true
  59 + shift
  60 + elif [[ ( $1 = "-m" || $1 = "--message" ) && -n $2 ]]; then
  61 + commit_message=$2
  62 + shift 2
  63 + elif [[ $1 = "-n" || $1 = "--no-hash" ]]; then
  64 + GIT_DEPLOY_APPEND_HASH=false
  65 + shift
  66 + else
  67 + break
  68 + fi
  69 + done
  70 +
  71 + # Set internal option vars from the environment and arg flags. All internal
  72 + # vars should be declared here, with sane defaults if applicable.
  73 +
  74 + # Source directory & target branch.
  75 + deploy_directory=build
  76 + deploy_branch=gh-pages
  77 +
  78 + #if no user identity is already set in the current git environment, use this:
  79 + default_username=${GIT_DEPLOY_USERNAME:-deploy.sh}
  80 + default_email=${GIT_DEPLOY_EMAIL:-}
  81 +
  82 + #repository to deploy to. must be readable and writable.
  83 + repo=origin
  84 +
  85 + #append commit hash to the end of message by default
  86 + append_hash=${GIT_DEPLOY_APPEND_HASH:-true}
  87 +}
  88 +
  89 +main() {
  90 + parse_args "$@"
  91 +
  92 + enable_expanded_output
  93 +
  94 + if ! git diff --exit-code --quiet --cached; then
  95 + echo Aborting due to uncommitted changes in the index >&2
  96 + return 1
  97 + fi
  98 +
  99 + commit_title=`git log -n 1 --format="%s" HEAD`
  100 + commit_hash=` git log -n 1 --format="%H" HEAD`
  101 +
  102 + #default commit message uses last title if a custom one is not supplied
  103 + if [[ -z $commit_message ]]; then
  104 + commit_message="publish: $commit_title"
  105 + fi
  106 +
  107 + #append hash to commit message unless no hash flag was found
  108 + if [ $append_hash = true ]; then
  109 + commit_message="$commit_message"$'\n\n'"generated from commit $commit_hash"
  110 + fi
  111 +
  112 + previous_branch=`git rev-parse --abbrev-ref HEAD`
  113 +
  114 + if [ ! -d "$deploy_directory" ]; then
  115 + echo "Deploy directory '$deploy_directory' does not exist. Aborting." >&2
  116 + return 1
  117 + fi
  118 +
  119 + # must use short form of flag in ls for compatibility with OS X and BSD
  120 + if [[ -z `ls -A "$deploy_directory" 2> /dev/null` && -z $allow_empty ]]; then
  121 + echo "Deploy directory '$deploy_directory' is empty. Aborting. If you're sure you want to deploy an empty tree, use the --allow-empty / -e flag." >&2
  122 + return 1
  123 + fi
  124 +
  125 + if git ls-remote --exit-code $repo "refs/heads/$deploy_branch" ; then
  126 + # deploy_branch exists in $repo; make sure we have the latest version
  127 +
  128 + disable_expanded_output
  129 + git fetch --force $repo $deploy_branch:$deploy_branch
  130 + enable_expanded_output
  131 + fi
  132 +
  133 + # check if deploy_branch exists locally
  134 + if git show-ref --verify --quiet "refs/heads/$deploy_branch"
  135 + then incremental_deploy
  136 + else initial_deploy
  137 + fi
  138 +
  139 + restore_head
  140 +}
  141 +
  142 +initial_deploy() {
  143 + git --work-tree "$deploy_directory" checkout --orphan $deploy_branch
  144 + git --work-tree "$deploy_directory" add --all
  145 + commit+push
  146 +}
  147 +
  148 +incremental_deploy() {
  149 + #make deploy_branch the current branch
  150 + git symbolic-ref HEAD refs/heads/$deploy_branch
  151 + #put the previously committed contents of deploy_branch into the index
  152 + git --work-tree "$deploy_directory" reset --mixed --quiet
  153 + git --work-tree "$deploy_directory" add --all
  154 +
  155 + set +o errexit
  156 + diff=$(git --work-tree "$deploy_directory" diff --exit-code --quiet HEAD --)$?
  157 + set -o errexit
  158 + case $diff in
  159 + 0) echo No changes to files in $deploy_directory. Skipping commit.;;
  160 + 1) commit+push;;
  161 + *)
  162 + echo git diff exited with code $diff. Aborting. Staying on branch $deploy_branch so you can debug. To switch back to master, use: git symbolic-ref HEAD refs/heads/master && git reset --mixed >&2
  163 + return $diff
  164 + ;;
  165 + esac
  166 +}
  167 +
  168 +commit+push() {
  169 + set_user_id
  170 + git --work-tree "$deploy_directory" commit -m "$commit_message"
  171 +
  172 + disable_expanded_output
  173 + #--quiet is important here to avoid outputting the repo URL, which may contain a secret token
  174 + git push --quiet $repo $deploy_branch
  175 + enable_expanded_output
  176 +}
  177 +
  178 +#echo expanded commands as they are executed (for debugging)
  179 +enable_expanded_output() {
  180 + if [ $verbose ]; then
  181 + set -o xtrace
  182 + set +o verbose
  183 + fi
  184 +}
  185 +
  186 +#this is used to avoid outputting the repo URL, which may contain a secret token
  187 +disable_expanded_output() {
  188 + if [ $verbose ]; then
  189 + set +o xtrace
  190 + set -o verbose
  191 + fi
  192 +}
  193 +
  194 +set_user_id() {
  195 + if [[ -z `git config user.name` ]]; then
  196 + git config user.name "$default_username"
  197 + fi
  198 + if [[ -z `git config user.email` ]]; then
  199 + git config user.email "$default_email"
  200 + fi
  201 +}
  202 +
  203 +restore_head() {
  204 + if [[ $previous_branch = "HEAD" ]]; then
  205 + #we weren't on any branch before, so just set HEAD back to the commit it was on
  206 + git update-ref --no-deref HEAD $commit_hash $deploy_branch
  207 + else
  208 + git symbolic-ref HEAD refs/heads/$previous_branch
  209 + fi
  210 +
  211 + git reset --mixed
  212 +}
  213 +
  214 +filter() {
  215 + sed -e "s|$repo|\$repo|g"
  216 +}
  217 +
  218 +sanitize() {
  219 + "$@" 2> >(filter 1>&2) | filter
  220 +}
  221 +
  222 +[[ $1 = --source-only ]] || main "$@"
0 223 \ No newline at end of file
... ...
source/images/logo.png

3.42 KB | W: | H:

21.8 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
source/index.md renamed to source/index.html.md
... ... @@ -8,7 +8,7 @@ language_tabs:
8 8  
9 9 toc_footers:
10 10 - <a href='#'>Sign Up for a Developer Key</a>
11   - - <a href='http://github.com/tripit/slate'>Documentation Powered by Slate</a>
  11 + - <a href='https://github.com/tripit/slate'>Documentation Powered by Slate</a>
12 12  
13 13 includes:
14 14 - errors
... ... @@ -22,7 +22,7 @@ Welcome to the Kittn API! You can use our API to access Kittn API endpoints, whi
22 22  
23 23 We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
24 24  
25   -This example API documentation page was created with [Slate](http://github.com/tripit/slate). Feel free to edit it and use it as a base for your own API's documentation.
  25 +This example API documentation page was created with [Slate](https://github.com/tripit/slate). Feel free to edit it and use it as a base for your own API's documentation.
26 26  
27 27 # Authentication
28 28  
... ... @@ -154,7 +154,7 @@ curl &quot;http://example.com/api/kittens/2&quot;
154 154  
155 155 This endpoint retrieves a specific kitten.
156 156  
157   -<aside class="warning">If you're not using an administrator API key, note that some kittens will return 403 Forbidden if they are hidden for admins only.</aside>
  157 +<aside class="warning">Inside HTML code blocks like this one, you can't use Markdown, so use <code>&lt;code&gt;</code> blocks to denote code.</aside>
158 158  
159 159 ### HTTP Request
160 160  
... ...
source/javascripts/app/_lang.js
  1 +//= require ../lib/_jquery
  2 +
1 3 /*
2 4 Copyright 2008-2013 Concur Technologies, Inc.
3 5  
... ... @@ -29,8 +31,10 @@ under the License.
29 31 $(".lang-selector a[data-language-name='" + language + "']").addClass('active');
30 32 for (var i=0; i < languages.length; i++) {
31 33 $(".highlight." + languages[i]).hide();
  34 + $(".lang-specific." + languages[i]).hide();
32 35 }
33 36 $(".highlight." + language).show();
  37 + $(".lang-specific." + language).show();
34 38  
35 39 global.toc.calculateHeights();
36 40  
... ...
source/javascripts/app/_search.js
1 1 //= require ../lib/_lunr
  2 +//= require ../lib/_jquery
2 3 //= require ../lib/_jquery.highlight
3 4 (function () {
4 5 'use strict';
... ...
source/javascripts/app/_toc.js
  1 +//= require ../lib/_jquery
1 2 //= require ../lib/_jquery_ui
2 3 //= require ../lib/_jquery.tocify
3 4 //= require ../lib/_imagesloaded.min
... ... @@ -47,6 +48,7 @@
47 48 $(function() {
48 49 makeToc();
49 50 animate();
  51 + setupLanguages($('body').data('languages'));
50 52 $('.content').imagesLoaded( function() {
51 53 global.toc.calculateHeights();
52 54 });
... ...
source/javascripts/lib/_jquery.js 0 → 100644
Changes suppressed. Click to show
  1 +/*!
  2 + * jQuery JavaScript Library v2.2.0
  3 + * http://jquery.com/
  4 + *
  5 + * Includes Sizzle.js
  6 + * http://sizzlejs.com/
  7 + *
  8 + * Copyright jQuery Foundation and other contributors
  9 + * Released under the MIT license
  10 + * http://jquery.org/license
  11 + *
  12 + * Date: 2016-01-08T20:02Z
  13 + */
  14 +
  15 +(function( global, factory ) {
  16 +
  17 + if ( typeof module === "object" && typeof module.exports === "object" ) {
  18 + // For CommonJS and CommonJS-like environments where a proper `window`
  19 + // is present, execute the factory and get jQuery.
  20 + // For environments that do not have a `window` with a `document`
  21 + // (such as Node.js), expose a factory as module.exports.
  22 + // This accentuates the need for the creation of a real `window`.
  23 + // e.g. var jQuery = require("jquery")(window);
  24 + // See ticket #14549 for more info.
  25 + module.exports = global.document ?
  26 + factory( global, true ) :
  27 + function( w ) {
  28 + if ( !w.document ) {
  29 + throw new Error( "jQuery requires a window with a document" );
  30 + }
  31 + return factory( w );
  32 + };
  33 + } else {
  34 + factory( global );
  35 + }
  36 +
  37 +// Pass this if window is not defined yet
  38 +}(typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
  39 +
  40 +// Support: Firefox 18+
  41 +// Can't be in strict mode, several libs including ASP.NET trace
  42 +// the stack via arguments.caller.callee and Firefox dies if
  43 +// you try to trace through "use strict" call chains. (#13335)
  44 +//"use strict";
  45 +var arr = [];
  46 +
  47 +var document = window.document;
  48 +
  49 +var slice = arr.slice;
  50 +
  51 +var concat = arr.concat;
  52 +
  53 +var push = arr.push;
  54 +
  55 +var indexOf = arr.indexOf;
  56 +
  57 +var class2type = {};
  58 +
  59 +var toString = class2type.toString;
  60 +
  61 +var hasOwn = class2type.hasOwnProperty;
  62 +
  63 +var support = {};
  64 +
  65 +
  66 +
  67 +var
  68 + version = "2.2.0",
  69 +
  70 + // Define a local copy of jQuery
  71 + jQuery = function( selector, context ) {
  72 +
  73 + // The jQuery object is actually just the init constructor 'enhanced'
  74 + // Need init if jQuery is called (just allow error to be thrown if not included)
  75 + return new jQuery.fn.init( selector, context );
  76 + },
  77 +
  78 + // Support: Android<4.1
  79 + // Make sure we trim BOM and NBSP
  80 + rtrim = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  81 +
  82 + // Matches dashed string for camelizing
  83 + rmsPrefix = /^-ms-/,
  84 + rdashAlpha = /-([\da-z])/gi,
  85 +
  86 + // Used by jQuery.camelCase as callback to replace()
  87 + fcamelCase = function( all, letter ) {
  88 + return letter.toUpperCase();
  89 + };
  90 +
  91 +jQuery.fn = jQuery.prototype = {
  92 +
  93 + // The current version of jQuery being used
  94 + jquery: version,
  95 +
  96 + constructor: jQuery,
  97 +
  98 + // Start with an empty selector
  99 + selector: "",
  100 +
  101 + // The default length of a jQuery object is 0
  102 + length: 0,
  103 +
  104 + toArray: function() {
  105 + return slice.call( this );
  106 + },
  107 +
  108 + // Get the Nth element in the matched element set OR
  109 + // Get the whole matched element set as a clean array
  110 + get: function( num ) {
  111 + return num != null ?
  112 +
  113 + // Return just the one element from the set
  114 + ( num < 0 ? this[ num + this.length ] : this[ num ] ) :
  115 +
  116 + // Return all the elements in a clean array
  117 + slice.call( this );
  118 + },
  119 +
  120 + // Take an array of elements and push it onto the stack
  121 + // (returning the new matched element set)
  122 + pushStack: function( elems ) {
  123 +
  124 + // Build a new jQuery matched element set
  125 + var ret = jQuery.merge( this.constructor(), elems );
  126 +
  127 + // Add the old object onto the stack (as a reference)
  128 + ret.prevObject = this;
  129 + ret.context = this.context;
  130 +
  131 + // Return the newly-formed element set
  132 + return ret;
  133 + },
  134 +
  135 + // Execute a callback for every element in the matched set.
  136 + each: function( callback ) {
  137 + return jQuery.each( this, callback );
  138 + },
  139 +
  140 + map: function( callback ) {
  141 + return this.pushStack( jQuery.map( this, function( elem, i ) {
  142 + return callback.call( elem, i, elem );
  143 + } ) );
  144 + },
  145 +
  146 + slice: function() {
  147 + return this.pushStack( slice.apply( this, arguments ) );
  148 + },
  149 +
  150 + first: function() {
  151 + return this.eq( 0 );
  152 + },
  153 +
  154 + last: function() {
  155 + return this.eq( -1 );
  156 + },
  157 +
  158 + eq: function( i ) {
  159 + var len = this.length,
  160 + j = +i + ( i < 0 ? len : 0 );
  161 + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] );
  162 + },
  163 +
  164 + end: function() {
  165 + return this.prevObject || this.constructor();
  166 + },
  167 +
  168 + // For internal use only.
  169 + // Behaves like an Array's method, not like a jQuery method.
  170 + push: push,
  171 + sort: arr.sort,
  172 + splice: arr.splice
  173 +};
  174 +
  175 +jQuery.extend = jQuery.fn.extend = function() {
  176 + var options, name, src, copy, copyIsArray, clone,
  177 + target = arguments[ 0 ] || {},
  178 + i = 1,
  179 + length = arguments.length,
  180 + deep = false;
  181 +
  182 + // Handle a deep copy situation
  183 + if ( typeof target === "boolean" ) {
  184 + deep = target;
  185 +
  186 + // Skip the boolean and the target
  187 + target = arguments[ i ] || {};
  188 + i++;
  189 + }
  190 +
  191 + // Handle case when target is a string or something (possible in deep copy)
  192 + if ( typeof target !== "object" && !jQuery.isFunction( target ) ) {
  193 + target = {};
  194 + }
  195 +
  196 + // Extend jQuery itself if only one argument is passed
  197 + if ( i === length ) {
  198 + target = this;
  199 + i--;
  200 + }
  201 +
  202 + for ( ; i < length; i++ ) {
  203 +
  204 + // Only deal with non-null/undefined values
  205 + if ( ( options = arguments[ i ] ) != null ) {
  206 +
  207 + // Extend the base object
  208 + for ( name in options ) {
  209 + src = target[ name ];
  210 + copy = options[ name ];
  211 +
  212 + // Prevent never-ending loop
  213 + if ( target === copy ) {
  214 + continue;
  215 + }
  216 +
  217 + // Recurse if we're merging plain objects or arrays
  218 + if ( deep && copy && ( jQuery.isPlainObject( copy ) ||
  219 + ( copyIsArray = jQuery.isArray( copy ) ) ) ) {
  220 +
  221 + if ( copyIsArray ) {
  222 + copyIsArray = false;
  223 + clone = src && jQuery.isArray( src ) ? src : [];
  224 +
  225 + } else {
  226 + clone = src && jQuery.isPlainObject( src ) ? src : {};
  227 + }
  228 +
  229 + // Never move original objects, clone them
  230 + target[ name ] = jQuery.extend( deep, clone, copy );
  231 +
  232 + // Don't bring in undefined values
  233 + } else if ( copy !== undefined ) {
  234 + target[ name ] = copy;
  235 + }
  236 + }
  237 + }
  238 + }
  239 +
  240 + // Return the modified object
  241 + return target;
  242 +};
  243 +
  244 +jQuery.extend( {
  245 +
  246 + // Unique for each copy of jQuery on the page
  247 + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ),
  248 +
  249 + // Assume jQuery is ready without the ready module
  250 + isReady: true,
  251 +
  252 + error: function( msg ) {
  253 + throw new Error( msg );
  254 + },
  255 +
  256 + noop: function() {},
  257 +
  258 + isFunction: function( obj ) {
  259 + return jQuery.type( obj ) === "function";
  260 + },
  261 +
  262 + isArray: Array.isArray,
  263 +
  264 + isWindow: function( obj ) {
  265 + return obj != null && obj === obj.window;
  266 + },
  267 +
  268 + isNumeric: function( obj ) {
  269 +
  270 + // parseFloat NaNs numeric-cast false positives (null|true|false|"")
  271 + // ...but misinterprets leading-number strings, particularly hex literals ("0x...")
  272 + // subtraction forces infinities to NaN
  273 + // adding 1 corrects loss of precision from parseFloat (#15100)
  274 + var realStringObj = obj && obj.toString();
  275 + return !jQuery.isArray( obj ) && ( realStringObj - parseFloat( realStringObj ) + 1 ) >= 0;
  276 + },
  277 +
  278 + isPlainObject: function( obj ) {
  279 +
  280 + // Not plain objects:
  281 + // - Any object or value whose internal [[Class]] property is not "[object Object]"
  282 + // - DOM nodes
  283 + // - window
  284 + if ( jQuery.type( obj ) !== "object" || obj.nodeType || jQuery.isWindow( obj ) ) {
  285 + return false;
  286 + }
  287 +
  288 + if ( obj.constructor &&
  289 + !hasOwn.call( obj.constructor.prototype, "isPrototypeOf" ) ) {
  290 + return false;
  291 + }
  292 +
  293 + // If the function hasn't returned already, we're confident that
  294 + // |obj| is a plain object, created by {} or constructed with new Object
  295 + return true;
  296 + },
  297 +
  298 + isEmptyObject: function( obj ) {
  299 + var name;
  300 + for ( name in obj ) {
  301 + return false;
  302 + }
  303 + return true;
  304 + },
  305 +
  306 + type: function( obj ) {
  307 + if ( obj == null ) {
  308 + return obj + "";
  309 + }
  310 +
  311 + // Support: Android<4.0, iOS<6 (functionish RegExp)
  312 + return typeof obj === "object" || typeof obj === "function" ?
  313 + class2type[ toString.call( obj ) ] || "object" :
  314 + typeof obj;
  315 + },
  316 +
  317 + // Evaluates a script in a global context
  318 + globalEval: function( code ) {
  319 + var script,
  320 + indirect = eval;
  321 +
  322 + code = jQuery.trim( code );
  323 +
  324 + if ( code ) {
  325 +
  326 + // If the code includes a valid, prologue position
  327 + // strict mode pragma, execute code by injecting a
  328 + // script tag into the document.
  329 + if ( code.indexOf( "use strict" ) === 1 ) {
  330 + script = document.createElement( "script" );
  331 + script.text = code;
  332 + document.head.appendChild( script ).parentNode.removeChild( script );
  333 + } else {
  334 +
  335 + // Otherwise, avoid the DOM node creation, insertion
  336 + // and removal by using an indirect global eval
  337 +
  338 + indirect( code );
  339 + }
  340 + }
  341 + },
  342 +
  343 + // Convert dashed to camelCase; used by the css and data modules
  344 + // Support: IE9-11+
  345 + // Microsoft forgot to hump their vendor prefix (#9572)
  346 + camelCase: function( string ) {
  347 + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase );
  348 + },
  349 +
  350 + nodeName: function( elem, name ) {
  351 + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase();
  352 + },
  353 +
  354 + each: function( obj, callback ) {
  355 + var length, i = 0;
  356 +
  357 + if ( isArrayLike( obj ) ) {
  358 + length = obj.length;
  359 + for ( ; i < length; i++ ) {
  360 + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  361 + break;
  362 + }
  363 + }
  364 + } else {
  365 + for ( i in obj ) {
  366 + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) {
  367 + break;
  368 + }
  369 + }
  370 + }
  371 +
  372 + return obj;
  373 + },
  374 +
  375 + // Support: Android<4.1
  376 + trim: function( text ) {
  377 + return text == null ?
  378 + "" :
  379 + ( text + "" ).replace( rtrim, "" );
  380 + },
  381 +
  382 + // results is for internal usage only
  383 + makeArray: function( arr, results ) {
  384 + var ret = results || [];
  385 +
  386 + if ( arr != null ) {
  387 + if ( isArrayLike( Object( arr ) ) ) {
  388 + jQuery.merge( ret,
  389 + typeof arr === "string" ?
  390 + [ arr ] : arr
  391 + );
  392 + } else {
  393 + push.call( ret, arr );
  394 + }
  395 + }
  396 +
  397 + return ret;
  398 + },
  399 +
  400 + inArray: function( elem, arr, i ) {
  401 + return arr == null ? -1 : indexOf.call( arr, elem, i );
  402 + },
  403 +
  404 + merge: function( first, second ) {
  405 + var len = +second.length,
  406 + j = 0,
  407 + i = first.length;
  408 +
  409 + for ( ; j < len; j++ ) {
  410 + first[ i++ ] = second[ j ];
  411 + }
  412 +
  413 + first.length = i;
  414 +
  415 + return first;
  416 + },
  417 +
  418 + grep: function( elems, callback, invert ) {
  419 + var callbackInverse,
  420 + matches = [],
  421 + i = 0,
  422 + length = elems.length,
  423 + callbackExpect = !invert;
  424 +
  425 + // Go through the array, only saving the items
  426 + // that pass the validator function
  427 + for ( ; i < length; i++ ) {
  428 + callbackInverse = !callback( elems[ i ], i );
  429 + if ( callbackInverse !== callbackExpect ) {
  430 + matches.push( elems[ i ] );
  431 + }
  432 + }
  433 +
  434 + return matches;
  435 + },
  436 +
  437 + // arg is for internal usage only
  438 + map: function( elems, callback, arg ) {
  439 + var length, value,
  440 + i = 0,
  441 + ret = [];
  442 +
  443 + // Go through the array, translating each of the items to their new values
  444 + if ( isArrayLike( elems ) ) {
  445 + length = elems.length;
  446 + for ( ; i < length; i++ ) {
  447 + value = callback( elems[ i ], i, arg );
  448 +
  449 + if ( value != null ) {
  450 + ret.push( value );
  451 + }
  452 + }
  453 +
  454 + // Go through every key on the object,
  455 + } else {
  456 + for ( i in elems ) {
  457 + value = callback( elems[ i ], i, arg );
  458 +
  459 + if ( value != null ) {
  460 + ret.push( value );
  461 + }
  462 + }
  463 + }
  464 +
  465 + // Flatten any nested arrays
  466 + return concat.apply( [], ret );
  467 + },
  468 +
  469 + // A global GUID counter for objects
  470 + guid: 1,
  471 +
  472 + // Bind a function to a context, optionally partially applying any
  473 + // arguments.
  474 + proxy: function( fn, context ) {
  475 + var tmp, args, proxy;
  476 +
  477 + if ( typeof context === "string" ) {
  478 + tmp = fn[ context ];
  479 + context = fn;
  480 + fn = tmp;
  481 + }
  482 +
  483 + // Quick check to determine if target is callable, in the spec
  484 + // this throws a TypeError, but we will just return undefined.
  485 + if ( !jQuery.isFunction( fn ) ) {
  486 + return undefined;
  487 + }
  488 +
  489 + // Simulated bind
  490 + args = slice.call( arguments, 2 );
  491 + proxy = function() {
  492 + return fn.apply( context || this, args.concat( slice.call( arguments ) ) );
  493 + };
  494 +
  495 + // Set the guid of unique handler to the same of original handler, so it can be removed
  496 + proxy.guid = fn.guid = fn.guid || jQuery.guid++;
  497 +
  498 + return proxy;
  499 + },
  500 +
  501 + now: Date.now,
  502 +
  503 + // jQuery.support is not used in Core but other projects attach their
  504 + // properties to it so it needs to exist.
  505 + support: support
  506 +} );
  507 +
  508 +// JSHint would error on this code due to the Symbol not being defined in ES5.
  509 +// Defining this global in .jshintrc would create a danger of using the global
  510 +// unguarded in another place, it seems safer to just disable JSHint for these
  511 +// three lines.
  512 +/* jshint ignore: start */
  513 +if ( typeof Symbol === "function" ) {
  514 + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ];
  515 +}
  516 +/* jshint ignore: end */
  517 +
  518 +// Populate the class2type map
  519 +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ),
  520 +function( i, name ) {
  521 + class2type[ "[object " + name + "]" ] = name.toLowerCase();
  522 +} );
  523 +
  524 +function isArrayLike( obj ) {
  525 +
  526 + // Support: iOS 8.2 (not reproducible in simulator)
  527 + // `in` check used to prevent JIT error (gh-2145)
  528 + // hasOwn isn't used here due to false negatives
  529 + // regarding Nodelist length in IE
  530 + var length = !!obj && "length" in obj && obj.length,
  531 + type = jQuery.type( obj );
  532 +
  533 + if ( type === "function" || jQuery.isWindow( obj ) ) {
  534 + return false;
  535 + }
  536 +
  537 + return type === "array" || length === 0 ||
  538 + typeof length === "number" && length > 0 && ( length - 1 ) in obj;
  539 +}
  540 +var Sizzle =
  541 +/*!
  542 + * Sizzle CSS Selector Engine v2.2.1
  543 + * http://sizzlejs.com/
  544 + *
  545 + * Copyright jQuery Foundation and other contributors
  546 + * Released under the MIT license
  547 + * http://jquery.org/license
  548 + *
  549 + * Date: 2015-10-17
  550 + */
  551 +(function( window ) {
  552 +
  553 +var i,
  554 + support,
  555 + Expr,
  556 + getText,
  557 + isXML,
  558 + tokenize,
  559 + compile,
  560 + select,
  561 + outermostContext,
  562 + sortInput,
  563 + hasDuplicate,
  564 +
  565 + // Local document vars
  566 + setDocument,
  567 + document,
  568 + docElem,
  569 + documentIsHTML,
  570 + rbuggyQSA,
  571 + rbuggyMatches,
  572 + matches,
  573 + contains,
  574 +
  575 + // Instance-specific data
  576 + expando = "sizzle" + 1 * new Date(),
  577 + preferredDoc = window.document,
  578 + dirruns = 0,
  579 + done = 0,
  580 + classCache = createCache(),
  581 + tokenCache = createCache(),
  582 + compilerCache = createCache(),
  583 + sortOrder = function( a, b ) {
  584 + if ( a === b ) {
  585 + hasDuplicate = true;
  586 + }
  587 + return 0;
  588 + },
  589 +
  590 + // General-purpose constants
  591 + MAX_NEGATIVE = 1 << 31,
  592 +
  593 + // Instance methods
  594 + hasOwn = ({}).hasOwnProperty,
  595 + arr = [],
  596 + pop = arr.pop,
  597 + push_native = arr.push,
  598 + push = arr.push,
  599 + slice = arr.slice,
  600 + // Use a stripped-down indexOf as it's faster than native
  601 + // http://jsperf.com/thor-indexof-vs-for/5
  602 + indexOf = function( list, elem ) {
  603 + var i = 0,
  604 + len = list.length;
  605 + for ( ; i < len; i++ ) {
  606 + if ( list[i] === elem ) {
  607 + return i;
  608 + }
  609 + }
  610 + return -1;
  611 + },
  612 +
  613 + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped",
  614 +
  615 + // Regular expressions
  616 +
  617 + // http://www.w3.org/TR/css3-selectors/#whitespace
  618 + whitespace = "[\\x20\\t\\r\\n\\f]",
  619 +
  620 + // http://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
  621 + identifier = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+",
  622 +
  623 + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors
  624 + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +
  625 + // Operator (capture 2)
  626 + "*([*^$|!~]?=)" + whitespace +
  627 + // "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
  628 + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + whitespace +
  629 + "*\\]",
  630 +
  631 + pseudos = ":(" + identifier + ")(?:\\((" +
  632 + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments:
  633 + // 1. quoted (capture 3; capture 4 or capture 5)
  634 + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" +
  635 + // 2. simple (capture 6)
  636 + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" +
  637 + // 3. anything else (capture 2)
  638 + ".*" +
  639 + ")\\)|)",
  640 +
  641 + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter
  642 + rwhitespace = new RegExp( whitespace + "+", "g" ),
  643 + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + whitespace + "+$", "g" ),
  644 +
  645 + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ),
  646 + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + "*" ),
  647 +
  648 + rattributeQuotes = new RegExp( "=" + whitespace + "*([^\\]'\"]*?)" + whitespace + "*\\]", "g" ),
  649 +
  650 + rpseudo = new RegExp( pseudos ),
  651 + ridentifier = new RegExp( "^" + identifier + "$" ),
  652 +
  653 + matchExpr = {
  654 + "ID": new RegExp( "^#(" + identifier + ")" ),
  655 + "CLASS": new RegExp( "^\\.(" + identifier + ")" ),
  656 + "TAG": new RegExp( "^(" + identifier + "|[*])" ),
  657 + "ATTR": new RegExp( "^" + attributes ),
  658 + "PSEUDO": new RegExp( "^" + pseudos ),
  659 + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + whitespace +
  660 + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + whitespace +
  661 + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ),
  662 + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ),
  663 + // For use in libraries implementing .is()
  664 + // We use this for POS matching in `select`
  665 + "needsContext": new RegExp( "^" + whitespace + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" +
  666 + whitespace + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" )
  667 + },
  668 +
  669 + rinputs = /^(?:input|select|textarea|button)$/i,
  670 + rheader = /^h\d$/i,
  671 +
  672 + rnative = /^[^{]+\{\s*\[native \w/,
  673 +
  674 + // Easily-parseable/retrievable ID or TAG or CLASS selectors
  675 + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/,
  676 +
  677 + rsibling = /[+~]/,
  678 + rescape = /'|\\/g,
  679 +
  680 + // CSS escapes http://www.w3.org/TR/CSS21/syndata.html#escaped-characters
  681 + runescape = new RegExp( "\\\\([\\da-f]{1,6}" + whitespace + "?|(" + whitespace + ")|.)", "ig" ),
  682 + funescape = function( _, escaped, escapedWhitespace ) {
  683 + var high = "0x" + escaped - 0x10000;
  684 + // NaN means non-codepoint
  685 + // Support: Firefox<24
  686 + // Workaround erroneous numeric interpretation of +"0x"
  687 + return high !== high || escapedWhitespace ?
  688 + escaped :
  689 + high < 0 ?
  690 + // BMP codepoint
  691 + String.fromCharCode( high + 0x10000 ) :
  692 + // Supplemental Plane codepoint (surrogate pair)
  693 + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 );
  694 + },
  695 +
  696 + // Used for iframes
  697 + // See setDocument()
  698 + // Removing the function wrapper causes a "Permission Denied"
  699 + // error in IE
  700 + unloadHandler = function() {
  701 + setDocument();
  702 + };
  703 +
  704 +// Optimize for push.apply( _, NodeList )
  705 +try {
  706 + push.apply(
  707 + (arr = slice.call( preferredDoc.childNodes )),
  708 + preferredDoc.childNodes
  709 + );
  710 + // Support: Android<4.0
  711 + // Detect silently failing push.apply
  712 + arr[ preferredDoc.childNodes.length ].nodeType;
  713 +} catch ( e ) {
  714 + push = { apply: arr.length ?
  715 +
  716 + // Leverage slice if possible
  717 + function( target, els ) {
  718 + push_native.apply( target, slice.call(els) );
  719 + } :
  720 +
  721 + // Support: IE<9
  722 + // Otherwise append directly
  723 + function( target, els ) {
  724 + var j = target.length,
  725 + i = 0;
  726 + // Can't trust NodeList.length
  727 + while ( (target[j++] = els[i++]) ) {}
  728 + target.length = j - 1;
  729 + }
  730 + };
  731 +}
  732 +
  733 +function Sizzle( selector, context, results, seed ) {
  734 + var m, i, elem, nid, nidselect, match, groups, newSelector,
  735 + newContext = context && context.ownerDocument,
  736 +
  737