mirror of
https://github.com/danbulant/api_docs
synced 2026-06-11 18:40:53 +00:00
Merge pull request #435 from tripit/dev
Thanks @lord and everyone contributing! Slate v1.3 ftw!
This commit is contained in:
commit
365a0b58ea
24 changed files with 10277 additions and 230 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -14,9 +14,11 @@ tmp
|
|||
*.DS_STORE
|
||||
build/
|
||||
.cache
|
||||
.vagrant
|
||||
.sass-cache
|
||||
|
||||
# YARD artifacts
|
||||
.yardoc
|
||||
_yardoc
|
||||
doc/
|
||||
.idea/
|
||||
.idea/
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@ sudo: false
|
|||
language: ruby
|
||||
|
||||
rvm:
|
||||
- 1.9.3
|
||||
- 2.0.0
|
||||
- 2.1.0
|
||||
|
||||
cache: bundler
|
||||
script: bundle exec middleman build
|
||||
|
|
|
|||
|
|
@ -1,5 +1,13 @@
|
|||
# Changelog
|
||||
|
||||
## Version 1.3
|
||||
|
||||
*January 27th, 2016*
|
||||
|
||||
We've upgraded Middleman and a number of other dependencies, which should fix quite a few bugs.
|
||||
|
||||
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.
|
||||
|
||||
## Version 1.2
|
||||
|
||||
*June 20, 2015*
|
||||
|
|
|
|||
|
|
@ -1,8 +1,15 @@
|
|||
# Contributing to Slate
|
||||
# Before You Submit an Issue
|
||||
|
||||
Thanks for contributing to Slate! A couple of quick guidelines for submitting PRs:
|
||||
- Are you using Windows? We unfortunately don't support Windows. You could try using Docker, as outlined in the `README`.
|
||||
- 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.
|
||||
|
||||
- Please point your pull requests at the `dev` branch, and keep your commit messages clear and informative.
|
||||
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.
|
||||
|
||||
# Before You Submit a Pull Request
|
||||
|
||||
Thanks for contributing to Slate! A couple of quick guidelines for submitting pull requests:
|
||||
|
||||
- **Please point your pull requests at the `dev` branch.** We don't accept pull requests to `master`.
|
||||
- Please make sure your contributions work in the most recent version of Chrome, Firefox, and IE.
|
||||
- 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.
|
||||
|
||||
|
|
|
|||
12
Dockerfile
12
Dockerfile
|
|
@ -1,12 +0,0 @@
|
|||
FROM ubuntu:trusty
|
||||
|
||||
RUN apt-get update
|
||||
RUN apt-get install -yq ruby ruby-dev build-essential git
|
||||
RUN gem install --no-ri --no-rdoc bundler
|
||||
ADD Gemfile /app/Gemfile
|
||||
ADD Gemfile.lock /app/Gemfile.lock
|
||||
RUN cd /app; bundle install
|
||||
ADD . /app
|
||||
EXPOSE 4567
|
||||
WORKDIR /app
|
||||
CMD ["bundle", "exec", "middleman", "server"]
|
||||
12
Gemfile
12
Gemfile
|
|
@ -1,12 +1,10 @@
|
|||
source 'https://rubygems.org'
|
||||
|
||||
# Middleman
|
||||
gem 'middleman', '~>3.3.10'
|
||||
gem 'middleman', '~>4.0.0'
|
||||
gem 'middleman-gh-pages', '~> 0.0.3'
|
||||
gem 'middleman-syntax', '~> 2.0.0'
|
||||
gem 'middleman-autoprefixer', '~> 2.4.4'
|
||||
gem 'rouge', '~> 1.9.0'
|
||||
gem 'middleman-syntax', '~> 2.1.0'
|
||||
gem 'middleman-autoprefixer', '~> 2.7.0'
|
||||
gem "middleman-sprockets", "~> 4.0.0.rc"
|
||||
gem 'rouge', '~> 1.10.1'
|
||||
gem 'redcarpet', '~> 3.3.2'
|
||||
|
||||
gem 'rake', '~> 10.4.2'
|
||||
gem 'therubyracer', '~> 0.12.1', platforms: :ruby
|
||||
|
|
|
|||
164
Gemfile.lock
164
Gemfile.lock
|
|
@ -1,140 +1,134 @@
|
|||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
activesupport (4.1.11)
|
||||
i18n (~> 0.6, >= 0.6.9)
|
||||
activesupport (4.2.5.1)
|
||||
i18n (~> 0.7)
|
||||
json (~> 1.7, >= 1.7.7)
|
||||
minitest (~> 5.1)
|
||||
thread_safe (~> 0.1)
|
||||
thread_safe (~> 0.3, >= 0.3.4)
|
||||
tzinfo (~> 1.1)
|
||||
autoprefixer-rails (5.2.0.1)
|
||||
addressable (2.4.0)
|
||||
autoprefixer-rails (6.3.1)
|
||||
execjs
|
||||
json
|
||||
celluloid (0.16.0)
|
||||
timers (~> 4.0.0)
|
||||
chunky_png (1.3.4)
|
||||
backports (3.6.7)
|
||||
capybara (2.5.0)
|
||||
mime-types (>= 1.16)
|
||||
nokogiri (>= 1.3.3)
|
||||
rack (>= 1.0.0)
|
||||
rack-test (>= 0.5.4)
|
||||
xpath (~> 2.0)
|
||||
coffee-script (2.4.1)
|
||||
coffee-script-source
|
||||
execjs
|
||||
coffee-script-source (1.9.1.1)
|
||||
compass (1.0.3)
|
||||
chunky_png (~> 1.2)
|
||||
compass-core (~> 1.0.2)
|
||||
compass-import-once (~> 1.0.5)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
sass (>= 3.3.13, < 3.5)
|
||||
compass-core (1.0.3)
|
||||
multi_json (~> 1.0)
|
||||
sass (>= 3.3.0, < 3.5)
|
||||
coffee-script-source (1.10.0)
|
||||
compass-import-once (1.0.5)
|
||||
sass (>= 3.2, < 3.5)
|
||||
concurrent-ruby (0.9.2)
|
||||
contracts (0.12.0)
|
||||
erubis (2.7.0)
|
||||
execjs (2.5.2)
|
||||
ffi (1.9.8)
|
||||
haml (4.0.6)
|
||||
execjs (2.6.0)
|
||||
fastimage (1.8.1)
|
||||
addressable (~> 2.3, >= 2.3.5)
|
||||
ffi (1.9.10)
|
||||
haml (4.0.7)
|
||||
tilt
|
||||
hike (1.2.3)
|
||||
hitimes (1.2.2)
|
||||
hooks (0.4.0)
|
||||
uber (~> 0.0.4)
|
||||
hamster (2.0.0)
|
||||
concurrent-ruby (~> 0.8)
|
||||
hashie (3.4.3)
|
||||
i18n (0.7.0)
|
||||
json (1.8.3)
|
||||
kramdown (1.7.0)
|
||||
libv8 (3.16.14.7)
|
||||
listen (2.10.1)
|
||||
celluloid (~> 0.16.0)
|
||||
kramdown (1.9.0)
|
||||
listen (3.0.5)
|
||||
rb-fsevent (>= 0.9.3)
|
||||
rb-inotify (>= 0.9)
|
||||
middleman (3.3.12)
|
||||
middleman (4.0.0)
|
||||
coffee-script (~> 2.2)
|
||||
compass (>= 1.0.0, < 2.0.0)
|
||||
compass-import-once (= 1.0.5)
|
||||
execjs (~> 2.0)
|
||||
haml (>= 4.0.5)
|
||||
kramdown (~> 1.2)
|
||||
middleman-core (= 3.3.12)
|
||||
middleman-sprockets (>= 3.1.2)
|
||||
middleman-cli (= 4.0.0)
|
||||
middleman-core (= 4.0.0)
|
||||
sass (>= 3.4.0, < 4.0)
|
||||
uglifier (~> 2.5)
|
||||
middleman-autoprefixer (2.4.4)
|
||||
autoprefixer-rails (~> 5.2.0)
|
||||
middleman-autoprefixer (2.7.0)
|
||||
autoprefixer-rails (>= 6.3.1, < 7.0.0)
|
||||
middleman-core (>= 3.3.3)
|
||||
middleman-core (3.3.12)
|
||||
activesupport (~> 4.1.0)
|
||||
middleman-cli (4.0.0)
|
||||
thor (>= 0.17.0, < 2.0)
|
||||
middleman-core (4.0.0)
|
||||
activesupport (~> 4.2)
|
||||
addressable (~> 2.4.0)
|
||||
backports (~> 3.6)
|
||||
bundler (~> 1.1)
|
||||
capybara (~> 2.5.0)
|
||||
contracts (~> 0.12.0)
|
||||
erubis
|
||||
hooks (~> 0.3)
|
||||
execjs (~> 2.0)
|
||||
fastimage (~> 1.8)
|
||||
hamster (~> 2.0)
|
||||
hashie (~> 3.4)
|
||||
i18n (~> 0.7.0)
|
||||
listen (>= 2.7.9, < 3.0)
|
||||
padrino-helpers (~> 0.12.3)
|
||||
listen (~> 3.0)
|
||||
padrino-helpers (~> 0.13.0)
|
||||
rack (>= 1.4.5, < 2.0)
|
||||
rack-test (~> 0.6.2)
|
||||
thor (>= 0.15.2, < 2.0)
|
||||
tilt (~> 1.4.1, < 2.0)
|
||||
sass (>= 3.4)
|
||||
tilt (~> 1.4.1)
|
||||
uglifier (~> 2.6)
|
||||
middleman-gh-pages (0.0.3)
|
||||
rake (> 0.9.3)
|
||||
middleman-sprockets (3.4.2)
|
||||
middleman-core (>= 3.3)
|
||||
sprockets (~> 2.12.1)
|
||||
sprockets-helpers (~> 1.1.0)
|
||||
sprockets-sass (~> 1.3.0)
|
||||
middleman-syntax (2.0.0)
|
||||
middleman-core (~> 3.2)
|
||||
middleman-sprockets (4.0.0.rc.1)
|
||||
middleman-core (>= 4.0.0.rc.1)
|
||||
sprockets (~> 3.0)
|
||||
middleman-syntax (2.1.0)
|
||||
middleman-core (>= 3.2)
|
||||
rouge (~> 1.0)
|
||||
minitest (5.7.0)
|
||||
multi_json (1.11.1)
|
||||
padrino-helpers (0.12.5)
|
||||
mime-types (3.0)
|
||||
mime-types-data (~> 3.2015)
|
||||
mime-types-data (3.2015.1120)
|
||||
mini_portile2 (2.0.0)
|
||||
minitest (5.8.4)
|
||||
nokogiri (1.6.7.2)
|
||||
mini_portile2 (~> 2.0.0.rc2)
|
||||
padrino-helpers (0.13.1)
|
||||
i18n (~> 0.6, >= 0.6.7)
|
||||
padrino-support (= 0.12.5)
|
||||
padrino-support (= 0.13.1)
|
||||
tilt (~> 1.4.1)
|
||||
padrino-support (0.12.5)
|
||||
padrino-support (0.13.1)
|
||||
activesupport (>= 3.1)
|
||||
rack (1.6.4)
|
||||
rack-test (0.6.3)
|
||||
rack (>= 1.0)
|
||||
rake (10.4.2)
|
||||
rb-fsevent (0.9.5)
|
||||
rb-fsevent (0.9.7)
|
||||
rb-inotify (0.9.5)
|
||||
ffi (>= 0.5.0)
|
||||
redcarpet (3.3.2)
|
||||
ref (1.0.5)
|
||||
rouge (1.9.0)
|
||||
sass (3.4.14)
|
||||
sprockets (2.12.3)
|
||||
hike (~> 1.2)
|
||||
multi_json (~> 1.0)
|
||||
rack (~> 1.0)
|
||||
tilt (~> 1.1, != 1.3.0)
|
||||
sprockets-helpers (1.1.0)
|
||||
sprockets (~> 2.0)
|
||||
sprockets-sass (1.3.1)
|
||||
sprockets (~> 2.0)
|
||||
tilt (~> 1.1)
|
||||
therubyracer (0.12.2)
|
||||
libv8 (~> 3.16.14.0)
|
||||
ref
|
||||
redcarpet (3.3.4)
|
||||
rouge (1.10.1)
|
||||
sass (3.4.21)
|
||||
sprockets (3.4.1)
|
||||
rack (> 1, < 3)
|
||||
thor (0.19.1)
|
||||
thread_safe (0.3.5)
|
||||
tilt (1.4.1)
|
||||
timers (4.0.1)
|
||||
hitimes
|
||||
tzinfo (1.2.2)
|
||||
thread_safe (~> 0.1)
|
||||
uber (0.0.13)
|
||||
uglifier (2.7.1)
|
||||
uglifier (2.7.2)
|
||||
execjs (>= 0.3.0)
|
||||
json (>= 1.8.0)
|
||||
xpath (2.0.0)
|
||||
nokogiri (~> 1.3)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
middleman (~> 3.3.10)
|
||||
middleman-autoprefixer (~> 2.4.4)
|
||||
middleman (~> 4.0.0)
|
||||
middleman-autoprefixer (~> 2.7.0)
|
||||
middleman-gh-pages (~> 0.0.3)
|
||||
middleman-syntax (~> 2.0.0)
|
||||
rake (~> 10.4.2)
|
||||
middleman-sprockets (~> 4.0.0.rc)
|
||||
middleman-syntax (~> 2.1.0)
|
||||
redcarpet (~> 3.3.2)
|
||||
rouge (~> 1.9.0)
|
||||
therubyracer (~> 0.12.1)
|
||||
rouge (~> 1.10.1)
|
||||
|
||||
BUNDLED WITH
|
||||
1.10.6
|
||||
|
|
|
|||
104
README.md
104
README.md
|
|
@ -1,32 +1,33 @@
|
|||
Slate
|
||||
========
|
||||
<p align="center">
|
||||
<img src="https://raw.githubusercontent.com/lord/img/master/logo-slate.png" alt="Slate: API Documentation Generator" width="226">
|
||||
<br>
|
||||
<a href="https://travis-ci.org/tripit/slate"><img src="https://travis-ci.org/tripit/slate.svg?branch=master" alt="Build Status"></a>
|
||||
</p>
|
||||
|
||||
[](https://travis-ci.org/tripit/slate) [](https://gemnasium.com/tripit/slate)
|
||||
<p align="center">Slate helps you create beautiful, intelligent, responsive API documentation.</p>
|
||||
|
||||
Slate helps you create beautiful API documentation. Think of it as an intelligent, responsive documentation template for your API.
|
||||
<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>
|
||||
|
||||
<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">
|
||||
|
||||
*The example above was created with Slate. Check it out at [tripit.github.io/slate](http://tripit.github.io/slate).*
|
||||
<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>
|
||||
|
||||
Features
|
||||
------------
|
||||
|
||||
* **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.
|
||||
* **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.
|
||||
|
||||
* **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.
|
||||
* **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.
|
||||
|
||||
* **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!
|
||||
* **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.
|
||||
|
||||
* **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!
|
||||
* **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.
|
||||
|
||||
* **Out-of-the-box syntax highlighting** for [almost 60 languages](http://rouge.jayferd.us/demo), no configuration required.
|
||||
|
||||
* **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.
|
||||
|
||||
* **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!
|
||||
* **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.
|
||||
|
||||
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).
|
||||
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).
|
||||
|
||||
<!--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).-->
|
||||
|
||||
|
|
@ -43,76 +44,49 @@ You're going to need:
|
|||
|
||||
### Getting Set Up
|
||||
|
||||
1. Fork this repository on Github.
|
||||
2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git`
|
||||
3. `cd slate`
|
||||
4. Install all dependencies: `bundle install`
|
||||
5. Start the test server: `bundle exec middleman server`
|
||||
|
||||
Or use the included Dockerfile! (must install Docker first)
|
||||
1. Fork this repository on Github.
|
||||
2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git`
|
||||
3. `cd slate`
|
||||
4. Initialize and start Slate. You can either do this locally, or with Vagrant:
|
||||
|
||||
```shell
|
||||
docker build -t slate .
|
||||
docker run -d -p 4567:4567 --name slate -v $(pwd)/source:/app/source slate
|
||||
# either run this to run locally
|
||||
bundle install
|
||||
bundle exec middleman server
|
||||
|
||||
# OR run this to run with vagrant
|
||||
vagrant up
|
||||
```
|
||||
|
||||
You can now see the docs at <http://localhost:4567>. Whoa! That was fast!
|
||||
|
||||
*Note: if you're using the Docker setup on OSX, the docs will be
|
||||
available at the output of `docker-machine ip <machine-name>` (port: 4567) instead of `localhost:4567`.*
|
||||
You can now see the docs at http://localhost:4567. Whoa! That was fast!
|
||||
|
||||
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).
|
||||
|
||||
Examples of Slate in the Wild
|
||||
Companies Using Slate
|
||||
---------------------------------
|
||||
|
||||
* [Travis-CI's API docs](http://docs.travis-ci.com/api/)
|
||||
* [Mozilla's localForage docs](http://mozilla.github.io/localForage/)
|
||||
* [Mozilla Recroom](http://mozilla.github.io/recroom/)
|
||||
* [Drcaban's Build a Quine tutorial](http://drcabana.github.io/build-a-quine/#introduction)
|
||||
* [PricePlow API docs](https://www.priceplow.com/api/documentation)
|
||||
* [Emerging Threats API docs](http://apidocs.emergingthreats.net/)
|
||||
* [Appium docs](http://appium.io/slate/en/master)
|
||||
* [Golazon Developer](http://developer.golazon.com)
|
||||
* [Dwolla API docs](https://docs.dwolla.com/)
|
||||
* [RozpisyZapasu API docs](http://www.rozpisyzapasu.cz/dev/api/)
|
||||
* [Codestar Framework Docs](http://codestarframework.com/documentation/)
|
||||
* [Buddycloud API](http://buddycloud.com/api)
|
||||
* [Crafty Clicks API](https://craftyclicks.co.uk/api/)
|
||||
* [Paracel API Reference](http://paracel.io/docs/api_reference.html)
|
||||
* [Switch Payments Documentation](http://switchpayments.com/docs/) & [API](http://switchpayments.com/developers/)
|
||||
* [Coinbase API Reference](https://developers.coinbase.com/api)
|
||||
* [Whispir.io API](https://whispir.github.io/api)
|
||||
* [NASA API](https://data.nasa.gov/developer/external/planetary/)
|
||||
* [CardPay API](https://developers.cardpay.com/)
|
||||
* [NASA](https://api.nasa.gov)
|
||||
* [IBM Cloudant](https://docs.cloudant.com/api.html)
|
||||
* [Bitrix basis components](http://bbc.bitrix.expert/)
|
||||
* [viagogo API Documentation](http://developer.viagogo.net/)
|
||||
* [Fidor Bank API Documentation](http://docs.fidor.de/)
|
||||
* [Market Prophit API Documentation](http://developer.marketprophit.com/)
|
||||
* [OAuth.io API Documentation](http://docs.oauth.io/)
|
||||
* [Aircall for Developers](http://developer.aircall.io/)
|
||||
* [SupportKit API Docs](http://docs.supportkit.io/)
|
||||
* [SocialRadar's LocationKit Docs](https://docs.locationkit.io/)
|
||||
* [SafetyCulture API Documentation](https://developer.safetyculture.io/)
|
||||
* [hosting.de API Documentation](https://www.hosting.de/docs/api/)
|
||||
* [BlockCypher's API Documentation](http://dev.blockcypher.com)
|
||||
* [InterServer API Documentation](https://my.interserver.net/apidoc/)
|
||||
* [ActionHeroJS's API Documentation](http://www.actionherojs.com/docs)
|
||||
* [Augur API Documentation](http://docs.augur.net)
|
||||
* [Travis-CI](https://docs.travis-ci.com/api/)
|
||||
* [Mozilla](http://mozilla.github.io/localForage/)
|
||||
* [Appium](http://appium.io/slate/en/master)
|
||||
* [Dwolla](https://docs.dwolla.com/)
|
||||
* [Clearbit](https://clearbit.com/docs)
|
||||
* [Coinbase](https://developers.coinbase.com/api)
|
||||
* [Parrot Drones](http://developer.parrot.com/docs/bebop/)
|
||||
* [Fidor Bank](http://docs.fidor.de/)
|
||||
|
||||
(Feel free to add your site to this list in a pull request!)
|
||||
You can view more in [the list on the wiki](https://github.com/tripit/slate/wiki/Slate-in-the-Wild).
|
||||
|
||||
Need Help? Found a bug?
|
||||
--------------------
|
||||
|
||||
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.
|
||||
|
||||
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.
|
||||
|
||||
Contributors
|
||||
--------------------
|
||||
|
||||
Slate was built by [Robert Lord](https://lord.io) while at [TripIt](http://tripit.com).
|
||||
Slate was built by [Robert Lord](https://lord.io) while at [TripIt](https://www.tripit.com/).
|
||||
|
||||
Thanks to the following people who have submitted major pull requests:
|
||||
|
||||
|
|
@ -127,5 +101,5 @@ Special Thanks
|
|||
- [Middleman](https://github.com/middleman/middleman)
|
||||
- [jquery.tocify.js](https://github.com/gfranko/jquery.tocify.js)
|
||||
- [middleman-syntax](https://github.com/middleman/middleman-syntax)
|
||||
- [middleman-gh-pages](https://github.com/neo/middleman-gh-pages)
|
||||
- [middleman-gh-pages](https://github.com/edgecase/middleman-gh-pages)
|
||||
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
|
||||
|
|
|
|||
6
Rakefile
6
Rakefile
|
|
@ -1,6 +0,0 @@
|
|||
require 'middleman-gh-pages'
|
||||
require 'rake/clean'
|
||||
|
||||
CLOBBER.include('build')
|
||||
|
||||
task :default => [:build]
|
||||
39
Vagrantfile
vendored
Normal file
39
Vagrantfile
vendored
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
Vagrant.configure(2) do |config|
|
||||
config.vm.box = "ubuntu/trusty64"
|
||||
config.vm.network :forwarded_port, guest: 4567, host: 4567
|
||||
|
||||
config.vm.provision "bootstrap",
|
||||
type: "shell",
|
||||
inline: <<-SHELL
|
||||
sudo apt-get update
|
||||
sudo apt-get install -yq ruby2.0 ruby2.0-dev pkg-config build-essential nodejs git libxml2-dev libxslt-dev
|
||||
sudo apt-get autoremove -yq
|
||||
gem2.0 install --no-ri --no-rdoc bundler
|
||||
SHELL
|
||||
|
||||
# add the local user git config to the vm
|
||||
config.vm.provision "file", source: "~/.gitconfig", destination: ".gitconfig"
|
||||
|
||||
config.vm.provision "install",
|
||||
type: "shell",
|
||||
privileged: false,
|
||||
inline: <<-SHELL
|
||||
echo "=============================================="
|
||||
echo "Installing app dependencies"
|
||||
cd /vagrant
|
||||
bundle config build.nokogiri --use-system-libraries
|
||||
bundle install
|
||||
SHELL
|
||||
|
||||
config.vm.provision "run",
|
||||
type: "shell",
|
||||
privileged: false,
|
||||
run: "always",
|
||||
inline: <<-SHELL
|
||||
echo "=============================================="
|
||||
echo "Starting up middleman at http://localhost:4567"
|
||||
echo "If it does not come up, check the ~/middleman.log file for any error messages"
|
||||
cd /vagrant
|
||||
bundle exec middleman server --force-polling -l 1 &> ~/middleman.log &
|
||||
SHELL
|
||||
end
|
||||
|
|
@ -30,6 +30,8 @@ set :relative_links, true
|
|||
|
||||
# Build Configuration
|
||||
configure :build do
|
||||
# If you're having trouble with Middleman hanging, commenting
|
||||
# out the following two lines has been known to help
|
||||
activate :minify_css
|
||||
activate :minify_javascript
|
||||
# activate :relative_assets
|
||||
|
|
|
|||
222
deploy.sh
Executable file
222
deploy.sh
Executable file
|
|
@ -0,0 +1,222 @@
|
|||
#!/usr/bin/env bash
|
||||
set -o errexit #abort if any command fails
|
||||
me=$(basename "$0")
|
||||
|
||||
help_message="\
|
||||
Usage: $me [-c FILE] [<options>]
|
||||
Deploy generated files to a git branch.
|
||||
|
||||
Options:
|
||||
|
||||
-h, --help Show this help information.
|
||||
-v, --verbose Increase verbosity. Useful for debugging.
|
||||
-e, --allow-empty Allow deployment of an empty directory.
|
||||
-m, --message MESSAGE Specify the message used when committing on the
|
||||
deploy branch.
|
||||
-n, --no-hash Don't append the source commit's hash to the deploy
|
||||
commit's message.
|
||||
-c, --config-file PATH Override default & environment variables' values
|
||||
with those in set in the file at 'PATH'. Must be the
|
||||
first option specified.
|
||||
|
||||
Variables:
|
||||
|
||||
GIT_DEPLOY_DIR Folder path containing the files to deploy.
|
||||
GIT_DEPLOY_BRANCH Commit deployable files to this branch.
|
||||
GIT_DEPLOY_REPO Push the deploy branch to this repository.
|
||||
|
||||
These variables have default values defined in the script. The defaults can be
|
||||
overridden by environment variables. Any environment variables are overridden
|
||||
by values set in a '.env' file (if it exists), and in turn by those set in a
|
||||
file specified by the '--config-file' option."
|
||||
|
||||
bundle exec middleman build --clean
|
||||
|
||||
parse_args() {
|
||||
# Set args from a local environment file.
|
||||
if [ -e ".env" ]; then
|
||||
source .env
|
||||
fi
|
||||
|
||||
# Set args from file specified on the command-line.
|
||||
if [[ $1 = "-c" || $1 = "--config-file" ]]; then
|
||||
source "$2"
|
||||
shift 2
|
||||
fi
|
||||
|
||||
# Parse arg flags
|
||||
# If something is exposed as an environment variable, set/overwrite it
|
||||
# here. Otherwise, set/overwrite the internal variable instead.
|
||||
while : ; do
|
||||
if [[ $1 = "-h" || $1 = "--help" ]]; then
|
||||
echo "$help_message"
|
||||
return 0
|
||||
elif [[ $1 = "-v" || $1 = "--verbose" ]]; then
|
||||
verbose=true
|
||||
shift
|
||||
elif [[ $1 = "-e" || $1 = "--allow-empty" ]]; then
|
||||
allow_empty=true
|
||||
shift
|
||||
elif [[ ( $1 = "-m" || $1 = "--message" ) && -n $2 ]]; then
|
||||
commit_message=$2
|
||||
shift 2
|
||||
elif [[ $1 = "-n" || $1 = "--no-hash" ]]; then
|
||||
GIT_DEPLOY_APPEND_HASH=false
|
||||
shift
|
||||
else
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
# Set internal option vars from the environment and arg flags. All internal
|
||||
# vars should be declared here, with sane defaults if applicable.
|
||||
|
||||
# Source directory & target branch.
|
||||
deploy_directory=build
|
||||
deploy_branch=gh-pages
|
||||
|
||||
#if no user identity is already set in the current git environment, use this:
|
||||
default_username=${GIT_DEPLOY_USERNAME:-deploy.sh}
|
||||
default_email=${GIT_DEPLOY_EMAIL:-}
|
||||
|
||||
#repository to deploy to. must be readable and writable.
|
||||
repo=origin
|
||||
|
||||
#append commit hash to the end of message by default
|
||||
append_hash=${GIT_DEPLOY_APPEND_HASH:-true}
|
||||
}
|
||||
|
||||
main() {
|
||||
parse_args "$@"
|
||||
|
||||
enable_expanded_output
|
||||
|
||||
if ! git diff --exit-code --quiet --cached; then
|
||||
echo Aborting due to uncommitted changes in the index >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
commit_title=`git log -n 1 --format="%s" HEAD`
|
||||
commit_hash=` git log -n 1 --format="%H" HEAD`
|
||||
|
||||
#default commit message uses last title if a custom one is not supplied
|
||||
if [[ -z $commit_message ]]; then
|
||||
commit_message="publish: $commit_title"
|
||||
fi
|
||||
|
||||
#append hash to commit message unless no hash flag was found
|
||||
if [ $append_hash = true ]; then
|
||||
commit_message="$commit_message"$'\n\n'"generated from commit $commit_hash"
|
||||
fi
|
||||
|
||||
previous_branch=`git rev-parse --abbrev-ref HEAD`
|
||||
|
||||
if [ ! -d "$deploy_directory" ]; then
|
||||
echo "Deploy directory '$deploy_directory' does not exist. Aborting." >&2
|
||||
return 1
|
||||
fi
|
||||
|
||||
# must use short form of flag in ls for compatibility with OS X and BSD
|
||||
if [[ -z `ls -A "$deploy_directory" 2> /dev/null` && -z $allow_empty ]]; then
|
||||
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
|
||||
return 1
|
||||
fi
|
||||
|
||||
if git ls-remote --exit-code $repo "refs/heads/$deploy_branch" ; then
|
||||
# deploy_branch exists in $repo; make sure we have the latest version
|
||||
|
||||
disable_expanded_output
|
||||
git fetch --force $repo $deploy_branch:$deploy_branch
|
||||
enable_expanded_output
|
||||
fi
|
||||
|
||||
# check if deploy_branch exists locally
|
||||
if git show-ref --verify --quiet "refs/heads/$deploy_branch"
|
||||
then incremental_deploy
|
||||
else initial_deploy
|
||||
fi
|
||||
|
||||
restore_head
|
||||
}
|
||||
|
||||
initial_deploy() {
|
||||
git --work-tree "$deploy_directory" checkout --orphan $deploy_branch
|
||||
git --work-tree "$deploy_directory" add --all
|
||||
commit+push
|
||||
}
|
||||
|
||||
incremental_deploy() {
|
||||
#make deploy_branch the current branch
|
||||
git symbolic-ref HEAD refs/heads/$deploy_branch
|
||||
#put the previously committed contents of deploy_branch into the index
|
||||
git --work-tree "$deploy_directory" reset --mixed --quiet
|
||||
git --work-tree "$deploy_directory" add --all
|
||||
|
||||
set +o errexit
|
||||
diff=$(git --work-tree "$deploy_directory" diff --exit-code --quiet HEAD --)$?
|
||||
set -o errexit
|
||||
case $diff in
|
||||
0) echo No changes to files in $deploy_directory. Skipping commit.;;
|
||||
1) commit+push;;
|
||||
*)
|
||||
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
|
||||
return $diff
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
commit+push() {
|
||||
set_user_id
|
||||
git --work-tree "$deploy_directory" commit -m "$commit_message"
|
||||
|
||||
disable_expanded_output
|
||||
#--quiet is important here to avoid outputting the repo URL, which may contain a secret token
|
||||
git push --quiet $repo $deploy_branch
|
||||
enable_expanded_output
|
||||
}
|
||||
|
||||
#echo expanded commands as they are executed (for debugging)
|
||||
enable_expanded_output() {
|
||||
if [ $verbose ]; then
|
||||
set -o xtrace
|
||||
set +o verbose
|
||||
fi
|
||||
}
|
||||
|
||||
#this is used to avoid outputting the repo URL, which may contain a secret token
|
||||
disable_expanded_output() {
|
||||
if [ $verbose ]; then
|
||||
set +o xtrace
|
||||
set -o verbose
|
||||
fi
|
||||
}
|
||||
|
||||
set_user_id() {
|
||||
if [[ -z `git config user.name` ]]; then
|
||||
git config user.name "$default_username"
|
||||
fi
|
||||
if [[ -z `git config user.email` ]]; then
|
||||
git config user.email "$default_email"
|
||||
fi
|
||||
}
|
||||
|
||||
restore_head() {
|
||||
if [[ $previous_branch = "HEAD" ]]; then
|
||||
#we weren't on any branch before, so just set HEAD back to the commit it was on
|
||||
git update-ref --no-deref HEAD $commit_hash $deploy_branch
|
||||
else
|
||||
git symbolic-ref HEAD refs/heads/$previous_branch
|
||||
fi
|
||||
|
||||
git reset --mixed
|
||||
}
|
||||
|
||||
filter() {
|
||||
sed -e "s|$repo|\$repo|g"
|
||||
}
|
||||
|
||||
sanitize() {
|
||||
"$@" 2> >(filter 1>&2) | filter
|
||||
}
|
||||
|
||||
[[ $1 = --source-only ]] || main "$@"
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 22 KiB |
|
|
@ -8,7 +8,7 @@ language_tabs:
|
|||
|
||||
toc_footers:
|
||||
- <a href='#'>Sign Up for a Developer Key</a>
|
||||
- <a href='http://github.com/tripit/slate'>Documentation Powered by Slate</a>
|
||||
- <a href='https://github.com/tripit/slate'>Documentation Powered by Slate</a>
|
||||
|
||||
includes:
|
||||
- errors
|
||||
|
|
@ -22,7 +22,7 @@ Welcome to the Kittn API! You can use our API to access Kittn API endpoints, whi
|
|||
|
||||
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.
|
||||
|
||||
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.
|
||||
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.
|
||||
|
||||
# Authentication
|
||||
|
||||
|
|
@ -154,7 +154,7 @@ curl "http://example.com/api/kittens/2"
|
|||
|
||||
This endpoint retrieves a specific kitten.
|
||||
|
||||
<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>
|
||||
<aside class="warning">Inside HTML code blocks like this one, you can't use Markdown, so use <code><code></code> blocks to denote code.</aside>
|
||||
|
||||
### HTTP Request
|
||||
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
//= require ../lib/_jquery
|
||||
|
||||
/*
|
||||
Copyright 2008-2013 Concur Technologies, Inc.
|
||||
|
||||
|
|
@ -29,8 +31,10 @@ under the License.
|
|||
$(".lang-selector a[data-language-name='" + language + "']").addClass('active');
|
||||
for (var i=0; i < languages.length; i++) {
|
||||
$(".highlight." + languages[i]).hide();
|
||||
$(".lang-specific." + languages[i]).hide();
|
||||
}
|
||||
$(".highlight." + language).show();
|
||||
$(".lang-specific." + language).show();
|
||||
|
||||
global.toc.calculateHeights();
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
//= require ../lib/_lunr
|
||||
//= require ../lib/_jquery
|
||||
//= require ../lib/_jquery.highlight
|
||||
(function () {
|
||||
'use strict';
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
//= require ../lib/_jquery
|
||||
//= require ../lib/_jquery_ui
|
||||
//= require ../lib/_jquery.tocify
|
||||
//= require ../lib/_imagesloaded.min
|
||||
|
|
@ -47,6 +48,7 @@
|
|||
$(function() {
|
||||
makeToc();
|
||||
animate();
|
||||
setupLanguages($('body').data('languages'));
|
||||
$('.content').imagesLoaded( function() {
|
||||
global.toc.calculateHeights();
|
||||
});
|
||||
|
|
|
|||
9831
source/javascripts/lib/_jquery.js
Normal file
9831
source/javascripts/lib/_jquery.js
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -13,7 +13,7 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
%>
|
||||
<% language_tabs = current_page.data.language_tabs %>
|
||||
<% language_tabs = current_page.data.language_tabs || [] %>
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
|
|
@ -24,23 +24,17 @@ under the License.
|
|||
|
||||
<%= stylesheet_link_tag :screen, media: :screen %>
|
||||
<%= stylesheet_link_tag :print, media: :print %>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
|
||||
<style>
|
||||
<%= Rouge::Themes::Base16::Monokai.render(:scope => '.highlight') %>
|
||||
</style>
|
||||
<% if current_page.data.search %>
|
||||
<%= javascript_include_tag "all" %>
|
||||
<% else %>
|
||||
<%= javascript_include_tag "all_nosearch" %>
|
||||
<% end %>
|
||||
|
||||
<% if language_tabs %>
|
||||
<script>
|
||||
$(function() {
|
||||
setupLanguages(<%= language_tabs.map{ |lang| lang.is_a?(Hash) ? lang.keys.first : lang }.to_json %>);
|
||||
});
|
||||
</script>
|
||||
<% end %>
|
||||
</head>
|
||||
|
||||
<body class="<%= page_classes %>">
|
||||
<body class="<%= page_classes %>" data-languages="<%=h language_tabs.map{ |lang| lang.is_a?(Hash) ? lang.keys.first : lang }.to_json %>">
|
||||
<a href="#" id="nav-button">
|
||||
<span>
|
||||
NAV
|
||||
|
|
|
|||
|
|
@ -1,27 +0,0 @@
|
|||
/*
|
||||
Copyright 2008-2013 Concur Technologies, Inc.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
not use this file except in compliance with the License. You may obtain
|
||||
a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
License for the specific language governing permissions and limitations
|
||||
under the License.
|
||||
*/
|
||||
|
||||
@import 'variables';
|
||||
|
||||
<%= Rouge::Themes::Base16::Monokai.render(:scope => '.highlight') %>
|
||||
|
||||
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs {
|
||||
color: #909090;
|
||||
}
|
||||
|
||||
.highlight, .highlight .w {
|
||||
background-color: $code-bg;
|
||||
}
|
||||
|
|
@ -101,6 +101,7 @@ $search-box-border-color: #666;
|
|||
|
||||
%break-words {
|
||||
word-break: break-all;
|
||||
white-space: normal;
|
||||
|
||||
/* Non standard for webkit */
|
||||
word-break: break-word;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
@charset "utf-8";
|
||||
@import 'normalize';
|
||||
@import 'compass';
|
||||
@import 'variables';
|
||||
@import 'icon-font';
|
||||
|
||||
|
|
@ -48,6 +47,12 @@ body {
|
|||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
pre {
|
||||
code {
|
||||
border: 0;
|
||||
}
|
||||
}
|
||||
|
||||
pre {
|
||||
padding: 1.3em;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,6 @@
|
|||
@charset "utf-8";
|
||||
@import 'normalize';
|
||||
@import 'compass';
|
||||
@import 'variables';
|
||||
@import 'syntax';
|
||||
@import 'icon-font';
|
||||
|
||||
/*
|
||||
|
|
@ -84,6 +82,7 @@ html, body {
|
|||
// This is the logo at the top of the ToC
|
||||
&>img {
|
||||
display: block;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
&>.search {
|
||||
|
|
@ -340,7 +339,7 @@ html, body {
|
|||
padding: 0 $main-padding;
|
||||
box-sizing: border-box;
|
||||
display: block;
|
||||
@include text-shadow($main-embossed-text-shadow);
|
||||
text-shadow: $main-embossed-text-shadow;
|
||||
|
||||
@extend %left-col;
|
||||
}
|
||||
|
|
@ -471,7 +470,7 @@ html, body {
|
|||
aside {
|
||||
padding-top: 1em;
|
||||
padding-bottom: 1em;
|
||||
@include text-shadow(0 1px 0 lighten($aside-notice-bg, 15%));
|
||||
text-shadow: 0 1px 0 lighten($aside-notice-bg, 15%);
|
||||
margin-top: 1.5em;
|
||||
margin-bottom: 1.5em;
|
||||
background: $aside-notice-bg;
|
||||
|
|
@ -479,12 +478,12 @@ html, body {
|
|||
|
||||
&.warning {
|
||||
background-color: $aside-warning-bg;
|
||||
@include text-shadow(0 1px 0 lighten($aside-warning-bg, 15%));
|
||||
text-shadow: 0 1px 0 lighten($aside-warning-bg, 15%);
|
||||
}
|
||||
|
||||
&.success {
|
||||
background-color: $aside-success-bg;
|
||||
@include text-shadow(0 1px 0 lighten($aside-success-bg, 15%));
|
||||
text-shadow: 0 1px 0 lighten($aside-success-bg, 15%);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -511,7 +510,7 @@ html, body {
|
|||
margin: -2px;
|
||||
border-radius: 4px;
|
||||
border: 1px solid #F7E633;
|
||||
@include text-shadow(1px 1px 0 #666);
|
||||
text-shadow: 1px 1px 0 #666;
|
||||
background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%);
|
||||
}
|
||||
}
|
||||
|
|
@ -534,7 +533,7 @@ html, body {
|
|||
clear:right;
|
||||
|
||||
box-sizing: border-box;
|
||||
@include text-shadow(0px 1px 2px rgba(0,0,0,0.4));
|
||||
text-shadow: 0px 1px 2px rgba(0,0,0,0.4);
|
||||
|
||||
@extend %right-col;
|
||||
|
||||
|
|
@ -618,3 +617,11 @@ html, body {
|
|||
margin-top: $main-padding;
|
||||
}
|
||||
}
|
||||
|
||||
.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs {
|
||||
color: #909090;
|
||||
}
|
||||
|
||||
.highlight, .highlight .w {
|
||||
background-color: $code-bg;
|
||||
}
|
||||
Loading…
Reference in a new issue