Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ringcentral/slate
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: master
Choose a base ref
...
head repository: codeclimate/slate
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Jun 27, 2015

  1. Fix Changelog date

    Version 1.2 was released in 2015 not 2014
    johnf committed Jun 27, 2015
    Copy the full SHA
    f359165 View commit details

Commits on Jun 28, 2015

  1. Merge pull request #288 from johnf/patch-1

    Fix Changelog date
    lord committed Jun 28, 2015
    Copy the full SHA
    dcc563b View commit details
  2. Update RedCarpet gem

    lord committed Jun 28, 2015
    Copy the full SHA
    ae3d502 View commit details

Commits on Jul 7, 2015

  1. Copy the full SHA
    ad3b276 View commit details

Commits on Jul 16, 2015

  1. Add OAuth.io to README

    rezanachmad committed Jul 16, 2015
    Copy the full SHA
    0c37f0d View commit details
  2. Merge pull request #303 from rezanachmad/patch-1

    Add OAuth.io to README
    lord committed Jul 16, 2015
    Copy the full SHA
    b9d45b2 View commit details

Commits on Jul 27, 2015

  1. Merge pull request #292 from tripit/dev

    Slate 1.2.1
    @lord my fault, I seemed to have totally missed the emails sent!
    Tariq Islam committed Jul 27, 2015
    Copy the full SHA
    adeb496 View commit details

Commits on Jul 29, 2015

  1. Improved the appearance of code blocks when printing.

    Ivan Matyunin committed Jul 29, 2015
    Copy the full SHA
    5cfcbc7 View commit details
  2. Merge pull request #309 from sibrus/dev

    Improved the appearance of code blocks when printing.
    lord committed Jul 29, 2015
    Copy the full SHA
    ebc8810 View commit details

Commits on Aug 4, 2015

  1. Add Aircall.io to README

    pbechu committed Aug 4, 2015

    Unverified

    This commit is not signed, but one or more authors requires that any commit attributed to them is signed.
    Copy the full SHA
    5e60507 View commit details
  2. Merge pull request #313 from pbechu/patch-1

    Add Aircall.io to README
    lord committed Aug 4, 2015
    Copy the full SHA
    eb1c0db View commit details

Commits on Aug 5, 2015

  1. adding supporkit docs as an example of the slate docs

    Dhiren Audich committed Aug 5, 2015
    Copy the full SHA
    87a2950 View commit details
  2. Merge pull request #316 from daudich/f/supporkit-doc-example

    adding supporkit docs as an example
    lord committed Aug 5, 2015
    Copy the full SHA
    b0e0192 View commit details
  3. Remove therubyracer

    dlackty committed Aug 5, 2015
    Copy the full SHA
    befb8d6 View commit details
  4. Merge pull request #318 from dlackty/remove-therubyracer-dev

    Remove therubyracer in favor of system JS runtimes
    lord committed Aug 5, 2015
    Copy the full SHA
    d4e9408 View commit details

Commits on Aug 6, 2015

  1. Copy the full SHA
    83d655b View commit details
  2. Update other dependencies

    dlackty committed Aug 6, 2015
    Copy the full SHA
    47e1861 View commit details
  3. Merge pull request #319 from dlackty/update-gems

    Update gems
    lord committed Aug 6, 2015
    Copy the full SHA
    07c5cce View commit details

Commits on Aug 8, 2015

  1. Use HTTPS for github urls.

    gabrielf committed Aug 8, 2015
    Copy the full SHA
    5d27eaf View commit details
  2. Merge pull request #324 from gabrielf/patch-2

    Use HTTPS for github urls.
    lord committed Aug 8, 2015
    Copy the full SHA
    22ffeba View commit details

Commits on Aug 13, 2015

  1. Copy the full SHA
    ed9e958 View commit details
  2. Fix path to iOS docs

    victorquinn committed Aug 13, 2015
    Copy the full SHA
    977f256 View commit details
  3. Merge pull request #327 from victorquinn/master

    Add SocialRadar to the list of docs sites using Slate
    lord committed Aug 13, 2015
    Copy the full SHA
    c90eab7 View commit details

Commits on Aug 27, 2015

  1. Copy the full SHA
    92d732f View commit details
  2. Merge pull request #331 from pomier/fix-dockerfile

    Fix Dockerfile by installing nodejs
    lord committed Aug 27, 2015
    Copy the full SHA
    7078f7f View commit details

Commits on Sep 23, 2015

  1. Copy the full SHA
    1c508a7 View commit details
  2. Merge pull request #335 from brettporter/patch-1

    Add SafetyCulture API to the list
    lord committed Sep 23, 2015
    Copy the full SHA
    9e42fbb View commit details

Commits on Sep 28, 2015

  1. Copy the full SHA
    fcea901 View commit details
  2. Merge pull request #339 from axsemantics/master

    make middleman pick up changes when run in docker
    lord committed Sep 28, 2015
    Copy the full SHA
    fd27069 View commit details

Commits on Sep 30, 2015

  1. Copy the full SHA
    e0cdc73 View commit details
  2. Merge pull request #344 from realityking/hostingDe

    Add hosting.de API docs to the list
    lord committed Sep 30, 2015
    Copy the full SHA
    787eb79 View commit details

Commits on Oct 6, 2015

  1. Merge branch 'master' into dev

    lord committed Oct 6, 2015
    Copy the full SHA
    236ca52 View commit details
  2. Basic support for Vagrant

    marcguyer committed Oct 6, 2015
    Copy the full SHA
    57aa27c View commit details
  3. Copy the full SHA
    dc45e38 View commit details
  4. Copy the full SHA
    4136f7b View commit details
  5. Update Vagrantfile

    Need git for `rake publish`
    marcguyer committed Oct 6, 2015
    Copy the full SHA
    ce2f2ae View commit details
  6. Update Vagrantfile

    More memory needed for `rake publish`
    marcguyer committed Oct 6, 2015
    Copy the full SHA
    4a3fdfa View commit details

Commits on Oct 8, 2015

  1. Copy the full SHA
    3c1c9c4 View commit details

Commits on Oct 9, 2015

  1. Merge pull request #350 from sproutbox/dev

    Basic Vagrant support. Close #348
    lord committed Oct 9, 2015
    Copy the full SHA
    727ac19 View commit details

Commits on Oct 11, 2015

  1. Copy the full SHA
    150ff8a View commit details

Commits on Oct 12, 2015

  1. Merge pull request #354 from rexposadas/fix-docker-error

    upgraded to wily to remove error from version trusty
    lord committed Oct 12, 2015
    Copy the full SHA
    e9cfc6b View commit details

Commits on Oct 22, 2015

  1. Add blockcypher to examples

    Michael Flaxman committed Oct 22, 2015
    Copy the full SHA
    f0a8dec View commit details
  2. Merge pull request #365 from mflaxman/patch-1

    Add blockcypher to examples
    lord committed Oct 22, 2015
    Copy the full SHA
    ecdce16 View commit details

Commits on Nov 4, 2015

  1. Copy the full SHA
    fb4c2a9 View commit details

Commits on Nov 5, 2015

  1. Copy the full SHA
    01fd020 View commit details
  2. Copy the full SHA
    1e86f82 View commit details
  3. Merge pull request #371 from djpowers/fix-broken-examples

    Fix broken examples
    lord committed Nov 5, 2015
    Copy the full SHA
    964c25a View commit details

Commits on Nov 12, 2015

  1. Added Links to InterServer Slate Implementation

    URL: https://my.interserver.net/apidoc/
    
    Our implementation includes some minor customizations which others mind fight useful including icons for the Language tabs at the top right.
    
    Side Note: The document contents including sample scripts , input/output parameter+descriptions, etc are generated entirely from a script i wrote that parses my SOAP API WSDL file, PHP Source (parsing phpdoc comments), and MySQL Table defintions (parsing field comments) to generate and populate all the neccesary info. At some point (faster if i have any requests for it ) ill make those scripts publicly available after i clean up the source a bit and make it more portable.
    detain committed Nov 12, 2015
    Copy the full SHA
    c763598 View commit details

Commits on Nov 14, 2015

  1. Merge pull request #380 from detain/master

    Added Links to InterServer Slate Implementation
    lord committed Nov 14, 2015
    Copy the full SHA
    1151d00 View commit details

Commits on Nov 16, 2015

  1. Update README.md

    add actionhero docs
    evantahler committed Nov 16, 2015
    Copy the full SHA
    40443b3 View commit details
Showing with 13,163 additions and 2,219 deletions.
  1. +15 −0 .github/ISSUE_TEMPLATE.md
  2. +5 −0 .github/PULL_REQUEST_TEMPLATE.md
  3. +4 −1 .gitignore
  4. +1 −0 .ruby-version
  5. +3 −2 .travis.yml
  6. +70 −2 CHANGELOG.md
  7. +46 −0 CODE_OF_CONDUCT.md
  8. +0 −9 CONTRIBUTING.md
  9. +0 −12 Dockerfile
  10. +8 −9 Gemfile
  11. +95 −106 Gemfile.lock
  12. +10 −0 Makefile
  13. +60 −62 README.md
  14. +0 −6 Rakefile
  15. +20 −1 config.rb
  16. +203 −0 deploy.sh
  17. +2 −0 docs/examples/issues/.env.example
  18. +5 −0 docs/examples/issues/Gemfile
  19. +26 −0 docs/examples/issues/Gemfile.lock
  20. +107 −0 docs/examples/issues/issues.rb
  21. +2 −0 docs/examples/test-coverage/.env.example
  22. +5 −0 docs/examples/test-coverage/Gemfile
  23. +26 −0 docs/examples/test-coverage/Gemfile.lock
  24. +101 −0 docs/examples/test-coverage/directory-coverage.rb
  25. +35 −0 docs/todo
  26. +8 −0 example-requests/create-org.json
  27. +8 −0 example-requests/create-private-repo.json
  28. +8 −0 example-requests/create-public-repo.json
  29. +17 −0 example-requests/trigger-event.json
  30. +16 −0 lib/multilang.rb
  31. +30 −0 lib/toc_data.rb
  32. +17 −0 lib/unique_head.rb
  33. BIN source/images/favicon.ico
  34. BIN source/images/logo.png
  35. +0 −20 source/includes/_errors.md
  36. +432 −0 source/includes/_organizations.html.md
  37. +146 −0 source/includes/_overview.html.md
  38. +97 −0 source/includes/_pull_requests.html.md
  39. +564 −0 source/includes/_repositories.html.md
  40. +573 −0 source/includes/_repository_analysis.html.md
  41. +200 −0 source/includes/_test_coverage.html.md
  42. +45 −0 source/includes/_users.html.md
  43. +17 −0 source/index.html.md
  44. +0 −168 source/index.md
  45. +1 −3 source/javascripts/all.js
  46. +14 −1 source/javascripts/all_nosearch.js
  47. +12 −10 source/javascripts/app/_lang.js
  48. +31 −7 source/javascripts/app/_search.js
  49. +104 −37 source/javascripts/app/_toc.js
  50. +7 −0 source/javascripts/lib/_imagesloaded.min.js
  51. +9,831 −0 source/javascripts/lib/_jquery.js
  52. +0 −1,042 source/javascripts/lib/_jquery.tocify.js
  53. +0 −566 source/javascripts/lib/_jquery_ui.js
  54. +35 −20 source/layouts/layout.erb
  55. 0 source/stylesheets/{_normalize.css → _normalize.scss}
  56. +0 −27 source/stylesheets/_syntax.scss.erb
  57. +40 −46 source/stylesheets/_variables.scss
  58. +6 −1 source/stylesheets/print.css.scss
  59. +55 −61 source/stylesheets/screen.css.scss
15 changes: 15 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<!--
⚠️ READ THIS BEFORE SUBMITTING ⚠️
• Prefix questions and feature requests with either Question: or Feature:
• If this is a bug report or question about an issue you're having, make sure to include the form below in your issue
-->

Operating system: ✍️ TODO
Last upstream commit (run `git log --author="Robert Lord" | head -n 1`): ✍️ TODO
Browser version(s): ✍️ TODO
Ruby version (run `ruby -v`): ✍️ TODO

---

✍️ TODO write your issue here
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!--
⚠️ 🚨 ⚠️ STOP AND READ THIS ⚠️ 🚨 ⚠️
👆👆 see that 'base fork' dropdown above? You should change it! The default value of "lord/slate" submits your change to ALL USERS OF SLATE, not just your company. This is PROBABLY NOT WHAT YOU WANT.
-->
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -14,9 +14,12 @@ tmp
*.DS_STORE
build/
.cache
.vagrant
.sass-cache
.env

# YARD artifacts
.yardoc
_yardoc
doc/
.idea/
.idea/
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
2.7.1
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -3,7 +3,8 @@ sudo: false
language: ruby

rvm:
- 1.9.3
- 2.0.0
- 2.3.3
- 2.4.0

cache: bundler
script: bundle exec middleman build
72 changes: 70 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,76 @@
# Changelog

## Version 2.0.0

*July 17, 2017*

- All-new statically generated table of contents
- Should be much faster loading and scrolling for large pages
- Smaller Javascript file sizes
- Avoids the problem with the last link in the ToC not ever highlighting if the section was shorter than the page
- Fixes control-click not opening in a new page
- Automatically updates the HTML title as you scroll
- Updated design
- New default colors!
- New spacings and sizes!
- System-default typefaces, just like GitHub
- Added search input delay on large corpuses to reduce lag
- We even bumped the major version cause hey, why not?
- Various small bug fixes

Thanks to everyone who helped debug or wrote code for this version! It was a serious community effort, and I couldn't have done it alone.

## Version 1.5.0

*February 23, 2017*

- Add [multiple tabs per programming language](https://github.com/lord/slate/wiki/Multiple-language-tabs-per-programming-language) feature
- Upgrade Middleman to add Ruby 1.4.0 compatibility
- Switch default code highlighting color scheme to better highlight JSON
- Various small typo and bug fixes

## Version 1.4.0

*November 24, 2016*

- Upgrade Middleman and Rouge gems, should hopefully solve a number of bugs
- Update some links in README
- Fix broken Vagrant startup script
- Fix some problems with deploy.sh help message
- Fix bug with language tabs not hiding properly if no error
- Add `!default` to SASS variables
- Fix bug with logo margin
- Bump tested Ruby versions in .travis.yml

## Version 1.3.3

*June 11, 2016*

Documentation and example changes.

## Version 1.3.2

*February 3, 2016*

A small bugfix for slightly incorrect background colors on code samples in some cases.

## Version 1.3.1

*January 31, 2016*

A small bugfix for incorrect whitespace in code blocks.

## Version 1.3

*January 27, 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, 2014*
*June 20, 2015*

**Fixes:**

@@ -21,7 +89,7 @@

## Version 1.1

*July 27th, 2014*
*July 27, 2014*

**Fixes:**

46 changes: 46 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as contributors and maintainers pledge to making participation in our project and our community a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable behavior and are expected to take appropriate and fair corrective action in response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, or to ban temporarily or permanently any contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful.

## Scope

This Code of Conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. Examples of representing a project or community include using an official project e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event. Representation of a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at hello@lord.io. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, available at [http://contributor-covenant.org/version/1/4][version]

[homepage]: http://contributor-covenant.org
[version]: http://contributor-covenant.org/version/1/4/
9 changes: 0 additions & 9 deletions CONTRIBUTING.md

This file was deleted.

12 changes: 0 additions & 12 deletions Dockerfile

This file was deleted.

17 changes: 8 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
ruby '>=2.3.1'
source 'https://rubygems.org'

# Middleman
gem 'middleman', '~>3.3.10'
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 'redcarpet', '~> 3.3.1'

gem 'rake', '~> 10.4.2'
gem 'therubyracer', '~> 0.12.1', platforms: :ruby
gem 'middleman', '~>4.2.1'
gem 'middleman-syntax', '~> 3.0.0'
gem 'middleman-autoprefixer', '~> 2.7.0'
gem "middleman-sprockets", "~> 4.1.0"
gem 'rouge', '~> 2.0.5'
gem 'redcarpet', '~> 3.4.0'
gem 'nokogiri', '~> 1.6.8'
201 changes: 95 additions & 106 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,140 +1,129 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.1.11)
i18n (~> 0.6, >= 0.6.9)
json (~> 1.7, >= 1.7.7)
activesupport (5.0.1)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
thread_safe (~> 0.1)
tzinfo (~> 1.1)
autoprefixer-rails (5.2.0.1)
addressable (2.5.0)
public_suffix (~> 2.0, >= 2.0.2)
autoprefixer-rails (6.6.1)
execjs
json
celluloid (0.16.0)
timers (~> 4.0.0)
chunky_png (1.3.4)
backports (3.6.8)
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.12.2)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
concurrent-ruby (1.0.4)
contracts (0.13.0)
dotenv (2.2.0)
erubis (2.7.0)
execjs (2.5.2)
ffi (1.9.8)
haml (4.0.6)
execjs (2.7.0)
fast_blank (1.0.0)
fastimage (2.0.1)
addressable (~> 2)
ffi (1.9.17)
haml (4.0.7)
tilt
hike (1.2.3)
hitimes (1.2.2)
hooks (0.4.0)
uber (~> 0.0.4)
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashie (3.5.1)
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)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
middleman (3.3.12)
kramdown (1.13.2)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
memoist (0.15.0)
middleman (4.2.1)
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.2.1)
middleman-core (= 4.2.1)
sass (>= 3.4.0, < 4.0)
uglifier (~> 2.5)
middleman-autoprefixer (2.4.4)
autoprefixer-rails (~> 5.2.0)
middleman-autoprefixer (2.7.1)
autoprefixer-rails (>= 6.5.2, < 7.0.0)
middleman-core (>= 3.3.3)
middleman-core (3.3.12)
activesupport (~> 4.1.0)
middleman-cli (4.2.1)
thor (>= 0.17.0, < 2.0)
middleman-core (4.2.1)
activesupport (>= 4.2, < 5.1)
addressable (~> 2.3)
backports (~> 3.6)
bundler (~> 1.1)
contracts (~> 0.13.0)
dotenv
erubis
hooks (~> 0.3)
execjs (~> 2.0)
fast_blank
fastimage (~> 2.0)
hamster (~> 3.0)
hashie (~> 3.4)
i18n (~> 0.7.0)
listen (>= 2.7.9, < 3.0)
padrino-helpers (~> 0.12.3)
rack (>= 1.4.5, < 2.0)
rack-test (~> 0.6.2)
thor (>= 0.15.2, < 2.0)
tilt (~> 1.4.1, < 2.0)
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)
rouge (~> 1.0)
minitest (5.7.0)
multi_json (1.11.1)
padrino-helpers (0.12.5)
listen (~> 3.0.0)
memoist (~> 0.14)
padrino-helpers (~> 0.13.0)
parallel
rack (>= 1.4.5, < 3)
sass (>= 3.4)
servolux
tilt (~> 2.0)
uglifier (~> 3.0)
middleman-sprockets (4.1.0)
middleman-core (~> 4.0)
sprockets (>= 3.0)
middleman-syntax (3.0.0)
middleman-core (>= 3.2)
rouge (~> 2.0)
mini_portile2 (2.1.0)
minitest (5.10.1)
nokogiri (1.6.8.1)
mini_portile2 (~> 2.1.0)
padrino-helpers (0.13.3.3)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.12.5)
tilt (~> 1.4.1)
padrino-support (0.12.5)
padrino-support (= 0.13.3.3)
tilt (>= 1.4.1, < 3)
padrino-support (0.13.3.3)
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-inotify (0.9.5)
parallel (1.10.0)
public_suffix (2.0.5)
rack (2.0.1)
rb-fsevent (0.9.8)
rb-inotify (0.9.8)
ffi (>= 0.5.0)
redcarpet (3.3.1)
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
thor (0.19.1)
redcarpet (3.4.0)
rouge (2.0.7)
sass (3.4.23)
servolux (0.12.0)
sprockets (3.7.1)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
thor (0.19.4)
thread_safe (0.3.5)
tilt (1.4.1)
timers (4.0.1)
hitimes
tilt (2.0.6)
tzinfo (1.2.2)
thread_safe (~> 0.1)
uber (0.0.13)
uglifier (2.7.1)
execjs (>= 0.3.0)
json (>= 1.8.0)
uglifier (3.0.4)
execjs (>= 0.3.0, < 3)

PLATFORMS
ruby

DEPENDENCIES
middleman (~> 3.3.10)
middleman-autoprefixer (~> 2.4.4)
middleman-gh-pages (~> 0.0.3)
middleman-syntax (~> 2.0.0)
rake (~> 10.4.2)
redcarpet (~> 3.3.1)
rouge (~> 1.9.0)
therubyracer (~> 0.12.1)
middleman (~> 4.2.1)
middleman-autoprefixer (~> 2.7.0)
middleman-sprockets (~> 4.1.0)
middleman-syntax (~> 3.0.0)
nokogiri (~> 1.6.8)
redcarpet (~> 3.4.0)
rouge (~> 2.0.5)

RUBY VERSION
ruby 2.3.3p222

BUNDLED WITH
1.14.5
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.PHONY: build serve

clean:
rm -rf $(PWD)/build

build: clean
docker run --rm -v $(PWD)/build:/srv/slate/build -v $(PWD)/source:/srv/slate/source slatedocs/slate build

serve:
docker run --rm -p 4567:4567 -v $(PWD)/source:/srv/slate/source slatedocs/slate serve
122 changes: 60 additions & 62 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,34 +1,36 @@
Slate
========
[![Netlify Status](https://api.netlify.com/api/v1/badges/78cef65a-aef9-4d95-b664-b9d850ec04d2/deploy-status)](https://app.netlify.com/sites/cc-api-docs/deploys)

[![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)

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://raw.githubusercontent.com/lord/img/master/logo-slate.png" alt="Slate: API Documentation Generator" width="226">
<br>
<a href="https://travis-ci.org/lord/slate"><img src="https://travis-ci.org/lord/slate.svg?branch=master" alt="Build Status"></a>
</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">
<p align="center">Slate helps you create beautiful, intelligent, responsive API documentation.</p>

*The example above was created with Slate. Check it out at [tripit.github.io/slate](http://tripit.github.io/slate).*
<p align="center"><img src="https://raw.githubusercontent.com/lord/img/master/screenshot-slate.png" width=700 alt="Screenshot of Example Documentation created with Slate"></p>

<p align="center"><em>The example above was created with Slate. Check it out at <a href="https://lord.github.io/slate">lord.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.
* **Out-of-the-box syntax highlighting** for [over 100 languages](https://github.com/jneen/rouge/wiki/List-of-supported-languages-and-lexers), 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!

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).
* **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.

<!--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).-->
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://lord.github.io/slate).

Getting Started with Slate
------------------------------
@@ -38,85 +40,81 @@ Getting Started with Slate
You're going to need:

- **Linux or OS X** — Windows may work, but is unsupported.
- **Ruby, version 1.9.3 or newer**
- **Ruby, version 2.3.1 or newer**
- **Bundler** — If Ruby is already installed, but the `bundle` command doesn't work, just run `gem install bundler` in a terminal.

### 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 Docker:

```shell
docker build -t slate .
docker run -d -p 4567:4567 slate
# either run this to run locally
bundle install
bundle exec middleman server

# OR you could use docker, for which there is a handy Makefile that you can use
# to build
make build
# to serve the docs on localhost:4567
make serve
```

You can now see the docs at <http://localhost:4567>. Whoa! That was fast!
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
availalable at the output of `boot2docker ip` instead of `localhost:4567`.*
Now that Slate is all set up on your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/lord/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/lord/slate/wiki/Deploying-Slate).

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).
If you'd prefer to use Docker, instructions are available [in the wiki](https://github.com/lord/slate/wiki/Docker).

Examples of Slate in the Wild
### Note on JavaScript Runtime

For those who don't have JavaScript runtime or are experiencing JavaScript runtime issues with ExecJS, it is recommended to add the [rubyracer gem](https://github.com/cowboyd/therubyracer) to your gemfile and run `bundle` again.

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/)
* [ChaiOne Gameplan API docs](http://chaione.github.io/gameplanb2b/#introduction)
* [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/)
* [IBM Cloudant](https://docs-testb.cloudant.com/content-review/_design/couchapp/index.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/)

(Feel free to add your site to this list in a pull request!)
* [NASA](https://api.nasa.gov)
* [IBM](https://docs.cloudant.com/api.html)
* [Sony](http://developers.cimediacloud.com)
* [Best Buy](https://bestbuyapis.github.io/api-documentation/)
* [Travis-CI](https://docs.travis-ci.com/api/)
* [Greenhouse](https://developers.greenhouse.io/harvest.html)
* [Woocommerce](http://woocommerce.github.io/woocommerce-rest-api-docs/)
* [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/)
* [Scale](https://docs.scaleapi.com/)

You can view more in [the list on the wiki](https://github.com/lord/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.

[Submit an issue](https://github.com/lord/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 interning at [TripIt](https://www.tripit.com/).

Thanks to the following people who have submitted major pull requests:

- [@chrissrogers](https://github.com/chrissrogers)
- [@bootstraponline](https://github.com/bootstraponline)
- [@realityking](https://github.com/realityking)
- [@cvkef](https://github.com/cvkef)

Also, thanks to [Sauce Labs](http://saucelabs.com) for helping sponsor the project.
Also, thanks to [Sauce Labs](http://saucelabs.com) for sponsoring the development of the responsive styles.

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 changes: 0 additions & 6 deletions Rakefile

This file was deleted.

21 changes: 20 additions & 1 deletion config.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Unique header generation
require './lib/unique_head.rb'

# Markdown
set :markdown_engine, :redcarpet
set :markdown,
@@ -7,7 +10,8 @@
prettify: true,
tables: true,
with_toc_data: true,
no_intra_emphasis: true
no_intra_emphasis: true,
renderer: UniqueHeadCounter

# Assets
set :css_dir, 'stylesheets'
@@ -17,6 +21,11 @@

# Activate the syntax highlighter
activate :syntax
ready do
require './lib/multilang.rb'
end

activate :sprockets

activate :autoprefixer do |config|
config.browsers = ['last 2 version', 'Firefox ESR']
@@ -30,9 +39,19 @@

# 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
# activate :asset_hash
# activate :gzip
end

# Deploy Configuration
# If you want Middleman to listen on a different port, you can set that below
set :port, 4567

helpers do
require './lib/toc_data.rb'
end
203 changes: 203 additions & 0 deletions deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,203 @@
#!/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.
"

bundle exec middleman build --clean

parse_args() {
# Set args from a local environment file.
if [ -e ".env" ]; then
source .env
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 "$@"
2 changes: 2 additions & 0 deletions docs/examples/issues/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CODECLIMATE_URL=https://api.codeclimate.com
CODECLIMATE_API_TOKEN=YOUR_TOKEN
5 changes: 5 additions & 0 deletions docs/examples/issues/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem "dotenv"
gem "activesupport"

26 changes: 26 additions & 0 deletions docs/examples/issues/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.1.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
concurrent-ruby (1.0.5)
dotenv (2.2.1)
i18n (0.9.1)
concurrent-ruby (~> 1.0)
minitest (5.10.3)
thread_safe (0.3.6)
tzinfo (1.2.4)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
activesupport
dotenv

BUNDLED WITH
1.15.3
107 changes: 107 additions & 0 deletions docs/examples/issues/issues.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
#!/usr/bin/env ruby

## Usage: ./issues.rb REPO_ID [BRANCH]
#
# Outputs CSV formatted list of all issues from most recent snapshot
# of the repo specified. Pipe STDOUT to a file to save to a file.
#
# Branch defaults to "master" if not specified.
#
# e.g. ./issues.rb 5017075af3ea000dc6000740
# e.g. ./issues.rb 5017075af3ea000dc6000740 development
#
# # Installation:
#
# 1. Install script's dependencies
#
# $ bundle install
#
# 2. Create .env file
#
# Copy .env.example to .env and change the variables as appropriate for your
# environment
#
# If you are a Code Climate Enterprise user, you CODECLIMATE_URL should look like:
# CODECLIMATE_URL=https://your-url.com/api
#
# A token for use with the API can be generated here (similar URL for CC:E):
#
# https://codeclimate.com/profile/tokens/new

require "dotenv"
require "net/http"
require "json"
require "csv"
require "active_support/core_ext/hash"

Dotenv.load

class CodeClimateRequest
def initialize
@base_uri = ENV["CODECLIMATE_URL"]
end

def request(path)
uri = URI("#{@base_uri}#{path}")
if ENV["DEBUG"] == "1"
STDERR.puts uri.to_s
end
http = Net::HTTP.new(uri.hostname, uri.port)
http.use_ssl = uri.scheme == "https" ? true : false
request = Net::HTTP::Get.new(uri.request_uri)
request.set_content_type("application/vnd.api+json")
request["Authorization"] = "Token token=#{ENV["CODECLIMATE_API_TOKEN"]}"
http.request(request)
end
end

repo_id = ARGV[0]
branch_name = ARGV[1] || "master"

query = {
"page[size]" => 1,
"filter[branch]" => branch_name,
"filter[analyzed]" => true,
}

path = "/v1/repos/#{repo_id}/ref_points?#{query.to_query}"

response = CodeClimateRequest.new.request(path)
if response.code == "200"
ref_point = JSON.parse(response.body)
if ref_point["data"].size > 0
snapshot_id = ref_point["data"].first["relationships"]["snapshot"]["data"]["id"]

if ENV["DEBUG"] == "1"
path = "/v1/repos/#{repo_id}/snapshots/#{snapshot_id}"
response = CodeClimateRequest.new.request(path)
commit_sha = JSON.parse(response.body)["data"]["attributes"]["commit_sha"]
STDERR.puts "DEBUG (stderr) -- repo: #{repo_id}, branch: #{branch_name}, sha: #{commit_sha}"
end

page_number = 1
query = {
"page[number]" => page_number
}
issues = nil
csv = CSV.new(STDOUT)
csv << ["File", "Remediation Points", "Issue"]
while issues.nil? || issues.size > 0
query["page[number]"] = page_number
path = "/v1/repos/#{repo_id}/snapshots/#{snapshot_id}/issues?#{query.to_query}"
response = CodeClimateRequest.new.request(path)
issues = JSON.parse(response.body)["data"]
issues.each do |issue|
csv << [issue["attributes"]["location"]["path"], issue["attributes"]["remediation_points"], issue["attributes"]["check_name"]]
end
page_number += 1
end
else
puts "Could not find any ref points for branch \"#{branch_name}\" and repo \"#{repo_id}\""
exit(1)
end
else
puts "Uh oh, something went wrong. Response code was #{response.code}"
puts response.body if response.body
exit(1)
end
2 changes: 2 additions & 0 deletions docs/examples/test-coverage/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
CODECLIMATE_URL=https://api.codeclimate.com
CODECLIMATE_API_TOKEN=YOUR_TOKEN
5 changes: 5 additions & 0 deletions docs/examples/test-coverage/Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gem "dotenv"
gem "activesupport"

26 changes: 26 additions & 0 deletions docs/examples/test-coverage/Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (5.1.4)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (~> 0.7)
minitest (~> 5.1)
tzinfo (~> 1.1)
concurrent-ruby (1.0.5)
dotenv (2.2.1)
i18n (0.9.1)
concurrent-ruby (~> 1.0)
minitest (5.10.3)
thread_safe (0.3.6)
tzinfo (1.2.4)
thread_safe (~> 0.1)

PLATFORMS
ruby

DEPENDENCIES
activesupport
dotenv

BUNDLED WITH
1.15.3
101 changes: 101 additions & 0 deletions docs/examples/test-coverage/directory-coverage.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
#!/usr/bin/env ruby

## Usage: ./directory-coverage.rb REPO_ID [path-1] [path-2] [path-3]
#
# Outputs current coverage percentage of passed directories
#
# e.g. ./directory-coverage.rb 5017075af3ea000dc6000740 app/models app/controllers
#
# # Installation:
#
# 1. Install script's dependencies
#
# $ bundle install
#
# 2. Create .env file
#
# Copy .env.example to .env and change the variables as appropriate for your
# environment
#
# If you are a Code Climate Enterprise user, you CODECLIMATE_URL should look like:
# CODECLIMATE_URL=https://your-url.com/api
#
# A token for use with the API can be generated here (similar URL for CC:E):
#
# https://codeclimate.com/profile/tokens/new

require "dotenv"
require "net/http"
require "json"
require "csv"
require "active_support/core_ext/hash"

Dotenv.load

class CodeClimateRequest
def initialize
@base_uri = ENV["CODECLIMATE_URL"]
end

def request(path)
uri = URI("#{@base_uri}#{path}")
STDERR.puts "GET #{uri.to_s}" if ENV["DEBUG"] == "1"
http = Net::HTTP.new(uri.hostname, uri.port)
http.use_ssl = uri.scheme == "https" ? true : false
request = Net::HTTP::Get.new(uri.request_uri)
request.set_content_type("application/vnd.api+json")
request["Authorization"] = "Token token=#{ENV["CODECLIMATE_API_TOKEN"]}"
http.request(request)
end
end

repo_id = ARGV.shift
paths = ARGV
STDERR.puts "Getting test coverage for: #{paths.join(",")}"

path_uri = "/v1/repos/#{repo_id}"

response = CodeClimateRequest.new.request(path_uri)
if response.code == "200"
repo = JSON.parse(response.body)
if test_report = repo["data"]["relationships"]["latest_default_branch_test_report"]["data"]
test_report_id = test_report["id"]
coverage = {}
paths.each do |path|
coverage[path] = { covered: 0, total: 0 }
end

page_number = 1
query = {
"page[number]" => page_number
}
test_file_reports = nil
while test_file_reports.nil? || test_file_reports.size > 0
query["page[number]"] = page_number
path_uri = "/v1/repos/#{repo_id}/test_reports/#{test_report_id}/test_file_reports?#{query.to_query}"
response = CodeClimateRequest.new.request(path_uri)
test_file_reports = JSON.parse(response.body)["data"]
test_file_reports.each do |test_file_report|
paths.select do |path|
test_file_report["attributes"]["path"].start_with?(path)
end.each do |path|
coverage[path][:covered] += test_file_report["attributes"]["line_counts"]["covered"]
coverage[path][:total] += test_file_report["attributes"]["line_counts"]["total"]
end
end
page_number += 1
end

paths.each do |path|
percentage_coverage = (coverage[path][:covered] / coverage[path][:total].to_f) * 100
puts "Coverage for #{path}: #{percentage_coverage.round(2)}%"
end

else
puts "No coverage reports found."
end
else
puts "Uh oh, something went wrong. Response code was #{response.code}"
puts response.body if response.body
exit(1)
end
35 changes: 35 additions & 0 deletions docs/todo
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
Some simpler API endpoints to start with:

GET /v1/repos(.:format) v1/repos#index
GET /v1/repos/:id(.:format) v1/repos#show
GET /v1/stars(.:format) v1/stars#index

Some non-GET endpoints to tackle next:

POST /v1/repos/:repo_id/star(.:format) v1/repos/stars#create
DELETE /v1/repos/:repo_id/star(.:format) v1/repos/stars#destroy
PATCH /v1/orgs/:org_id/permissions/:name(.:format) v1/orgs/permissions#update
PUT /v1/orgs/:org_id/permissions/:name(.:format) v1/orgs/permissions#update

Once those are done, we can break these down too:

POST /v1/repos/:repo_id/pulls/:pull_number/approvals(.:format) v1/repos/pulls/approvals#create
GET /v1/repos/:repo_id/commits/:commit_sha/files(.:format) v1/repos/commits/files#index
GET /v1/repos/:repo_id/commits/:commit_sha/files/:path(.:format) v1/repos/commits/files#show {:path=>/.*/}
GET /v1/repos/:repo_id/comparisons/:comparison_selector/coverage(.:format) v1/repos/comparisons/coverages#show {:comparison_selector=>/[^\/]+/}
GET /v1/repos/:repo_id/comparisons/:comparison_selector/rating_changes(.:format) v1/repos/comparisons/rating_changes#index {:comparison_selector=>/[^\/]+/}
GET /v1/repos/:repo_id/comparisons/:comparison_selector/issues(.:format) v1/repos/comparisons/issues#index {:comparison_selector=>/[^\/]+/}
GET /v1/repos/:repo_id/files(.:format) v1/repos/files#index
GET /v1/repos/:repo_id/files/:path(.:format) v1/repos/files#show {:path=>/.*/}
GET /v1/repos/:repo_id/metrics(.:format) v1/repos/metrics#index
GET /v1/repos/:repo_id/pull_requests/:number(.:format) v1/repos/pull_requests#show
GET /v1/repos/:repo_id/pulls/:pull_number/coverage(.:format) v1/repos/pulls/coverages#show
GET /v1/repos/:repo_id/ratings(.:format) v1/repos/ratings#index
POST /v1/repos/:repo_id/ref_points(.:format) v1/repos/ref_points#create
POST /v1/repos/:repo_id/requests(.:format) v1/repos/requests#create
PATCH /v1/repos/:repo_id/snapshots/:snapshot_id/issues/:id(.:format) v1/repos/snapshots/issues#update
PUT /v1/repos/:repo_id/snapshots/:snapshot_id/issues/:id(.:format) v1/repos/snapshots/issues#update
PATCH /v1/repos/:repo_id/vcs/webhook(.:format) v1/repos/vcs/webhooks#update
PUT /v1/repos/:repo_id/vcs/webhook(.:format) v1/repos/vcs/webhooks#update
PATCH /v1/repos/:repo_id/vcs/integration(.:format) v1/repos/vcs/integrations#update
PUT /v1/repos/:repo_id/vcs/integration(.:format) v1/repos/vcs/integrations#update
8 changes: 8 additions & 0 deletions example-requests/create-org.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"data": {
"type": "orgs",
"attributes": {
"name": "Black Lodge"
}
}
}
8 changes: 8 additions & 0 deletions example-requests/create-private-repo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"data": {
"type": "repos",
"attributes": {
"url": "https://github.com/codeclimate-testing/chef"
}
}
}
8 changes: 8 additions & 0 deletions example-requests/create-public-repo.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"data": {
"type": "repos",
"attributes": {
"url": "https://github.com/codeclimate-testing/brew"
}
}
}
17 changes: 17 additions & 0 deletions example-requests/trigger-event.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"data": {
"type": "service_event",
"attributes": {
"name": "issue",
"issue": {
"check_name": "Metrics/CyclomaticComplexity",
"description": "Cyclomatic complexity for method is too high.",
"details_url": "http://example.com/repos/1/issues#issue_12345",
"id": "12345",
"location": {
"path": "foo.rb"
}
}
}
}
}
16 changes: 16 additions & 0 deletions lib/multilang.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module Multilang
def block_code(code, full_lang_name)
if full_lang_name
parts = full_lang_name.split('--')
rouge_lang_name = (parts) ? parts[0] : "" # just parts[0] here causes null ref exception when no language specified
super(code, rouge_lang_name).sub("highlight #{rouge_lang_name}") do |match|
match + " tab-" + full_lang_name
end
else
super(code, full_lang_name)
end
end
end

require 'middleman-core/renderers/redcarpet'
Middleman::Renderers::MiddlemanRedcarpetHTML.send :include, Multilang
30 changes: 30 additions & 0 deletions lib/toc_data.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
require 'nokogiri'

def toc_data(page_content)
html_doc = Nokogiri::HTML::DocumentFragment.parse(page_content)

# get a flat list of headers
headers = []
html_doc.css('h1, h2, h3').each do |header|
headers.push({
id: header.attribute('id').to_s,
content: header.children,
level: header.name[1].to_i,
children: []
})
end

[3,2].each do |header_level|
header_to_nest = nil
headers = headers.reject do |header|
if header[:level] == header_level
header_to_nest[:children].push header if header_to_nest
true
else
header_to_nest = header if header[:level] < header_level
false
end
end
end
headers
end
17 changes: 17 additions & 0 deletions lib/unique_head.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Unique header generation
require 'middleman-core/renderers/redcarpet'
class UniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML
def initialize
super
@head_count = {}
end
def header(text, header_level)
friendly_text = text.parameterize
@head_count[friendly_text] ||= 0
@head_count[friendly_text] += 1
if @head_count[friendly_text] > 1
friendly_text += "-#{@head_count[friendly_text]}"
end
return "<h#{header_level} id='#{friendly_text}'>#{text}</h#{header_level}>"
end
end
Binary file added source/images/favicon.ico
Binary file not shown.
Binary file modified source/images/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 0 additions & 20 deletions source/includes/_errors.md

This file was deleted.

432 changes: 432 additions & 0 deletions source/includes/_organizations.html.md

Large diffs are not rendered by default.

146 changes: 146 additions & 0 deletions source/includes/_overview.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
# Overview

Code Climate's API exposes user, organization and repository data displayed and used by our web application (and browser extension).

The API complies with REST standards and the JSON API specification. In addition to our documentation here, you may find additional help by consulting the [JSON API specification](http://jsonapi.org/).

As per the JSON API, clients should use the [JSON API media type](http://jsonapi.org/format/#content-negotiation-clients) where appropriate (and the examples demonstrate this).

If your organization uses codeclimate.com, the URL for the api is: `https://api.codeclimate.com/`.

For on premise customers, use your normal Code Climate host name, but prefix endpoints with `/api`.

All endpoints are prefixed by the API version. The current version is `/v1`.

Following this, here are the base URLs (assuming current version):

**codeclimate.com:** `https://api.codeclimate.com/v1`

**On premise:** `https://{YOUR-CC-HOST-NAME}/api/v1`

## Authentication

> All authenticated calls must include a Authorization header including a valid token.
```shell
curl \
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
https://api.codeclimate.com/v1/user
```

> Make sure to replace `{TOKEN}` with your API access token.
Code Climate uses API access tokens to allow access to the API. You can generate a new Code Climate personal access token on codeclimate.com in the [token settings](https://codeclimate.com/profile/tokens) area of your Code Climate user profile.

Code Climate expects for the API token to be included in all API requests to the server in a header that looks like the following (replace {TOKEN} with your own):

`Authorization: Token token={TOKEN}`

## Data Types

Where possible, the Code Climate API uses consistent formats to represent common types. These are listed below.

Type | Format
-------------- | --------------
id | stringified BSON object id
timestamp | ISO8601-formatted timestamp (e.g. `2015-12-17T18:58:07.301Z`)

## Rate Limit

The API enforces a limit of 5,000 requests per token per hour.

## Collection Pagination

> Request for 3rd page with 10 items per page
```shell
curl \
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
--get \
--data-urlencode "page[size]=10" \
--data-urlencode "page[number]=3" \
https://api.codeclimate.com/v1/orgs
```

The Code Climate API supports pagination for resource collections.

As [per the JSON API](http://jsonapi.org/format/#fetching-pagination), paginate
through resources with a top level `page[]` query parameter. In the Code Climate API
(JSON API is agnostic to how `page[]` is used),
the `page[]` parameter supports nested `page` and `size` parameters.

Query parameter | Description | Default | Max |
--------------- | ----------- | ------- | --- |
page[size] | The number of items to return per page | 30 | 100 |
page[number] | The page number to request | 1 | n/a |

## Collection Filtering

> Filtering by basic key / value
```shell
curl \
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
--get \
--data-urlencode "filter[branch]=master" \
https://api.codeclimate.com/v1/repos/696a76232df2736347000001/ref_points
```

> Filtering with `$in` operator, passing multiple values. Note that the parameter is specified more than once:
```shell
curl \
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
--get \
--data-urlencode "filter[branch][\$in][]=master" \
--data-urlencode "filter[branch][\$in][]=development" \
https://api.codeclimate.com/v1/repos/696a76232df2736347000001/ref_points
```

> Filtering with the `$regex` operator. This can be used to find records with an attribute that matches a certain regular expression.
```shell
curl \
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
--get \
--data-urlencode "filter[path][\$regex]=.+\.yml" \
https://api.codeclimate.com/v1/repos/59371236d8638a029a0000ef/snapshots/623c2866a758be0001036c9f/files
```

In some cases, where specified, the Code Climate API supports filtering resource
collections.

As [per the JSON API](http://jsonapi.org/format/#fetching-filtering), filter
resources with a top level `filter[]` query parameter.

The JSON API is agnostic beyond the `filter[]` key. In the Code Climate API,
filters can be of two basic formats (examples on the right):

1. A basic key/value
2. A more complex data structure with an operator. At this time only the `$in` and `$regex` operators are supported.

See the `Query Parameters` section of each endpoint for details about what filters are supported.

## Fetching associated resources

Code Climate's API supports [loading associated resources](http://jsonapi.org/format/#fetching-includes) in a single API call.

To determine what associated resources can be loaded, inspect the `relationships` section of the API response. For example, the GET repo endpoint returns a JSON response with a `relationships` key, where one of the relationships is named `latest_default_branch_snapshot`.

Fetch the associated resource(s) by using the `include` query string parameter. Multiple included resources should use an `include[]` parameter, with resources specified as a comma-delimited list.

For example:

```shell
curl \
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
--get \
--data-urlencode "include[]=latest_default_branch_snapshot,account" \
https://api.codeclimate.com/v1/repos/696a76232df2736347000001
```
97 changes: 97 additions & 0 deletions source/includes/_pull_requests.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
# Pull Requests

## Get rating changes

```shell
curl \
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
--get \
--data-urlencode "filter[path]=lib/book.rb" \
https://api.codeclimate.com/v1/repos/696a76232df2736347000001/pulls/65/files
```

> JSON response:
```json
{
"data": [
{
"id": "69926c2c28352600010003db-59726c2f1e3c870001000312",
"type": "file_diffs",
"attributes": {
"to_rating": "unrated",
"from_rating": "unrated",
"path": "lib\/book.rb"
}
}
]
}
```

Returns rating changes for files in a pull request.

### HTTP Request

`GET https://api.codeclimate.com/v1/repos/:repo_id/pulls/:number/files`

### Query Parameters

[Filterable](#collection-filtering)

Filters include:

| Name | Description | Required? |
| ---- | ----------- | --------- |
| filter[path] | Complete file path for file to filter by | Yes |

## Approve PRs

```shell
curl \
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
--data-urlencode "data[attributes][reason]=merge" \
https://api.codeclimate.com/v1/repos/696a76232df2736347000001/pulls/65/approvals
```

> JSON response:
```json
{
"data": {
"id": "5a60de1a4668b4650a000b5a",
"type": "approvals",
"attributes": {
"reason": "merge",
"created_at": "2018-01-18T17:49:14.458Z"
},
"relationships": {
"author": {
"data": {
"id": "516341ca7e00a428b0015372",
"type": "users"
}
},
"pull_request": {
"data": {
"id": "5a60d683af0a490001000a71",
"type": "pull_requests"
}
},
"repo": {
"data": {
"id": "696a76232df2736347000001",
"type": "repos"
}
}
}
}
}
```

Approves a given pull request.

### HTTP Request

`POST https://api.codeclimate.com/v1/repos/:repo_id/pulls/:number/approvals`
564 changes: 564 additions & 0 deletions source/includes/_repositories.html.md

Large diffs are not rendered by default.

573 changes: 573 additions & 0 deletions source/includes/_repository_analysis.html.md

Large diffs are not rendered by default.

200 changes: 200 additions & 0 deletions source/includes/_test_coverage.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,200 @@
# Test Coverage

## Get test coverage reports

```shell
curl
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
--get \
--data-urlencode "page[size]=3" \
https://api.codeclimate.com/v1/repos/696a76232df2736347000001/test_reports
```

> JSON response
```json
{
"data": [
{
"id": "596ad7629c5b3756bc000003",
"type": "test_reports",
"attributes": {
"branch": "master",
"commit_sha": "cd3811626d5f723130417735d10a132f285795cc",
"committed_at": "2017-07-16T02:55:52.000Z",
"covered_percent": 84.946657957762,
"lines_of_code": 456,
"rating": {
"path": "\/",
"letter": "B",
"measure": {
"value": 84.946657957762,
"unit": "percent"
},
"pillar": "Test Coverage"
},
"received_at": "2018-09-06T20:25:28.098Z",
"state": "done"
}
},
{
"id": "596ad4e7e13a1a079100000f",
"type": "test_reports",
"attributes": {
"branch": "master",
"commit_sha": "a06a461bd0659d733073024434c952445fa4ba77",
"committed_at": "2017-07-16T02:36:27.000Z",
"covered_percent": 84.946657957762,
"rating": {
"path": "\/",
"letter": "B",
"measure": {
"value": 84.946657957762,
"unit": "percent"
},
"pillar": "Test Coverage"
},
"received_at": "2018-09-05T20:25:28.098Z",
"state": "done"
}
},
{
"id": "5969249a7834e60266000001",
"type": "test_reports",
"attributes": {
"branch": "master",
"commit_sha": "db36165a645abbb5ac78d3c70dffffa4aef7d832",
"committed_at": "2017-07-14T20:00:24.000Z",
"covered_percent": 84.9460024386,
"rating": {
"path": "\/",
"letter": "B",
"measure": {
"value": 84.9460024386,
"unit": "percent"
},
"pillar": "Test Coverage"
},
"received_at": "2018-09-04T20:25:28.098Z",
"state": "done"
}
}
],
"links": {
"self": "https:\/\/api.codeclimate.com\/v1\/repos\/696a76232df2736347000001\/test_reports?page%5Bnumber%5D=1&page%5Bsize%5D=3",
"next": "https:\/\/api.codeclimate.com\/v1\/repos\/696a76232df2736347000001\/test_reports?page%5Bnumber%5D=2&page%5Bsize%5D=3",
"last": "https:\/\/api.codeclimate.com\/v1\/repos\/696a76232df2736347000001\/test_reports?page%5Bnumber%5D=163&page%5Bsize%5D=3"
}
}
```

Gets collection of test coverage reports, sorted by committed at descending.

Each test coverage report contains the overall coverage percentage and test coverage rating
for the repository at a specific commit. Does not contain line by line coverage: line
by line coverage is available via the test file reports endpoint.

### HTTP Request

`GET https://api.codeclimate.com/v1/repos/:repo_id/test_reports`

### Query Parameters

[Paginated](#collection-pagination), [Filterable](#collection-filtering)

Filters include:

| Name | Description | Required? |
| ---- | ----------- | --------- |
| filter[branch] | Test reports associated with the specified `branch` | No |

## Get test coverage file reports

```shell
curl
-H "Accept: application/vnd.api+json"
-H "Authorization: Token token={TOKEN}"
--get
--data-urlencode "page[size]=3"
https://api.codeclimate.com/v1/repos/696a76232df2736347000001/test_reports/596ad7629c5b3756bc000003/test_file_reports
```

```json
{
"data": [
{
"id": "596ad7622df1731de500015e",
"type": "test_file_reports",
"attributes": {
"coverage": [4, 4, 4, 4, null, 4, null, 4, 6, 2, null, 2, null, null, null, 1, null, null, 1, null, null, 4, 6, 3, null, 3, null, 3, 2, 2, null, 1, null, null, null, 4, null, 4, 6, null, null, 4, null, null, 3, null, null, 4, 2, 2, 2, null, 2, null, null, null, null, null, null, 4, 2, 1, null, 1, null, null, null, null],
"covered_percent": 100,
"covered_strength": 3.0606060606061,
"path": "lib\/book.rb",
"line_counts": {
"missed": 0,
"covered": 33,
"total": 33
}
}
},
{
"id": "596ad7622df1731de5000147",
"type": "test_file_reports",
"attributes": {
"coverage": [4, 4, 4, null, 4, null, 4, 12, 5, null, 5, 1, null, null, 4, 1, null, null, 3, 1, null, null, 2, 2, null, null, 4, null, 4, 1, 1, null, null, 4, 1, null, null, null, null, null, 4, 1, null, null, null, null, null, 4, 2, null, 2, null, null, null, 4, 24, null, null, 4, 1, 1, null, null, null, null, 1, null, null, 4, 5, null, null, null],
"covered_percent": 100,
"covered_strength": 3.7647058823529,
"path": "lib\/group.rb",
"line_counts": {
"missed": 0,
"covered": 34,
"total": 34
}
}
},
{
"id": "596ad762e13a1a6a9d0000a8",
"type": "test_file_reports",
"attributes": {
"coverage": [4, 4, 4, null, 4, null, 4, 4, 6, null, 2, null, null, null],
"covered_percent": 100,
"covered_strength": 4,
"path": "lib\/user.rb",
"line_counts": {
"missed": 0,
"covered": 8,
"total": 8
}
}
}
],
"links": {
"self": "https:\/\/api.codeclimate.com\/v1\/repos\/696a76232df2736347000001\/test_reports\/596ad7629c5b3756bc000003\/test_file_reports?page%5Bnumber%5D=1&page%5Bsize%5D=3",
"next": "https:\/\/api.codeclimate.com\/v1\/repos\/696a76232df2736347000001\/test_reports\/596ad7629c5b3756bc000003\/test_file_reports?page%5Bnumber%5D=2&page%5Bsize%5D=3",
"last": "https:\/\/api.codeclimate.com\/v1\/repos\/696a76232df2736347000001\/test_reports\/596ad7629c5b3756bc000003\/test_file_reports?page%5Bnumber%5D=307&page%5Bsize%5D=3"
}
}
```

Gets collection of test coverage file reports, containing line by line coverage information.

The coverage attribute contains an array of coverage information. `null` in the array means that line is "uncoverable" (e.g. blank line or comment), a number in the array represents how many times that line was covered by tests.

Sorted by file paths in ascending order.

### HTTP Request

`GET https://api.codeclimate.com/v1/repos/:repo_id/test_reports/:test_report_id/test_file_reports`

### Query Parameters

[Paginated](#collection-pagination)

## Sending test coverage data

While the API also supports receiving test coverage data from your build, we generally do not recommend issuing calls against these endpoints yourself and as such have not documented them.

Instead, we recommend that you use [our test reporter client](https://github.com/codeclimate/test-reporter) which takes care of this plumbing for you.

If the test reporter doesn't suit your specific needs, open an issue or pull request on that repository.
45 changes: 45 additions & 0 deletions source/includes/_users.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# Users

## Get authenticated user

```shell
curl \
-H "Accept: application/vnd.api+json" \
-H "Authorization: Token token={TOKEN}" \
https://api.codeclimate.com/v1/user
```

> JSON response:
```json
{
"data": {
"id": "516342ca7e11a428b0025372",
"type": "users",
"attributes": {
"email": "dale@twinpeaks.com",
"enabled_features": [
"builder_pull_engines",
"disable_transactions",
"encrypted_ssh_private_keys"
],
"full_name": "Dale Cooper",
"staff": false,
"github_login": "dale_cooper"
},
"links": {
"avatar": "https:\/\/avatars.githubusercontent.com\/u\/122672"
}
}
}
```

Returns information about the authenticated user.

### HTTP Request

`GET https://api.codeclimate.com/v1/user`

### Query Parameters

N/A
17 changes: 17 additions & 0 deletions source/index.html.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
---
title: Code Climate API Reference

language_tabs:
- shell

includes:
- overview
- users
- organizations
- repositories
- repository_analysis
- test_coverage
- pull_requests

search: true
---
168 changes: 0 additions & 168 deletions source/index.md

This file was deleted.

4 changes: 1 addition & 3 deletions source/javascripts/all.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,2 @@
//= require ./lib/_energize
//= require ./app/_lang
//= require ./all_nosearch
//= require ./app/_search
//= require ./app/_toc
15 changes: 14 additions & 1 deletion source/javascripts/all_nosearch.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
//= require ./lib/_energize
//= require ./app/_lang
//= require ./app/_toc
//= require ./app/_lang

$(function() {
loadToc($('#toc'), '.toc-link', '.toc-list-h2', 10);
setupLanguages($('body').data('languages'));
$('.content').imagesLoaded( function() {
window.recacheHeights();
window.refreshToc();
});
});

window.onpopstate = function() {
activateLanguage(getLanguageFromQueryString());
};
22 changes: 12 additions & 10 deletions source/javascripts/app/_lang.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
//= require ../lib/_jquery

/*
Copyright 2008-2013 Concur Technologies, Inc.
@@ -13,13 +15,14 @@ WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations
under the License.
*/
(function (global) {
;(function () {
'use strict';

var languages = [];

global.setupLanguages = setupLanguages;
global.activateLanguage = activateLanguage;
window.setupLanguages = setupLanguages;
window.activateLanguage = activateLanguage;
window.getLanguageFromQueryString = getLanguageFromQueryString;

function activateLanguage(language) {
if (!language) return;
@@ -28,11 +31,13 @@ under the License.
$(".lang-selector a").removeClass('active');
$(".lang-selector a[data-language-name='" + language + "']").addClass('active');
for (var i=0; i < languages.length; i++) {
$(".highlight." + languages[i]).hide();
$(".highlight.tab-" + languages[i]).hide();
$(".lang-specific." + languages[i]).hide();
}
$(".highlight." + language).show();
$(".highlight.tab-" + language).show();
$(".lang-specific." + language).show();

global.toc.calculateHeights();
window.recacheHeights();

// scroll to the new location of the position
if ($(window.location.hash).get(0)) {
@@ -155,8 +160,5 @@ under the License.
activateLanguage(language);
return false;
});
window.onpopstate = function() {
activateLanguage(getLanguageFromQueryString());
};
});
})(window);
})();
38 changes: 31 additions & 7 deletions source/javascripts/app/_search.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
//= require ../lib/_lunr
//= require ../lib/_jquery
//= require ../lib/_jquery.highlight
(function () {
;(function () {
'use strict';

var content, searchResults;
var highlightOpts = { element: 'span', className: 'search-highlight' };
var searchDelay = 0;
var timeoutHandle = 0;

var index = new lunr.Index();

@@ -26,24 +29,44 @@
body: body.text()
});
});

determineSearchDelay();
}
function determineSearchDelay() {
if(index.tokenStore.length>5000) {
searchDelay = 300;
}
}

function bind() {
content = $('.content');
searchResults = $('.search-results');

$('#input-search').on('keyup', search);
$('#input-search').on('keyup',function(e) {
var wait = function() {
return function(executingFunction, waitTime){
clearTimeout(timeoutHandle);
timeoutHandle = setTimeout(executingFunction, waitTime);
};
}();
wait(function(){
search(e);
}, searchDelay );
});
}

function search(event) {

var searchInput = $('#input-search')[0];

unhighlight();
searchResults.addClass('visible');

// ESC clears the field
if (event.keyCode === 27) this.value = '';
if (event.keyCode === 27) searchInput.value = '';

if (this.value) {
var results = index.search(this.value).filter(function(r) {
if (searchInput.value) {
var results = index.search(searchInput.value).filter(function(r) {
return r.score > 0.0001;
});

@@ -53,10 +76,10 @@
var elem = document.getElementById(result.ref);
searchResults.append("<li><a href='#" + result.ref + "'>" + $(elem).text() + "</a></li>");
});
highlight.call(this);
highlight.call(searchInput);
} else {
searchResults.html('<li></li>');
$('.search-results li').text('No Results Found for "' + this.value + '"');
$('.search-results li').text('No Results Found for "' + searchInput.value + '"');
}
} else {
unhighlight();
@@ -72,3 +95,4 @@
content.unhighlight(highlightOpts);
}
})();

141 changes: 104 additions & 37 deletions source/javascripts/app/_toc.js
Original file line number Diff line number Diff line change
@@ -1,50 +1,117 @@
//= require ../lib/_jquery_ui
//= require ../lib/_jquery.tocify
(function (global) {
//= require ../lib/_jquery
//= require ../lib/_imagesloaded.min
;(function () {
'use strict';

var loaded = false;

var debounce = function(func, waitTime) {
var timeout = false;
return function() {
if (timeout === false) {
setTimeout(function() {
func();
timeout = false;
}, waitTime);
timeout = true;
}
};
};

var closeToc = function() {
$(".tocify-wrapper").removeClass('open');
$(".toc-wrapper").removeClass('open');
$("#nav-button").removeClass('open');
};

var makeToc = function() {
global.toc = $("#toc").tocify({
selectors: 'h1, h2',
extendPage: false,
theme: 'none',
smoothScroll: false,
showEffectSpeed: 0,
hideEffectSpeed: 180,
ignoreSelector: '.toc-ignore',
highlightOffset: 60,
scrollTo: -1,
scrollHistory: true,
hashGenerator: function (text, element) {
return element.prop('id');
function loadToc($toc, tocLinkSelector, tocListSelector, scrollOffset) {
var headerHeights = {};
var pageHeight = 0;
var windowHeight = 0;
var originalTitle = document.title;

var recacheHeights = function() {
headerHeights = {};
pageHeight = $(document).height();
windowHeight = $(window).height();

$toc.find(tocLinkSelector).each(function() {
var targetId = $(this).attr('href');
if (targetId[0] === "#") {
headerHeights[targetId] = $(targetId).offset().top;
}
});
};

var refreshToc = function() {
var currentTop = $(document).scrollTop() + scrollOffset;

if (currentTop + windowHeight >= pageHeight) {
// at bottom of page, so just select last header by making currentTop very large
// this fixes the problem where the last header won't ever show as active if its content
// is shorter than the window height
currentTop = pageHeight + 1000;
}

var best = null;
for (var name in headerHeights) {
if ((headerHeights[name] < currentTop && headerHeights[name] > headerHeights[best]) || best === null) {
best = name;
}
}
}).data('toc-tocify');

$("#nav-button").click(function() {
$(".tocify-wrapper").toggleClass('open');
$("#nav-button").toggleClass('open');
return false;
});
// Catch the initial load case
if (currentTop == scrollOffset && !loaded) {
best = window.location.hash;
loaded = true;
}

$(".page-wrapper").click(closeToc);
$(".tocify-item").click(closeToc);
};
var $best = $toc.find("[href='" + best + "']").first();
if (!$best.hasClass("active")) {
// .active is applied to the ToC link we're currently on, and its parent <ul>s selected by tocListSelector
// .active-expanded is applied to the ToC links that are parents of this one
$toc.find(".active").removeClass("active");
$toc.find(".active-parent").removeClass("active-parent");
$best.addClass("active");
$best.parents(tocListSelector).addClass("active").siblings(tocLinkSelector).addClass('active-parent');
$best.siblings(tocListSelector).addClass("active");
$toc.find(tocListSelector).filter(":not(.active)").slideUp(150);
$toc.find(tocListSelector).filter(".active").slideDown(150);
if (window.history.pushState) {
window.history.pushState(null, "", best);
}
// TODO remove classnames
document.title = $best.data("title") + " – " + originalTitle;
}
};

// Hack to make already open sections to start opened,
// instead of displaying an ugly animation
function animate () {
setTimeout(function() {
toc.setOption('showEffectSpeed', 180);
}, 50);
}
var makeToc = function() {
recacheHeights();
refreshToc();

$(makeToc);
$(animate);
$("#nav-button").click(function() {
$(".toc-wrapper").toggleClass('open');
$("#nav-button").toggleClass('open');
return false;
});
$(".page-wrapper").click(closeToc);
$(".toc-link").click(closeToc);

})(window);
// reload immediately after scrolling on toc click
$toc.find(tocLinkSelector).click(function() {
setTimeout(function() {
refreshToc();
}, 0);
});

$(window).scroll(debounce(refreshToc, 200));
$(window).resize(debounce(recacheHeights, 200));
};

makeToc();

window.recacheHeights = recacheHeights;
window.refreshToc = refreshToc;
}

window.loadToc = loadToc;
})();
7 changes: 7 additions & 0 deletions source/javascripts/lib/_imagesloaded.min.js
9,831 changes: 9,831 additions & 0 deletions source/javascripts/lib/_jquery.js

Large diffs are not rendered by default.

1,042 changes: 0 additions & 1,042 deletions source/javascripts/lib/_jquery.tocify.js

This file was deleted.

566 changes: 0 additions & 566 deletions source/javascripts/lib/_jquery_ui.js

This file was deleted.

55 changes: 35 additions & 20 deletions source/layouts/layout.erb
Original file line number Diff line number Diff line change
@@ -13,43 +13,47 @@ 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 || [] %>
<% page_content = yield %>
<%
if current_page.data.includes
current_page.data.includes.each do |include|
page_content += partial("includes/#{include}")
end
end
%>

<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<%= favicon_tag 'images/favicon.ico' %>
<title><%= current_page.data.title || "API Documentation" %></title>

<style>
<%= Rouge::Themes::MonokaiSublime.render(:scope => '.highlight') %>
</style>
<%= 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>
<% 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
<%= image_tag('navbar.png') %>
</span>
</a>
<div class="tocify-wrapper">
<%= image_tag "logo.png" %>
<% if language_tabs %>
<div class="toc-wrapper">
<%= image_tag "logo.png", class: 'logo' %>
<% if language_tabs.any? %>
<div class="lang-selector">
<% language_tabs.each do |lang| %>
<% if lang.is_a? Hash %>
@@ -66,7 +70,21 @@ under the License.
</div>
<ul class="search-results"></ul>
<% end %>
<div id="toc">
<div id="toc" class="toc-list-h1">
<% toc_data(page_content).each do |h1| %>
<li>
<a href="#<%= h1[:id] %>" class="toc-h1 toc-link" data-title="<%= h1[:content] %>"><%= h1[:content] %></a>
<% if h1[:children].length > 0 %>
<ul class="toc-list-h2">
<% h1[:children].each do |h2| %>
<li>
<a href="#<%= h2[:id] %>" class="toc-h2 toc-link" data-title="<%= h1[:content] %>"><%= h2[:content] %></a>
</li>
<% end %>
</ul>
<% end %>
</li>
<% end %>
</div>
<% if current_page.data.toc_footers %>
<ul class="toc-footer">
@@ -79,13 +97,10 @@ under the License.
<div class="page-wrapper">
<div class="dark-box"></div>
<div class="content">
<%= yield %>
<% current_page.data.includes && current_page.data.includes.each do |include| %>
<%= partial "includes/#{include}" %>
<% end %>
<%= page_content %>
</div>
<div class="dark-box">
<% if language_tabs %>
<% if language_tabs.any? %>
<div class="lang-selector">
<% language_tabs.each do |lang| %>
<% if lang.is_a? Hash %>
File renamed without changes.
27 changes: 0 additions & 27 deletions source/stylesheets/_syntax.scss.erb

This file was deleted.

86 changes: 40 additions & 46 deletions source/stylesheets/_variables.scss
Original file line number Diff line number Diff line change
@@ -23,53 +23,55 @@ under the License.

// BACKGROUND COLORS
////////////////////
$nav-bg: #393939;
$examples-bg: #393939;
$code-bg: #292929;
$code-annotation-bg: #1c1c1c;
$nav-subitem-bg: #262626;
$nav-active-bg: #2467af;
$lang-select-border: #000;
$lang-select-bg: #222;
$lang-select-active-bg: $examples-bg; // feel free to change this to blue or something
$lang-select-pressed-bg: #111; // color of language tab bg when mouse is pressed
$main-bg: #eaf2f6;
$aside-notice-bg: #8fbcd4;
$aside-warning-bg: #c97a7e;
$aside-success-bg: #6ac174;
$search-notice-bg: #c97a7e;
$nav-bg: #2E3336 !default;
$examples-bg: #2E3336 !default;
$code-bg: #1E2224 !default;
$code-annotation-bg: #191D1F !default;
$nav-subitem-bg: #1E2224 !default;
$nav-active-bg: #0F75D4 !default;
$nav-active-parent-bg: #1E2224 !default; // parent links of the current section
$lang-select-border: #000 !default;
$lang-select-bg: #1E2224 !default;
$lang-select-active-bg: $examples-bg !default; // feel free to change this to blue or something
$lang-select-pressed-bg: #111 !default; // color of language tab bg when mouse is pressed
$main-bg: #F3F7F9 !default;
$aside-notice-bg: #8fbcd4 !default;
$aside-warning-bg: #c97a7e !default;
$aside-success-bg: #6ac174 !default;
$search-notice-bg: #c97a7e !default;


// TEXT COLORS
////////////////////
$main-text: #333; // main content text color
$nav-text: #fff;
$nav-active-text: #fff;
$lang-select-text: #fff; // color of unselected language tab text
$lang-select-active-text: #fff; // color of selected language tab text
$lang-select-pressed-text: #fff; // color of language tab text when mouse is pressed
$main-text: #333 !default; // main content text color
$nav-text: #fff !default;
$nav-active-text: #fff !default;
$nav-active-parent-text: #fff !default; // parent links of the current section
$lang-select-text: #fff !default; // color of unselected language tab text
$lang-select-active-text: #fff !default; // color of selected language tab text
$lang-select-pressed-text: #fff !default; // color of language tab text when mouse is pressed


// SIZES
////////////////////
$nav-width: 230px; // width of the navbar
$examples-width: 50%; // portion of the screen taken up by code examples
$logo-margin: 20px; // margin between nav items and logo, ignored if search is active
$main-padding: 28px; // padding to left and right of content & examples
$nav-padding: 15px; // padding to left and right of navbar
$nav-v-padding: 10px; // padding used vertically around search boxes and results
$nav-indent: 10px; // extra padding for ToC subitems
$code-annotation-padding: 13px; // padding inside code annotations
$h1-margin-bottom: 21px; // padding under the largest header tags
$tablet-width: 930px; // min width before reverting to tablet size
$phone-width: $tablet-width - $nav-width; // min width before reverting to mobile size
$nav-width: 230px !default; // width of the navbar
$examples-width: 50% !default; // portion of the screen taken up by code examples
$logo-margin: 0px !default; // margin below logo
$main-padding: 28px !default; // padding to left and right of content & examples
$nav-padding: 15px !default; // padding to left and right of navbar
$nav-v-padding: 10px !default; // padding used vertically around search boxes and results
$nav-indent: 10px !default; // extra padding for ToC subitems
$code-annotation-padding: 13px !default; // padding inside code annotations
$h1-margin-bottom: 21px !default; // padding under the largest header tags
$tablet-width: 930px !default; // min width before reverting to tablet size
$phone-width: $tablet-width - $nav-width !default; // min width before reverting to mobile size


// FONTS
////////////////////
%default-font {
font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei","微软雅黑", STXihei, "华文细黑", sans-serif;
font-size: 13px;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
font-size: 14px;
}

%header-font {
@@ -86,12 +88,8 @@ $phone-width: $tablet-width - $nav-width; // min width before reverting to mobil

// OTHER
////////////////////
$nav-active-shadow: #000;
$nav-footer-border-color: #666;
$nav-embossed-border-top: #000;
$nav-embossed-border-bottom: #939393;
$main-embossed-text-shadow: 0px 1px 0px #fff;
$search-box-border-color: #666;
$nav-footer-border-color: #666 !default;
$search-box-border-color: #666 !default;


////////////////////////////////////////////////////////////////////////////////
@@ -100,10 +98,6 @@ $search-box-border-color: #666;
// These settings are probably best left alone.

%break-words {
word-break: break-all;

/* Non standard for webkit */
word-break: break-word;

hyphens: auto;
word-break: break-all;
hyphens: auto;
}
7 changes: 6 additions & 1 deletion source/stylesheets/print.css.scss
Original file line number Diff line number Diff line change
@@ -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;
}
116 changes: 55 additions & 61 deletions source/stylesheets/screen.css.scss
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
@charset "utf-8";
@import 'normalize';
@import 'compass';
@import 'variables';
@import 'syntax';
@import 'icon-font';

/*
@@ -48,16 +46,7 @@ html, body {
width: 20px;
}

@mixin embossed-bg {
background:
linear-gradient(to bottom, rgba(#000, 0.2), rgba(#000, 0) 8px),
linear-gradient(to top, rgba(#000, 0.2), rgba(#000, 0) 8px),
linear-gradient(to bottom, rgba($nav-embossed-border-top, 1), rgba($nav-embossed-border-top, 0) 1.5px),
linear-gradient(to top, rgba($nav-embossed-border-bottom, 1), rgba($nav-embossed-border-bottom, 0) 1.5px),
$nav-subitem-bg;
}

.tocify-wrapper {
.toc-wrapper {
transition: left 0.3s ease-in-out;

overflow-y: auto;
@@ -84,6 +73,7 @@ html, body {
// This is the logo at the top of the ToC
&>img {
display: block;
max-width: 100%;
}

&>.search {
@@ -111,8 +101,8 @@ html, body {
}
}

img+.tocify {
margin-top: $logo-margin;
.logo {
margin-bottom: $logo-margin;
}

.search-results {
@@ -124,13 +114,12 @@ html, body {
transition-property: height, margin;
transition-duration: 180ms;
transition-timing-function: ease-in-out;
background: $nav-subitem-bg;
&.visible {
height: 30%;
margin-bottom: 1em;
}

@include embossed-bg;

li {
margin: 1em $nav-padding;
line-height: 1;
@@ -147,14 +136,6 @@ html, body {
}


.tocify-item>a, .toc-footer li {
padding: 0 $nav-padding 0 $nav-padding;
display: block;
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}

// The Table of Contents is composed of multiple nested
// unordered lists. These styles remove the default
// styling of an unordered list because it is ugly.
@@ -169,32 +150,30 @@ html, body {
color: $nav-text;
transition-property: background;
transition-timing-function: linear;
transition-duration: 230ms;
transition-duration: 200ms;
}

// This is the currently selected ToC entry
.tocify-focus {
box-shadow: 0px 1px 0px $nav-active-shadow;
.toc-link.active {
background-color: $nav-active-bg;
color: $nav-active-text;
}

// Subheaders are the submenus that slide open
// in the table of contents.
.tocify-subheader {
display: none; // tocify will override this when needed
// this is parent links of the currently selected ToC entry
.toc-link.active-parent {
background-color: $nav-active-parent-bg;
color: $nav-active-parent-text;
}

.toc-list-h2 {
display: none;
background-color: $nav-subitem-bg;
font-weight: 500;
.tocify-item>a {
padding-left: $nav-padding + $nav-indent;
font-size: 12px;
}
}

// for embossed look:
@include embossed-bg;
&>li:last-child {
box-shadow: none; // otherwise it'll overflow out of the subheader
}
.toc-h2 {
padding-left: $nav-padding + $nav-indent;
font-size: 12px;
}

.toc-footer {
@@ -217,7 +196,19 @@ html, body {
text-decoration: none;
}
}
}

.toc-link, .toc-footer li {
padding: 0 $nav-padding 0 $nav-padding;
display: block;
overflow-x: hidden;
white-space: nowrap;
text-overflow: ellipsis;
text-decoration: none;
color: #fff;
transition-property: background;
transition-timing-function: linear;
transition-duration: 130ms;
}

// button to show navigation on mobile devices
@@ -325,6 +316,8 @@ html, body {
// This is all the stuff with the light background in the left half of the page

.content {
// fixes webkit rendering bug for some: see #538
-webkit-transform: translateZ(0);
// to place content above the dark box
position: relative;
z-index: 30;
@@ -340,7 +333,6 @@ html, body {
padding: 0 $main-padding;
box-sizing: border-box;
display: block;
@include text-shadow($main-embossed-text-shadow);

@extend %left-col;
}
@@ -356,14 +348,14 @@ html, body {

h1 {
@extend %header-font;
font-size: 30px;
font-size: 25px;
padding-top: 0.5em;
padding-bottom: 0.5em;
border-bottom: 1px solid #ccc;
margin-bottom: $h1-margin-bottom;
margin-top: 2em;
border-top: 1px solid #ddd;
background-image: linear-gradient(to bottom, #fff, #f9f9f9);
border-top: 1px solid #ccc;
border-bottom: 1px solid #ccc;
background-color: #fdfdfd;
}

h1:first-child, div:first-child + h1 {
@@ -373,13 +365,13 @@ html, body {

h2 {
@extend %header-font;
font-size: 20px;
font-size: 19px;
margin-top: 4em;
margin-bottom: 0;
border-top: 1px solid #ccc;
padding-top: 1.2em;
padding-bottom: 1.2em;
background-image: linear-gradient(to bottom, rgba(#fff, 0.4), rgba(#fff, 0));
background-image: linear-gradient(to bottom, rgba(#fff, 0.2), rgba(#fff, 0));
}

// h2s right after h1s should bump right up
@@ -471,20 +463,17 @@ html, body {
aside {
padding-top: 1em;
padding-bottom: 1em;
@include text-shadow(0 1px 0 lighten($aside-notice-bg, 15%));
margin-top: 1.5em;
margin-bottom: 1.5em;
background: $aside-notice-bg;
line-height: 1.6;

&.warning {
background-color: $aside-warning-bg;
@include 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%));
}
}

@@ -511,7 +500,6 @@ html, body {
margin: -2px;
border-radius: 4px;
border: 1px solid #F7E633;
@include text-shadow(1px 1px 0 #666);
background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%);
}
}
@@ -526,15 +514,13 @@ html, body {
background-color: $code-bg;
color: #fff;

padding: 2em $main-padding;
margin: 0;
width: $examples-width;

float:right;
clear:right;

box-sizing: border-box;
@include text-shadow(0px 1px 2px rgba(0,0,0,0.4));

@extend %right-col;

@@ -549,16 +535,16 @@ html, body {

pre {
@extend %code-font;
padding-top: 2em;
padding-bottom: 2em;
padding: 2em $main-padding;
}

blockquote {
&>p {
background-color: $code-annotation-bg;
border-radius: 5px;
padding: $code-annotation-padding;
color: #ccc;
border-top: 1px solid #000;
border-bottom: 1px solid #404040;
padding: $code-annotation-padding 2em;
color: #eee;
}
}
}
@@ -570,7 +556,7 @@ html, body {
// There are also a couple styles disperesed

@media (max-width: $tablet-width) {
.tocify-wrapper {
.toc-wrapper {
left: -$nav-width;

&.open {
@@ -586,7 +572,7 @@ html, body {
display: block;
}

.tocify-wrapper .tocify-item > a {
.toc-link {
padding-top: 0.3em;
padding-bottom: 0.3em;
}
@@ -601,7 +587,7 @@ html, body {
margin-right: 0;
}

.tocify-wrapper .lang-selector {
.toc-wrapper .lang-selector {
display: block;
}

@@ -618,3 +604,11 @@ html, body {
margin-top: $main-padding;
}
}

.highlight .c, .highlight .cm, .highlight .c1, .highlight .cs {
color: #909090;
}

.highlight, .highlight .w {
background-color: $code-bg;
}