Compare commits

...

154 commits

Author SHA1 Message Date
danbulant
f1e221ea5c Update info 2020-02-07 17:16:15 +01:00
danbulant
aa03936b5a build docs 2020-02-05 21:08:54 +01:00
danbulant
108a8ac5b2 Delete template lines & include files 2020-02-05 21:06:52 +01:00
danbulant
9204be36c2 Response format & types 2020-02-05 21:06:38 +01:00
danbulant
24cccd5dae Few words about planned JS lib 2020-02-05 21:06:27 +01:00
danbulant
af6dc62525 Add bakalari endpoint 2020-02-05 21:06:15 +01:00
danbulant
9936125675 Bump versions 2020-02-05 21:06:03 +01:00
danbulant
e098899319 Delete template file 2020-02-05 21:05:53 +01:00
danbulant
4cfdcc3f2c Delete original readme 2020-02-05 21:05:37 +01:00
Alex Mayer
274949c002
Update GitHub Links on example generated site (#1196) 2020-02-04 08:32:50 -05:00
Matthew Peveler
2019c63b83 Cut version 2.4.0 2019-10-20 19:49:48 -04:00
Matthew Peveler
bc5b66f9f8 [Security] Upgrade nokogiri to 1.10.4 (#1150) 2019-10-20 19:49:48 -04:00
Matthew Peveler
b3a4f1f5c5 Update url for travis badge 2019-10-20 19:49:48 -04:00
Gustavo Gawryszewski
894534b5d3 Updated README.md from lord/slate to slatedocs/slate (#1140) 2019-10-20 19:49:48 -04:00
Arun
151c3034c1 Change default value of base fork in PR template (#1137) 2019-10-20 19:49:48 -04:00
daniel-korbit
e7eb64785b change example link correctly (#1130) 2019-10-20 19:49:48 -04:00
Sam Gilman
36b7e4430d updated config.rb to activate asset_hash (#1076) 2019-10-20 19:49:48 -04:00
Dan
f81909ea6e Update issue templates 2019-10-20 19:49:48 -04:00
Robert Lord
0b195a9908 Update to bundler 2.0 in travis.yml 2019-10-20 19:49:48 -04:00
Robert Lord
98951d5ca9 Bundle update; upgrade middleman, add sass gem
Patch taken from #1092, thanks jakemack
2019-10-20 19:49:48 -04:00
Grey Baker
3dfde2c078 [Security] Bump rack from 2.0.5 to 2.0.6 (#1038)
Bumps [rack](https://github.com/rack/rack) from 2.0.5 to 2.0.6. **This update includes security fixes.**
- [Release notes](https://github.com/rack/rack/releases)
- [Changelog](https://github.com/rack/rack/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rack/rack/compare/2.0.5...2.0.6)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-10-20 19:49:48 -04:00
Grey Baker
16d2b1e27c [Security] Bump ffi from 1.9.17 to 1.9.25 (#1017)
Bumps [ffi](https://github.com/ffi/ffi) from 1.9.17 to 1.9.25. **This update includes security fixes.**
- [Release notes](https://github.com/ffi/ffi/releases)
- [Changelog](https://github.com/ffi/ffi/blob/master/CHANGELOG.md)
- [Commits](https://github.com/ffi/ffi/compare/1.9.17...1.9.25)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-10-20 19:49:48 -04:00
Jeff Stieler
c8b7355355 Fix lowercase "c" in "WooCommerce". (#1043) 2019-10-20 19:49:48 -04:00
Christian Oliff
99cdc40578 Update link in .editorconfig to https (#1049) 2019-10-20 19:49:48 -04:00
Grey Baker
1d6404a7b5 [Security] Bump nokogiri from 1.8.2 to 1.8.5 (#1026)
Bumps [nokogiri](https://github.com/sparklemotion/nokogiri) from 1.8.2 to 1.8.5. **This update includes security fixes.**
- [Release notes](https://github.com/sparklemotion/nokogiri/releases)
- [Changelog](https://github.com/sparklemotion/nokogiri/blob/master/CHANGELOG.md)
- [Commits](https://github.com/sparklemotion/nokogiri/compare/v1.8.2...v1.8.5)

Signed-off-by: dependabot[bot] <support@dependabot.com>
2019-10-20 19:49:48 -04:00
Robert Lord
ab0b3e6d8e Update issue template to direct users to changelog instead of git commits 2019-10-20 19:49:48 -04:00
Robert Lord
de496848c1 Update sprockets, cut version 2.3.1 2018-07-05 16:32:01 -07:00
Robert Lord
d295437b9c Cut version 2.3 2018-07-05 16:28:32 -07:00
Robert Lord
b2119b0313 Fix ToC issues, fix #995 2018-07-05 16:28:05 -07:00
Nick Busey
e621be095a Adding js to language bindings in sample intro (#1000) 2018-07-05 15:18:22 -07:00
Grey Baker
05a6b8af8c [Security] Bump nokogiri from 1.6.8.1 to 1.8.2 (#980) 2018-05-21 14:48:49 -05:00
Ricardo Castro
867ac6b9e6 Remove invalid links (#979) 2018-04-24 21:11:26 -05:00
Sebastian Zaremba
3c99bbbac9 Make quotes consistent in Gemfile (#983) 2018-04-24 21:10:12 -05:00
Jerome Dahdah
7ecc79c93b Factor nav-padding into search input width (#967)
Hardcoded value of 30px no longer works when navigation padding is changed. This is now calculated dynamically.
2018-03-01 08:33:14 -08:00
Jerome Dahdah
c8941b0a05 Remove outdated Fidor Bank example (#963) 2018-02-27 07:47:55 -08:00
al-tr
dfe3d85e2f Remove IBM from "Companies Using Slate" (#964) 2018-02-27 07:47:22 -08:00
Andrey Fedorov
76b06fede7 Fixes #909, reverts "don't pushState", using replaceState instead (#949)
Partially reverts 95f924fd0d.
2018-02-08 14:22:41 -06:00
Andrey Fedorov
603d4cd797 Rename OS X to macOS in deploy.sh comment (#951) 2018-02-05 12:51:09 -06:00
Andrey Fedorov
87b84e0721 Rename OS X as macOS (#950) 2018-02-05 12:50:41 -06:00
Samuel Cousin
e30e35004e Update .editorconfig to allow trailing whitespace in .md files (#947) 2018-01-28 15:22:19 -06:00
Dan Levy
dd8e04c6f4 Cleans HTML before setting document.title (#946)
Fixes https://github.com/lord/slate/issues/945
2018-01-28 15:21:01 -06:00
Robert Lord
55cbe85ca8 Increase memory of Vagrant, fixes #601 hopefully 2018-01-20 13:08:14 -06:00
Robert Lord
b742b60413 Fix broken list, replaces #918 2018-01-20 12:41:03 -06:00
Tomi Takussaari
8af90c16c5 Upgrade to latest jQuery (3.2.1) (#939) 2018-01-20 12:37:44 -06:00
Robert Lord
e70fdf11fc Allow strikethrough with two tildes in markdown, fixes #929 2018-01-19 14:13:11 -06:00
Robert Lord
2245e95e48 Add changelog for 2.2 2018-01-19 13:57:35 -06:00
Robert Lord
57b013f483 Add notes about spectrum 2018-01-19 13:52:04 -06:00
Emir Ribić
4698045e79 Update README.md (#919)
Fixed typo
2017-12-04 07:57:10 -08:00
Gregor Martynus
c310afa807 remove unneccessary offensive language :hug: (#910) 2017-11-28 16:26:02 -08:00
Robert Lord
e95a16d55f Fix bug where wrapping the logo in an <a> tag would brake it 2017-11-23 13:09:21 -08:00
Robert Lord
48807d74c9 Fix #837 Chinese, Russian headers, thx finalnova 2017-11-23 10:40:00 -08:00
Robert Lord
7ef0fd4327 Parameterize ToC titles, remove html tags from slug (thx seweil), fixes #904 2017-11-23 10:23:52 -08:00
Martius
2056b4a4b9 fixed Markdown code formatting using backticks inside HTML code block in _errors.md (#905) 2017-11-23 09:53:50 -08:00
Vladimir Morozov
4f915e9cb2 Add optional NestingUniqueHeadCounter header ID generator
* Move nesting generator to separate class

* Major bug fix, code simplification

* Get rid of global value, use class variable instead.
2017-11-09 09:14:43 -06:00
Robert Lord
b6cf496445 Update nav-text to update toc text too, fixes #885 2017-10-30 00:30:04 -05:00
Jay Thomas
e3e84d95da Add editorconfig (#891) 2017-10-30 00:11:55 -05:00
Robert Lord
cf29f6786c Add 2.1.0 changelog notes 2017-10-30 00:06:37 -05:00
Ben
adf815e35f Fix data-title attribute for H2 elements in TOC (#884)
I believe the data-title attribute for H2 elements was mistakenly using the parent H1 content as its value, rather than its own content.
2017-09-30 16:39:15 -05:00
Robert Lord
bdf8548cc7 Comment out rtl direction by default 2017-09-16 14:43:57 -05:00
Mohammad Hossein Rabiee
024c6dc962 Slate RTL (#842) 2017-09-16 14:43:17 -05:00
Zach Toolson
95f924fd0d Do not push history state. The browser already handles back properly (#878) 2017-09-13 23:17:16 -05:00
Fouad Matin
e97630b186 source: update index.html.md s/tripit/lord/g 2017-09-06 14:59:08 -04:00
Nicolas Bonduel
a1ba73f437 Update screen.css.scss
Add possibility to have the ´code´ tag inside the content tables
2017-08-09 14:00:55 -07:00
Marian Friedmann
4f3116a68c Add border width to negative margin to prevent jumps 2017-07-27 08:19:11 -07:00
Christian Oliff
29b35a3388 Correct capitalization of PayPal and GitHub 2017-07-22 11:30:23 -07:00
Diego
a00b046b3d Update_lang.js
on line 101 missing a semicolon
2017-07-20 11:01:19 -07:00
PotHix
1087f8bd69 Document --source-only and add --push-only
The `--source-only` already works to only build and not deploy. But
sometimes we want to just push and not build. An example of that is
when you want to use Docker to build the project, avoiding the
installation of the whole Ruby environment in your computer.

This commit adds `--push-only` to add the ability to execute only the
actions related to `git` and avoid the project build.

No API was broken by this commit, it's a minor change.
2017-07-20 11:00:30 -07:00
Abdullah Hashim
2e88f725fa Changes retrieves to deletes
I think the use of the word retrieves in the DELETE request is used mistakenly.
2017-07-20 10:28:53 -07:00
Alejandro Aguirre
bdb6930310 Update_errors.md (#815)
Adding some punctuation marks.
2017-07-17 20:31:24 -07:00
Robert Lord
17b259a40d Create CODE_OF_CONDUCT.md 2017-07-17 11:44:09 -07:00
Robert Lord
f598b9c7d1 Add a few more release notes 2017-07-17 11:27:53 -07:00
Robert Lord
c5b06fe89e Add 2.0.0 release notes 2017-07-17 11:25:52 -07:00
Robert Lord
132e9c4856 Merge branch 'master' into dev 2017-07-17 11:17:09 -07:00
Robert Lord
e890c4bb8b Add note about language tabs as comment in default yaml frontmatter 2017-07-17 11:08:57 -07:00
Robert Lord
5663fb8b4f Fix bug with initial load of ToC always jumping to top 2017-07-06 23:32:43 -07:00
Steve Brandwood
4d3787afd7 Update Vagrant to Ruby 2.4 (#803)
fixes #802
2017-06-29 14:55:44 -07:00
Evan Ng
f326b1fa5e Add JavaScript Runtime to Readme (#796) 2017-06-22 13:37:17 -07:00
eliat123
2a63948592 Add configurable keypress delay before initiating search (#764) 2017-06-18 23:15:59 -07:00
Robert Lord
a6794138ef Remove old ruby from travis 2017-06-15 13:20:55 -07:00
Robert Lord
8b830994b9 Fix bug where head count always got larger across reloads 2017-06-15 13:05:03 -07:00
Robert Lord
685179d623 Solve improperly nested header problem, fixes #711 2017-06-15 12:52:42 -07:00
Robert Lord
614df2186b Update sponsor explanation text in readme 2017-06-15 12:34:34 -07:00
Robert Lord
1d0738d536 Require Ruby 2.3.1 2017-06-15 12:24:17 -07:00
Robert Lord
ef27cfccb3 Update issue template again 2017-06-15 12:10:43 -07:00
Robert Lord
d7760394b5 Update PR template 2017-06-15 12:08:41 -07:00
Robert Lord
bd69ab96e1 Add new issue template 2017-06-15 12:03:35 -07:00
Joshua Woodward
134454fc7a Update README.md (#787)
Looks like mozilla has moved to something else.
2017-06-15 11:09:30 -07:00
Ihor Omelchenko
0d586069e7 Vagrant file fix for ubuntu/trusty64 (#769)
* Fix screenshot link in readme

* Vagrant file fix for ubuntu/trusty64
2017-05-14 13:25:36 -05:00
Alyss Noland
39aaa0fca5 Adds unique header creation (#743) 2017-04-06 17:33:46 -05:00
Benjamin Chenebault
7b1e718672 A Vagrantfile based on debian/jessie64 (#708)
* Add VagrantFile compatible from debian/jessie64 box and latest ruby stable version (2.4.0)

* Fix indent in vagrantfile for jessie64

* Remove Vagrantfile for Jessie

* Replace Vagrantfile with debian/jessie and last ruby version
2017-03-31 14:57:15 -05:00
Robert Lord
61d7f08ff2 Fix nav subitem bg 2017-03-31 14:56:09 -05:00
Robert Lord
3db7835c38 Switch default fonts to system fonts, very slightly blueify default colors 2017-03-31 14:50:37 -05:00
Robert Lord
b2392fdd72 Fix screenshot link in readme 2017-03-28 22:25:47 -05:00
Robert Lord
9bb68a328a Bump links in readme 2017-03-20 13:28:26 -05:00
Robert Lord
0c30e8ed7a Fix bug with no-language code blocks erroring, fixes #716 2017-03-06 15:24:22 -06:00
Robert Lord
7090d80067 Add styling to parent links of current link 2017-03-02 10:39:38 -06:00
Robert Lord
4aae61a1dc Fix bug where clicking link in ToC wouldn't hide ToC on mobile 2017-03-02 10:39:37 -06:00
Robert Lord
5d0bef6c87 Update gradients and colors for a more 2017 look 2017-03-02 10:39:37 -06:00
Matt Billock
599212e0ae Fixing an issue when no language is specified (#707)
parts[0] can lead to a nil class exception. Using the ternary gives the same functionality without causing things to fail
2017-02-28 12:35:58 -06:00
Robert Lord
f7d1bd1da5 Update ToC to preserve italics, see #551 2017-02-24 12:06:55 -06:00
Robert Lord
53e2f23e5c Static table of contents (#701)
* Add showing/hiding submenus, fix sidebar styling, fix bug where includes wouldn't appear in ToC

* Update ToC to highlight last header if page is scrolled to very bottom, fixes #280

* Set HTML title to current h1 section text, see #133

* Fix menu not opening on mobile

* Add back increase toc item height on mobile

* Fix padding bug

* Add back in ToC sliding animation
2017-02-24 11:57:39 -06:00
Robert Lord
e7f5144e4c Make logo-margin work even if search is enabled, see #692 for details 2017-02-24 11:22:22 -06:00
Robert Lord
1c0996227d Add webkit-transform hack to fix chrome rendering, fixes #538 2017-02-24 00:39:40 -06:00
Robert Lord
d3f7825977 Add version 1.5.0 changelog notes 2017-02-23 21:54:49 -06:00
Robert Lord
53b6fe156e Remove multiple language example from readme, users should just check wiki for instructions 2017-02-23 21:54:36 -06:00
Harry Eng
e1e4a77ad5 Typo Fix (#693)
* Fix Woocommerce link in readme

* Fixed _errors.md typo
2017-02-23 21:50:02 -06:00
Kevin Glowacz
577e7e7020 Update to middleman 4.2.1 for ruby 2.4 fix 2017-02-23 21:50:02 -06:00
Robert Lord
7ae2192b75 Allow Ruby 2.4.0 to fail for now 2017-02-23 21:50:02 -06:00
Robert Lord
b3c1a92484 Switch theme from Monokai to the less neon MonokaiSublime 2017-02-23 21:50:02 -06:00
Robert Lord
0d6c996595 Update code highlighting theme from Base16::Monokai to just Monokai 2017-02-23 21:50:02 -06:00
Robert Lord
8ed8f51851 Update middleman and middleman-sprokets, run bundle update 2017-02-23 21:50:02 -06:00
Robert Lord
64e4726088 Add Ruby 2.4.0 to .travis.yml 2017-02-23 21:50:02 -06:00
Paulo Coghi
37ea3fb419 Updated Mozilla localForage link (#665)
Old link was broken
2017-02-23 21:50:02 -06:00
halfcrazy
d117207651 Update redcarpet gem to 3.4.0 which will solve the unicode error with (#660)
h1/h2.
See https://github.com/vmg/redcarpet/issues/538
2017-02-23 21:50:02 -06:00
Vasyl Boroviak
cc0f6055ae Latest middleman - fixing startup arguments (#653)
As per https://github.com/middleman/middleman/issues/1866#issuecomment-221125503
Tested. It works.
2017-02-23 21:50:02 -06:00
Robert Lord
1fd867c2ff Add multiple-tabs-per-language test 2017-02-23 21:50:02 -06:00
Robert Lord
4352bd9f0c Add Ruby 2.3.3 to tested rubies 2017-02-23 21:50:02 -06:00
Ricky Rauch
dd2df450b2 Adding Scale to the list of companies. (#694) 2017-02-19 15:58:58 -06:00
Robert Lord
4c2574e2e8 Fix Woocommerce link in readme 2016-12-16 01:52:40 -08:00
Robert Lord
8d75089525 Cut version 1.4.0 2016-11-24 11:26:10 -06:00
Robert Lord
7857d862b3 Update pull requset template 2016-11-24 11:26:10 -06:00
Robert Lord
e8e2e5e144 Fix incorrect documentation in deploy.sh 2016-11-24 11:26:10 -06:00
Robert Lord
33515061b7 Add back in middleman flags to Vagrant with new flag syntax 2016-11-24 11:26:10 -06:00
Luke Hoersten
7d2ab1be7e Exec middleman server fails with invalid flags --force-polling and -l. Removed the flags to remedy. 2016-11-24 11:26:10 -06:00
Robert Lord
521969b9ee Update language list link and count in README 2016-11-24 11:26:10 -06:00
Robert Lord
62fb143490 Fix build, update middleman 2016-11-24 11:26:10 -06:00
Robert Lord
08cf3dc5c2 Fix bug where -margin wasn't properly respected even if search was off 2016-11-24 11:26:10 -06:00
Robert Lord
6831223f50 Update ruby version requirements in Travis and README 2016-11-24 11:26:10 -06:00
Robert Lord
20ed753723 Fix another bug where disabling language tabs didn't properly hide HTML 2016-11-24 11:26:10 -06:00
kissrain
a8e3737200 fix -margin 2016-11-24 11:26:10 -06:00
Michael Schramm
d1c3989a8d make scss variables changeable
all variables should only provide a default

this would allow us to include the screen.scss and simply set the variables we want to change before that.
2016-11-24 11:26:10 -06:00
Robert Lord
5712ebe2ae Upgrade sprockets 2016-11-24 11:26:10 -06:00
Robert Lord
e47cbe5e3b Update middleman-syntax 2016-11-24 11:26:10 -06:00
Robert Lord
f5b3a205b2 Remove unused gem middleman-gh-pages 2016-11-24 11:26:10 -06:00
Robert Lord
a2b61191c7 Add some company links to readme 2016-11-24 11:26:10 -06:00
Robert Lord
adfd4080bd Add Ruby 2.2.0 to Travis testing matrix 2016-11-24 11:26:10 -06:00
alliedsteel
483f5f8f1a Word missing on Readme.md (#592) 2016-09-15 11:19:59 -05:00
Robert Lord
6dd96e1c15 Bump CHANGELOG 2016-06-11 09:51:34 -05:00
Robert Lord
a68507a00e Remove CONTRIBUTING 2016-06-11 09:50:23 -05:00
Robert Lord
8d3eb0a433 Update readme 2016-06-11 09:49:56 -05:00
Robert Lord
e9384ed058 Add issue template 2016-06-10 22:05:39 -05:00
Robert Lord
31e021a01f Add PR template 2016-06-10 21:58:16 -05:00
Robert Lord
ad752cd538 Update rouge languages link in README 2016-06-10 17:23:21 -05:00
Robert Lord
ed6578ca73 Merge pull request #511 from Jameskmonger/patch-1
Add JavaScript examples
2016-05-24 09:33:49 -05:00
Robert Lord
1e54d1dd41 Merge pull request #464 from BaButtons/patch-1
Address #463
2016-05-24 00:09:57 -05:00
James Monger
cec5d662ad Add JavaScript examples 2016-04-21 11:38:08 +01:00
Robert Lord
f380e4c203 Note the need for an upgraded Ruby 2016-03-08 16:23:19 -06:00
Robert Lord
19d651a65a Add link to wiki 2016-03-01 20:46:01 -06:00
Robert Lord
13b113d1a5 Merge branch 'master' into dev 2016-03-01 20:44:01 -06:00
Robert Lord
979aaa91d5 Fixes #440, version 1.3.2 2016-03-01 20:43:54 -06:00
BaButtons
b84d76cd83 Add deploy configuration with a port set option
Addressing tripit/slate#463
2016-02-25 15:23:17 -05:00
Robert Lord
6a8c406f56 Merge pull request #454 from pra85/patch-2
Minor English Tweak
2016-02-11 16:42:51 -06:00
Prayag Verma
30c270c029 Minor English Tweak
Replace `a` with `an`
2016-02-10 23:47:10 +05:30
Robert Lord
28066ed281 Fixes #440, version 1.3.2 2016-02-03 16:19:16 -06:00
54 changed files with 10457 additions and 9969 deletions

18
.editorconfig Normal file
View file

@ -0,0 +1,18 @@
# EditorConfig is awesome: https://EditorConfig.org
# Top-most EditorConfig file
root = true
# Unix-style newlines with a newline ending every file
[*]
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
[*.rb]
charset = utf-8
[*.md]
trim_trailing_whitespace = false

27
.github/ISSUE_TEMPLATE/start-here.md vendored Normal file
View file

@ -0,0 +1,27 @@
---
name: Start Here
about: Help improve Slate!
title: "✍️ TODO"
labels: ''
assignees: ''
---
<!--
⚠️ READ THIS BEFORE SUBMITTING ⚠️
Thanks for submitting a bug to Slate! If you've got a question about how to implement some feature, are encountering some unusual behavior in your fork of Slate, or if you want to chat, please start a new thread in our Spectrum community here! I monitor it for new threads, and it makes it easy for knowledgeable members of the community to help solve problems.
-> https://spectrum.chat/slate <-
If you've found a bug with Slate upstream that you're still encountering even in a lightly modified Slate, you're in the right place! Please fill out the form below with the issue you're having and we'll take a look. :)
-->
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
.github/PULL_REQUEST_TEMPLATE.md vendored Normal file
View file

@ -0,0 +1,5 @@
<!--
⚠️ 🚨 ⚠️ STOP AND READ THIS ⚠️ 🚨 ⚠️
👆👆 see that 'base fork' dropdown above? You should change it! The default value of "slatedocs/slate" submits your change to ALL USERS OF SLATE, not just your company. This is PROBABLY NOT WHAT YOU WANT.
-->

View file

@ -3,8 +3,12 @@ sudo: false
language: ruby
rvm:
- 2.0.0
- 2.1.0
- 2.3.3
- 2.4.0
before_install:
- gem update --system
- gem install bundler
cache: bundler
script: bundle exec middleman build

View file

@ -1,5 +1,118 @@
# Changelog
## Version 2.4.0
*October 19, 2019*
- Move repository from lord/slate to slatedocs/slate
- Fix documentation to point at new repo link, thanks to [Arun](https://github.com/slash-arun), [Gustavo Gawryszewski](https://github.com/gawry), and [Daniel Korbit](https://github.com/danielkorbit)
- Update `nokogiri` to 1.10.4
- Update `ffi` in `Gemfile.lock` to fix security warnings, thanks to [Grey Baker](https://github.com/greysteil) and [jackmack](https://github.com/jakemack)
- Update `rack` to 2.0.7 in `Gemfile.lock` to fix security warnings, thanks to [Grey Baker](https://github.com/greysteil) and [jackmack](https://github.com/jakemack)
- Update middleman to `4.3` and relax constraints on middleman related gems, thanks to [jackmack](https://github.com/jakemack)
- Add sass gem, thanks to [jackmack](https://github.com/jackmack)
- Activate `asset_cache` in middleman to improve cacheability of static files, thanks to [Sam Gilman](https://github.com/thenengah)
- Update to using bundler 2 for `Gemfile.lock`, thanks to [jackmack](https://github.com/jakemack)
## Version 2.3.1
*July 5, 2018*
- Update `sprockets` in `Gemfile.lock` to fix security warnings
## Version 2.3
*July 5, 2018*
- Allows strikethrough in markdown by default.
- Upgrades jQuery to 3.2.1, thanks to [Tomi Takussaari](https://github.com/TomiTakussaari)
- Fixes invalid HTML in `layout.erb`, thanks to [Eric Scouten](https://github.com/scouten) for pointing out
- Hopefully fixes Vagrant memory issues, thanks to [Petter Blomberg](https://github.com/p-blomberg) for the suggestion
- Cleans HTML in headers before setting `document.title`, thanks to [Dan Levy](https://github.com/justsml)
- Allows trailing whitespace in markdown files, thanks to [Samuel Cousin](https://github.com/kuzyn)
- Fixes pushState/replaceState problems with scrolling not changing the document hash, thanks to [Andrey Fedorov](https://github.com/anfedorov)
- Removes some outdated examples, thanks [@al-tr](https://github.com/al-tr), [Jerome Dahdah](https://github.com/jdahdah), and [Ricardo Castro](https://github.com/mccricardo)
- Fixes `nav-padding` bug, thanks [Jerome Dahdah](https://github.com/jdahdah)
- Code style fixes thanks to [Sebastian Zaremba](https://github.com/vassyz)
- Nokogiri version bump thanks to [Grey Baker](https://github.com/greysteil)
- Fix to default `index.md` text thanks to [Nick Busey](https://github.com/NickBusey)
Thanks to everyone who contributed to this release!
## Version 2.2
*January 19, 2018*
- Fixes bugs with some non-roman languages not generating unique headers
- Adds editorconfig, thanks to [Jay Thomas](https://github.com/jaythomas)
- Adds optional `NestingUniqueHeadCounter`, thanks to [Vladimir Morozov](https://github.com/greenhost87)
- Small fixes to typos and language, thx [Emir Ribić](https://github.com/ribice), [Gregor Martynus](https://github.com/gr2m), and [Martius](https://github.com/martiuslim)!
- Adds links to Spectrum chat for questions in README and ISSUE_TEMPLATE
## Version 2.1
*October 30, 2017*
- Right-to-left text stylesheet option, thanks to [Mohammad Hossein Rabiee](https://github.com/mhrabiee)
- Fix for HTML5 history state bug, thanks to [Zach Toolson](https://github.com/ztoolson)
- Small styling changes, typo fixes, small bug fixes from [Marian Friedmann](https://github.com/rnarian), [Ben Wilhelm](https://github.com/benwilhelm), [Fouad Matin](https://github.com/fouad), [Nicolas Bonduel](https://github.com/NicolasBonduel), [Christian Oliff](https://github.com/coliff)
Thanks to everyone who submitted PRs for this version!
## Version 2.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
*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
*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*
@ -8,7 +121,7 @@ A small bugfix for incorrect whitespace in code blocks.
## Version 1.3
*January 27th, 2016*
*January 27, 2016*
We've upgraded Middleman and a number of other dependencies, which should fix quite a few bugs.
@ -35,7 +148,7 @@ Instead of `rake build` and `rake deploy`, you should now run `bundle exec middl
## Version 1.1
*July 27th, 2014*
*July 27, 2014*
**Fixes:**

46
CODE_OF_CONDUCT.md Normal file
View file

@ -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/

View file

@ -1,16 +0,0 @@
# Before You Submit an Issue
- Are you using Windows? We unfortunately don't support Windows. You could try using Docker, as outlined in the `README`.
- Is your version of Slate out of date? We have [upgrade instructions](https://github.com/tripit/slate/wiki/Updating-Slate) in the wiki. You could also try seeing if your problem is reproducible on the latest version of Slate.
If you answered "no" to each of the questions above, feel free to submit an issue! It's also helpful if you include a code example of your problem (if applicable), we can't help you if you just say "Slate stopped loading for me once I added my documentation" without telling us the problematic documentation.
# Before You Submit a Pull Request
Thanks for contributing to Slate! A couple of quick guidelines for submitting pull requests:
- **Please point your pull requests at the `dev` branch.** We don't accept pull requests to `master`.
- Please make sure your contributions work in the most recent version of Chrome, Firefox, and IE.
- If you're implementing a new feature, even if it's relatively small, it's nice to open an issue before you start so that others know what you're working on and can help make sure you're on the right track.
Thanks again! Happy coding.

16
Gemfile
View file

@ -1,10 +1,12 @@
ruby '>=2.3.1'
source 'https://rubygems.org'
# Middleman
gem 'middleman', '~>4.0.0'
gem 'middleman-gh-pages', '~> 0.0.3'
gem 'middleman-syntax', '~> 2.1.0'
gem 'middleman-autoprefixer', '~> 2.7.0'
gem "middleman-sprockets", "~> 4.0.0.rc"
gem 'rouge', '~> 1.10.1'
gem 'redcarpet', '~> 3.3.2'
gem 'middleman', '~>4.3'
gem 'middleman-syntax', '~> 3.0'
gem 'middleman-autoprefixer', '~> 2.7'
gem 'middleman-sprockets', '~> 4.1'
gem 'rouge', '~> 2.0.5'
gem 'redcarpet', '~> 3.4.0'
gem 'nokogiri', '~> 1.10.4'
gem 'sass'

View file

@ -1,134 +1,140 @@
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.5.1)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
activesupport (5.0.7.2)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
addressable (2.4.0)
autoprefixer-rails (6.3.1)
addressable (2.6.0)
public_suffix (>= 2.0.2, < 4.0)
autoprefixer-rails (9.5.1.1)
execjs
json
backports (3.6.7)
capybara (2.5.0)
mime-types (>= 1.16)
nokogiri (>= 1.3.3)
rack (>= 1.0.0)
rack-test (>= 0.5.4)
xpath (~> 2.0)
backports (3.15.0)
coffee-script (2.4.1)
coffee-script-source
execjs
coffee-script-source (1.10.0)
compass-import-once (1.0.5)
sass (>= 3.2, < 3.5)
concurrent-ruby (0.9.2)
contracts (0.12.0)
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
contracts (0.13.0)
dotenv (2.7.2)
erubis (2.7.0)
execjs (2.6.0)
fastimage (1.8.1)
addressable (~> 2.3, >= 2.3.5)
ffi (1.9.10)
haml (4.0.7)
execjs (2.7.0)
fast_blank (1.0.0)
fastimage (2.1.5)
ffi (1.11.1)
ffi (1.11.1-x64-mingw32)
haml (5.1.1)
temple (>= 0.8.0)
tilt
hamster (2.0.0)
concurrent-ruby (~> 0.8)
hashie (3.4.3)
i18n (0.7.0)
json (1.8.3)
kramdown (1.9.0)
listen (3.0.5)
rb-fsevent (>= 0.9.3)
rb-inotify (>= 0.9)
middleman (4.0.0)
hamster (3.0.0)
concurrent-ruby (~> 1.0)
hashie (3.6.0)
i18n (0.9.5)
concurrent-ruby (~> 1.0)
kramdown (1.17.0)
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
memoist (0.16.0)
middleman (4.3.4)
coffee-script (~> 2.2)
compass-import-once (= 1.0.5)
haml (>= 4.0.5)
kramdown (~> 1.2)
middleman-cli (= 4.0.0)
middleman-core (= 4.0.0)
sass (>= 3.4.0, < 4.0)
middleman-autoprefixer (2.7.0)
autoprefixer-rails (>= 6.3.1, < 7.0.0)
middleman-cli (= 4.3.4)
middleman-core (= 4.3.4)
middleman-autoprefixer (2.10.1)
autoprefixer-rails (~> 9.1)
middleman-core (>= 3.3.3)
middleman-cli (4.0.0)
middleman-cli (4.3.4)
thor (>= 0.17.0, < 2.0)
middleman-core (4.0.0)
activesupport (~> 4.2)
addressable (~> 2.4.0)
middleman-core (4.3.4)
activesupport (>= 4.2, < 5.1)
addressable (~> 2.3)
backports (~> 3.6)
bundler (~> 1.1)
capybara (~> 2.5.0)
contracts (~> 0.12.0)
bundler
contracts (~> 0.13.0)
dotenv
erubis
execjs (~> 2.0)
fastimage (~> 1.8)
hamster (~> 2.0)
fast_blank
fastimage (~> 2.0)
hamster (~> 3.0)
hashie (~> 3.4)
i18n (~> 0.7.0)
listen (~> 3.0)
i18n (~> 0.9.0)
listen (~> 3.0.0)
memoist (~> 0.14)
padrino-helpers (~> 0.13.0)
rack (>= 1.4.5, < 2.0)
sass (>= 3.4)
tilt (~> 1.4.1)
uglifier (~> 2.6)
middleman-gh-pages (0.0.3)
rake (> 0.9.3)
middleman-sprockets (4.0.0.rc.1)
middleman-core (>= 4.0.0.rc.1)
sprockets (~> 3.0)
middleman-syntax (2.1.0)
parallel
rack (>= 1.4.5, < 3)
sassc (~> 2.0)
servolux
tilt (~> 2.0.9)
uglifier (~> 3.0)
middleman-sprockets (4.1.1)
middleman-core (~> 4.0)
sprockets (>= 3.0)
middleman-syntax (3.0.0)
middleman-core (>= 3.2)
rouge (~> 1.0)
mime-types (3.0)
mime-types-data (~> 3.2015)
mime-types-data (3.2015.1120)
mini_portile2 (2.0.0)
minitest (5.8.4)
nokogiri (1.6.7.2)
mini_portile2 (~> 2.0.0.rc2)
padrino-helpers (0.13.1)
rouge (~> 2.0)
mini_portile2 (2.4.0)
minitest (5.11.3)
nokogiri (1.10.4)
mini_portile2 (~> 2.4.0)
nokogiri (1.10.4-x64-mingw32)
mini_portile2 (~> 2.4.0)
padrino-helpers (0.13.3.4)
i18n (~> 0.6, >= 0.6.7)
padrino-support (= 0.13.1)
tilt (~> 1.4.1)
padrino-support (0.13.1)
padrino-support (= 0.13.3.4)
tilt (>= 1.4.1, < 3)
padrino-support (0.13.3.4)
activesupport (>= 3.1)
rack (1.6.4)
rack-test (0.6.3)
rack (>= 1.0)
rake (10.4.2)
rb-fsevent (0.9.7)
rb-inotify (0.9.5)
ffi (>= 0.5.0)
redcarpet (3.3.4)
rouge (1.10.1)
sass (3.4.21)
sprockets (3.4.1)
parallel (1.17.0)
public_suffix (3.1.0)
rack (2.0.7)
rake (12.3.2)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
ffi (~> 1.0)
redcarpet (3.4.0)
rouge (2.0.7)
sass (3.7.4)
sass-listen (~> 4.0.0)
sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
sassc (2.0.1)
ffi (~> 1.9)
rake
servolux (0.13.0)
sprockets (3.7.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
thor (0.19.1)
thread_safe (0.3.5)
tilt (1.4.1)
tzinfo (1.2.2)
temple (0.8.1)
thor (0.20.3)
thread_safe (0.3.6)
tilt (2.0.9)
tzinfo (1.2.5)
thread_safe (~> 0.1)
uglifier (2.7.2)
execjs (>= 0.3.0)
json (>= 1.8.0)
xpath (2.0.0)
nokogiri (~> 1.3)
uglifier (3.2.0)
execjs (>= 0.3.0, < 3)
PLATFORMS
ruby
x64-mingw32
DEPENDENCIES
middleman (~> 4.0.0)
middleman-autoprefixer (~> 2.7.0)
middleman-gh-pages (~> 0.0.3)
middleman-sprockets (~> 4.0.0.rc)
middleman-syntax (~> 2.1.0)
redcarpet (~> 3.3.2)
rouge (~> 1.10.1)
middleman (~> 4.3)
middleman-autoprefixer (~> 2.7)
middleman-sprockets (~> 4.1)
middleman-syntax (~> 3.0)
nokogiri (~> 1.10.4)
redcarpet (~> 3.4.0)
rouge (~> 2.0.5)
sass
RUBY VERSION
ruby 2.3.3p222
BUNDLED WITH
1.10.6
2.1.4

106
README.md
View file

@ -1,105 +1,3 @@
<p align="center">
<img src="https://raw.githubusercontent.com/lord/img/master/logo-slate.png" alt="Slate: API Documentation Generator" width="226">
<br>
<a href="https://travis-ci.org/tripit/slate"><img src="https://travis-ci.org/tripit/slate.svg?branch=master" alt="Build Status"></a>
</p>
# Docs
<p align="center">Slate helps you create beautiful, intelligent, responsive API documentation.</p>
<p align="center"><img src="https://dl.dropboxusercontent.com/u/95847291/github%20images/slate/slate_screenshot_new.png" width=700 alt="Screenshot of Example Documentation created with Slate"></p>
<p align="center"><em>The example above was created with Slate. Check it out at <a href="https://tripit.github.io/slate">tripit.github.io/slate</a>.</em></p>
Features
------------
* **Clean, intuitive design** — With Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [Paypal's](https://developer.paypal.com/webapps/developer/docs/api/) API docs. Slate is responsive, so it looks great on tablets, phones, and even in print.
* **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.
* **Write code samples in multiple languages** — If your API has bindings in multiple programming languages, you can easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with Github Flavored Markdown.
* **Out-of-the-box syntax highlighting** for [almost 60 languages](http://rouge.jayferd.us/demo), no configuration required.
* **Automatic, smoothly scrolling table of contents** on the far left of the page. As you scroll, it displays your current position in the document. It's fast, too. We're using Slate at TripIt to build documentation for our new API, where our table of contents has over 180 entries. We've made sure that the performance remains excellent, even for larger documents.
* **Let your users update your documentation for you** — By default, your Slate-generated documentation is hosted in a public Github repository. Not only does this mean you get free hosting for your docs with Github Pages, but it also makes it simple for other developers to make pull requests to your docs if they find typos or other problems. Of course, if you don't want to use GitHub, you're also welcome to host your docs elsewhere.
Getting started with Slate is super easy! Simply fork this repository and follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](http://tripit.github.io/slate).
<!--As an example, you can check out the [TripIt API docs](http://tripit.github.io/api), which we create with Slate. You can also view the source of the [markdown file used to generate it](http://github.com/tripit/api/blob/master/source/index.md).-->
Getting Started with Slate
------------------------------
### Prerequisites
You're going to need:
- **Linux or OS X** — Windows may work, but is unsupported.
- **Ruby, version 1.9.3 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. Initialize and start Slate. You can either do this locally, or with Vagrant:
```shell
# either run this to run locally
bundle install
bundle exec middleman server
# OR run this to run with vagrant
vagrant up
```
You can now see the docs at http://localhost:4567. Whoa! That was fast!
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).
Companies Using Slate
---------------------------------
* [NASA](https://api.nasa.gov)
* [IBM Cloudant](https://docs.cloudant.com/api.html)
* [Travis-CI](https://docs.travis-ci.com/api/)
* [Mozilla](http://mozilla.github.io/localForage/)
* [Appium](http://appium.io/slate/en/master)
* [Dwolla](https://docs.dwolla.com/)
* [Clearbit](https://clearbit.com/docs)
* [Coinbase](https://developers.coinbase.com/api)
* [Parrot Drones](http://developer.parrot.com/docs/bebop/)
* [Fidor Bank](http://docs.fidor.de/)
You can view more in [the list on the wiki](https://github.com/tripit/slate/wiki/Slate-in-the-Wild).
Need Help? Found a bug?
--------------------
Read our [contribution guidelines](https://github.com/tripit/slate/blob/master/CONTRIBUTING.md), and then [submit a issue](https://github.com/tripit/slate/issues) to the Slate Github if you need any help. And, of course, feel free to submit pull requests with bug fixes or changes.
Contributors
--------------------
Slate was built by [Robert Lord](https://lord.io) while at [TripIt](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)
Also, thanks to [Sauce Labs](http://saucelabs.com) for helping sponsor the project.
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/edgecase/middleman-gh-pages)
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
This is a repository for API docs. See `danbulant.github.io/api_docs`.

11
Vagrantfile vendored
View file

@ -1,14 +1,19 @@
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network :forwarded_port, guest: 4567, host: 4567
config.vm.provider "virtualbox" do |vb|
vb.memory = "2048"
end
config.vm.provision "bootstrap",
type: "shell",
inline: <<-SHELL
sudo apt-add-repository ppa:brightbox/ruby-ng
sudo apt-get update
sudo apt-get install -yq ruby2.0 ruby2.0-dev pkg-config build-essential nodejs git libxml2-dev libxslt-dev
sudo apt-get install -yq ruby2.4 ruby2.4-dev
sudo apt-get install -yq pkg-config build-essential nodejs git libxml2-dev libxslt-dev
sudo apt-get autoremove -yq
gem2.0 install --no-ri --no-rdoc bundler
gem2.4 install --no-ri --no-rdoc bundler
SHELL
# add the local user git config to the vm
@ -34,6 +39,6 @@ Vagrant.configure(2) do |config|
echo "Starting up middleman at http://localhost:4567"
echo "If it does not come up, check the ~/middleman.log file for any error messages"
cd /vagrant
bundle exec middleman server --force-polling -l 1 &> ~/middleman.log &
bundle exec middleman server --watcher-force-polling --watcher-latency=1 &> ~/middleman.log &
SHELL
end

View file

@ -1,3 +1,6 @@
# Unique header generation
require './lib/unique_head.rb'
# Markdown
set :markdown_engine, :redcarpet
set :markdown,
@ -5,9 +8,11 @@ set :markdown,
smartypants: true,
disable_indented_code_blocks: true,
prettify: true,
strikethrough: true,
tables: true,
with_toc_data: true,
no_intra_emphasis: true
no_intra_emphasis: true,
renderer: UniqueHeadCounter
# Assets
set :css_dir, 'stylesheets'
@ -17,6 +22,11 @@ set :fonts_dir, 'fonts'
# 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,6 +40,7 @@ set :relative_links, true
# Build Configuration
configure :build do
activate :asset_hash
# If you're having trouble with Middleman hanging, commenting
# out the following two lines has been known to help
activate :minify_css
@ -38,3 +49,11 @@ configure :build do
# 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

View file

@ -15,22 +15,14 @@ Options:
deploy branch.
-n, --no-hash Don't append the source commit's hash to the deploy
commit's message.
-c, --config-file PATH Override default & environment variables' values
with those in set in the file at 'PATH'. Must be the
first option specified.
--source-only Only build but not push
--push-only Only push but not build
"
Variables:
GIT_DEPLOY_DIR Folder path containing the files to deploy.
GIT_DEPLOY_BRANCH Commit deployable files to this branch.
GIT_DEPLOY_REPO Push the deploy branch to this repository.
These variables have default values defined in the script. The defaults can be
overridden by environment variables. Any environment variables are overridden
by values set in a '.env' file (if it exists), and in turn by those set in a
file specified by the '--config-file' option."
bundle exec middleman build --clean
run_build() {
bundle exec middleman build --clean
}
parse_args() {
# Set args from a local environment file.
@ -38,12 +30,6 @@ parse_args() {
source .env
fi
# Set args from file specified on the command-line.
if [[ $1 = "-c" || $1 = "--config-file" ]]; then
source "$2"
shift 2
fi
# Parse arg flags
# If something is exposed as an environment variable, set/overwrite it
# here. Otherwise, set/overwrite the internal variable instead.
@ -98,25 +84,25 @@ main() {
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
# must use short form of flag in ls for compatibility with macOS 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
@ -124,7 +110,7 @@ main() {
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
@ -207,7 +193,7 @@ restore_head() {
else
git symbolic-ref HEAD refs/heads/$previous_branch
fi
git reset --mixed
}
@ -219,4 +205,11 @@ sanitize() {
"$@" 2> >(filter 1>&2) | filter
}
[[ $1 = --source-only ]] || main "$@"
if [[ $1 = --source-only ]]; then
run_build
elif [[ $1 = --push-only ]]; then
main "$@"
else
run_build
main "$@"
fi

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View file

@ -0,0 +1,14 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
<svg xmlns="http://www.w3.org/2000/svg">
<metadata>Generated by IcoMoon</metadata>
<defs>
<font id="slate" horiz-adv-x="1024">
<font-face units-per-em="1024" ascent="960" descent="-64" />
<missing-glyph horiz-adv-x="1024" />
<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
<glyph unicode="&#xe600;" d="M438.857 877.714q119.429 0 220.286-58.857t159.714-159.714 58.857-220.286-58.857-220.286-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857zM512 165.143v108.571q0 8-5.143 13.429t-12.571 5.429h-109.714q-7.429 0-13.143-5.714t-5.714-13.143v-108.571q0-7.429 5.714-13.143t13.143-5.714h109.714q7.429 0 12.571 5.429t5.143 13.429zM510.857 361.714l10.286 354.857q0 6.857-5.714 10.286-5.714 4.571-13.714 4.571h-125.714q-8 0-13.714-4.571-5.714-3.429-5.714-10.286l9.714-354.857q0-5.714 5.714-10t13.714-4.286h105.714q8 0 13.429 4.286t6 10z" />
<glyph unicode="&#xe602;" d="M585.143 164.571v91.429q0 8-5.143 13.143t-13.143 5.143h-54.857v292.571q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h54.857v-182.857h-54.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h256q8 0 13.143 5.143t5.143 13.143zM512 676.571v91.429q0 8-5.143 13.143t-13.143 5.143h-109.714q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h109.714q8 0 13.143 5.143t5.143 13.143zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
<glyph unicode="&#xe606;" d="M733.714 531.428q0 16-10.286 26.286l-52 51.429q-10.857 10.857-25.714 10.857t-25.714-10.857l-233.143-232.571-129.143 129.143q-10.857 10.857-25.714 10.857t-25.714-10.857l-52-51.429q-10.286-10.286-10.286-26.286 0-15.429 10.286-25.714l206.857-206.857q10.857-10.857 25.714-10.857 15.429 0 26.286 10.857l310.286 310.286q10.286 10.286 10.286 25.714zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
<glyph unicode="&#xe607;" d="M658.286 475.428q0 105.714-75.143 180.857t-180.857 75.143-180.857-75.143-75.143-180.857 75.143-180.857 180.857-75.143 180.857 75.143 75.143 180.857zM950.857 0q0-29.714-21.714-51.429t-51.429-21.714q-30.857 0-51.429 21.714l-196 195.429q-102.286-70.857-228-70.857-81.714 0-156.286 31.714t-128.571 85.714-85.714 128.571-31.714 156.286 31.714 156.286 85.714 128.571 128.571 85.714 156.286 31.714 156.286-31.714 128.571-85.714 85.714-128.571 31.714-156.286q0-125.714-70.857-228l196-196q21.143-21.143 21.143-51.429z" horiz-adv-x="951" />
</font></defs></svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 96 B

7
docs/includes/endpoints Normal file
View file

@ -0,0 +1,7 @@
<h1 id='endpoints'>Endpoints</h1><h2 id='bakalari'>Bakalari</h2>
<blockquote>
<p>Example request</p>
</blockquote>
<pre class="highlight shell tab-shell"><code>curl <span class="s2">"https://api.danbulant.eu/v1/bakalari/rozvrh/user/domain.tld/SecretPassword123"</span>
</code></pre>
<p>Tries getting the info from Bakalari API.</p>

4
docs/includes/libraries Normal file
View file

@ -0,0 +1,4 @@
<h1 id='libraries'>Libraries</h1><h2 id='js'>JS</h2>
<p><em>Currently unavailable, but planned.</em>
This library simplifies usage. It uses <code>got</code> under the hood for simplified request handling, and always returns promise.
Responses are just parsed JSON (as of now, but classes may be implemented in future).</p>

288
docs/includes/responses Normal file
View file

@ -0,0 +1,288 @@
<h1 id='response-format'>Response format</h1><h2 id='fields'>Fields</h2>
<p>Response is currently always in JSON (but we might support XML and JSONP if there will be someone who might use it). Response always has these fields:</p>
<table><thead>
<tr>
<th>Field</th>
<th>Purpose</th>
<th>example content</th>
</tr>
</thead><tbody>
<tr>
<td>code</td>
<td>Contains the HTTP code</td>
<td><code>200</code></td>
</tr>
<tr>
<td>message</td>
<td>A string containing sample message.</td>
<td><code>Success, see type.</code></td>
</tr>
<tr>
<td>type</td>
<td>A string with the type of returned data</td>
<td><code>ping_response</code></td>
</tr>
</tbody></table>
<p>Response may have additional fields, such as <code>url</code> or <code>data</code>. These depends on the type.</p>
<h2 id='types'>Types</h2>
<p>Types that start with <code>e_</code> are <em>always</em> errors. The following type can be retrieved:</p>
<h3 id='e_invalid_key-key-only-endpoints'><code>e_invalid_key</code> | Key-only endpoints</h3>
<p>The key given is invalid and cannot be used.</p>
<h3 id='e_missing_query'><code>e_missing_query</code> | *</h3>
<p>Request lacks GET query string, which is required by the endpoint.</p>
<h3 id='e_invalid_query'><code>e_invalid_query</code> | *</h3>
<p>Request has invalid fields/missing fields/invalid values. See <code>message</code> in the response for more information.</p>
<h3 id='e_empty_response'><code>e_empty_response</code> | *</h3>
<p>Request succeeded, but the response provided by the endpoint was empty.</p>
<h3 id='e_cannot_get'><code>e_cannot_get</code> | *</h3>
<p>Request failed while trying to fetch external data.</p>
<h3 id='e_generic'><code>e_generic</code> | *</h3>
<p>Unknown error.</p>
<h3 id='e_ester_error-ester'><code>e_ester_error</code> | Ester</h3>
<p>An error occured inside Ester API. See <code>data</code> field (contains response from Ester API).</p>
<h3 id='e_bakalari_missing_school-bakalari'><code>e_bakalari_missing_school</code> | Bakalari</h3>
<p>Error occured during fetching data from the given domain, which usually means the schoold doesn&#39;t exists or has private API (currently no known school has private API).</p>
<h3 id='e_bakalari_missing_user-bakalari'><code>e_bakalari_missing_user</code> | Bakalari</h3>
<p>Request to school succeeded, but the user doesn&#39;t exists.</p>
<h3 id='e_missing_subreddit-reddit'><code>e_missing_subreddit</code> | Reddit</h3>
<p>Couldn&#39;t fetch subreddit. Subreddit may be NSFW (which are currently unsupported) or private or just simply doesn&#39;t exists.</p>
<h3 id='e_reddit_failed-reddit'><code>e_reddit_failed</code> | Reddit</h3>
<p>Reddit returned invalid response and/or error response.</p>
<h3 id='e_neko_type-nekos'><code>e_neko_type</code> | Nekos</h3>
<p>Unknown neko type.</p>
<hr>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, nothing to do"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"generic"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='generic'><code>generic</code> | *</h3>
<p>A response containing only the default 3 fields.</p>
<p><br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see types"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"neko_list"</span><span class="p">,</span><span class="w">
</span><span class="s2">"types"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="s2">"..."</span><span class="w"> </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='neko_list-nekos'><code>neko_list</code> | Nekos</h3>
<p>List of available <code>neko</code> endpoints.</p>
<p><br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">404</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ICe API in development, see later"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ice_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='ice_response-ice'><code>ice_response</code> | Ice</h3>
<p>A generic bot response.</p>
<p><br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ice_http_code_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"http"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"standart"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"OK"</span><span class="p">,</span><span class="w">
</span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action."</span><span class="p">,</span><span class="w">
</span><span class="s2">"choices"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="s2">"source"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Wikipedia"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='ice_http_code_response-http'><code>ice_http_code_response</code> | Http</h3>
<p>A response containing information about given http code.</p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">400</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Missing parameter code. Use it as /http/:code"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"e_ice_http_missing_code"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='ice_http_code_list-ice'><code>ice_http_code_list</code> | Ice</h3>
<p>A <em>planned</em> response to list all available HTTP codes.</p>
<p><br>
<br>
<br>
<br></p>
<h3 id='pushr_response-pushr'><code>pushr_response</code> | Pushr</h3>
<p>A response from Pushr API (danbulant.eu API acts as pass-through for this).</p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see reddit"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"reddit_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"reddit"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"I really ininterested"</span><span class="p">,</span><span class="w">
</span><span class="s2">"image"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://imgur.com/tLBzS1h.jpg"</span><span class="p">,</span><span class="w">
</span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"nickjayr"</span><span class="p">,</span><span class="w">
</span><span class="s2">"authorIcon"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://www.redditstatic.com/avatars/avatar_default_17_0DD3BB.png"</span><span class="p">,</span><span class="w">
</span><span class="s2">"link"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://reddit.com/r/memes/comments/ey2hkb/i_really_ininterested/"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='redddit_response-reddit'><code>redddit_response</code> | Reddit</h3>
<p>Response from reddit API containing <code>reddit</code> object.</p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"path"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ester_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Čau!"</span><span class="p">,</span><span class="w">
</span><span class="s2">"user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Daniel"</span><span class="p">,</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="s2">"text"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Čau!"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='ester_response-ester'><code>ester_response</code> | Ester</h3>
<p>A generic response from Ester API.</p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"bakalari_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"verze"</span><span class="p">:</span><span class="w"> </span><span class="s2">"17/18.20191219"</span><span class="p">,</span><span class="w">
</span><span class="s2">"jmeno"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[NAME HIDDEN]"</span><span class="p">,</span><span class="w">
</span><span class="s2">"typ"</span><span class="p">:</span><span class="w"> </span><span class="s2">"R"</span><span class="p">,</span><span class="w">
</span><span class="s2">"strtyp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"rodič"</span><span class="p">,</span><span class="w">
</span><span class="s2">"skola"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[SCHOOL REDACTED]"</span><span class="p">,</span><span class="w">
</span><span class="s2">"typskoly"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="s2">"trida"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.A"</span><span class="p">,</span><span class="w">
</span><span class="s2">"rocnik"</span><span class="p">:</span><span class="w"> </span><span class="mi">-1</span><span class="p">,</span><span class="w">
</span><span class="s2">"moduly"</span><span class="p">:</span><span class="w"> </span><span class="s2">"*znamky*predvidac*rozvrh*predmety*vyuka*ukoly*akce*suplovani*absence*pololetni*prijate*odeslane*nastenka*setread*setok*komsend*komenslisty*komdel*"</span><span class="p">,</span><span class="w">
</span><span class="s2">"params"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"newmarkdays"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="s2">"result"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='bakalari_response-bakalari'><code>bakalari_response</code> | Bakalari</h3>
<p>Response from the <code>bakalari</code> API. Format depends on the bakalari response (e.g., try the desired info in browser to see, as danbulant.eu only converts xml to json).</p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see url"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"image"</span><span class="p">,</span><span class="w">
</span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://i.imgur.com/wVUpmao.jpg"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='image'><code>image</code> | *</h3>
<p>Generic image response. The actual image is on adress inside the provided <code>url</code> field.</p>
<p><br>
<br>
<br>
<br>
<br></p>

572
docs/index.html Normal file
View file

@ -0,0 +1,572 @@
<!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">
<title>API Reference</title>
<style>
.highlight table td { padding: 5px; }
.highlight table pre { margin: 0; }
.highlight .gh {
color: #999999;
}
.highlight .sr {
color: #f6aa11;
}
.highlight .go {
color: #888888;
}
.highlight .gp {
color: #555555;
}
.highlight .gs {
}
.highlight .gu {
color: #aaaaaa;
}
.highlight .nb {
color: #f6aa11;
}
.highlight .cm {
color: #75715e;
}
.highlight .cp {
color: #75715e;
}
.highlight .c1 {
color: #75715e;
}
.highlight .cs {
color: #75715e;
}
.highlight .c, .highlight .cd {
color: #75715e;
}
.highlight .err {
color: #960050;
}
.highlight .gr {
color: #960050;
}
.highlight .gt {
color: #960050;
}
.highlight .gd {
color: #49483e;
}
.highlight .gi {
color: #49483e;
}
.highlight .ge {
color: #49483e;
}
.highlight .kc {
color: #66d9ef;
}
.highlight .kd {
color: #66d9ef;
}
.highlight .kr {
color: #66d9ef;
}
.highlight .no {
color: #66d9ef;
}
.highlight .kt {
color: #66d9ef;
}
.highlight .mf {
color: #ae81ff;
}
.highlight .mh {
color: #ae81ff;
}
.highlight .il {
color: #ae81ff;
}
.highlight .mi {
color: #ae81ff;
}
.highlight .mo {
color: #ae81ff;
}
.highlight .m, .highlight .mb, .highlight .mx {
color: #ae81ff;
}
.highlight .sc {
color: #ae81ff;
}
.highlight .se {
color: #ae81ff;
}
.highlight .ss {
color: #ae81ff;
}
.highlight .sd {
color: #e6db74;
}
.highlight .s2 {
color: #e6db74;
}
.highlight .sb {
color: #e6db74;
}
.highlight .sh {
color: #e6db74;
}
.highlight .si {
color: #e6db74;
}
.highlight .sx {
color: #e6db74;
}
.highlight .s1 {
color: #e6db74;
}
.highlight .s {
color: #e6db74;
}
.highlight .na {
color: #a6e22e;
}
.highlight .nc {
color: #a6e22e;
}
.highlight .nd {
color: #a6e22e;
}
.highlight .ne {
color: #a6e22e;
}
.highlight .nf {
color: #a6e22e;
}
.highlight .vc {
color: #ffffff;
}
.highlight .nn {
color: #ffffff;
}
.highlight .nl {
color: #ffffff;
}
.highlight .ni {
color: #ffffff;
}
.highlight .bp {
color: #ffffff;
}
.highlight .vg {
color: #ffffff;
}
.highlight .vi {
color: #ffffff;
}
.highlight .nv {
color: #ffffff;
}
.highlight .w {
color: #ffffff;
}
.highlight {
color: #ffffff;
}
.highlight .n, .highlight .py, .highlight .nx {
color: #ffffff;
}
.highlight .ow {
color: #f92672;
}
.highlight .nt {
color: #f92672;
}
.highlight .k, .highlight .kv {
color: #f92672;
}
.highlight .kn {
color: #f92672;
}
.highlight .kp {
color: #f92672;
}
.highlight .o {
color: #f92672;
}
</style>
<link href="stylesheets/screen-a1ce949a.css" rel="stylesheet" media="screen" />
<link href="stylesheets/print-bccf8c07.css" rel="stylesheet" media="print" />
<script src="javascripts/all-c5541673.js"></script>
</head>
<body class="index" data-languages="[&quot;shell&quot;,&quot;javascript&quot;]">
<a href="#" id="nav-button">
<span>
NAV
<img src="images/navbar-cad8cdcb.png" alt="Navbar" />
</span>
</a>
<div class="toc-wrapper">
<img src="images/logo-1e815a84.png" class="logo" alt="Logo" />
<div class="lang-selector">
<a href="#" data-language-name="shell">shell</a>
<a href="#" data-language-name="javascript">javascript</a>
</div>
<div class="search">
<input type="text" class="search" id="input-search" placeholder="Search">
</div>
<ul class="search-results"></ul>
<ul id="toc" class="toc-list-h1">
<li>
<a href="#introduction" class="toc-h1 toc-link" data-title="Introduction">Introduction</a>
</li>
<li>
<a href="#response-format" class="toc-h1 toc-link" data-title="Response format">Response format</a>
<ul class="toc-list-h2">
<li>
<a href="#fields" class="toc-h2 toc-link" data-title="Fields">Fields</a>
</li>
<li>
<a href="#types" class="toc-h2 toc-link" data-title="Types">Types</a>
</li>
</ul>
</li>
<li>
<a href="#libraries" class="toc-h1 toc-link" data-title="Libraries">Libraries</a>
<ul class="toc-list-h2">
<li>
<a href="#js" class="toc-h2 toc-link" data-title="JS">JS</a>
</li>
</ul>
</li>
<li>
<a href="#endpoints" class="toc-h1 toc-link" data-title="Endpoints">Endpoints</a>
<ul class="toc-list-h2">
<li>
<a href="#bakalari" class="toc-h2 toc-link" data-title="Bakalari">Bakalari</a>
</li>
</ul>
</li>
</ul>
<ul class="toc-footer">
<li><a href='https://discord.gg/dZtq4Qu'>Contact us for a Developer Key</a></li>
</ul>
</div>
<div class="page-wrapper">
<div class="dark-box"></div>
<div class="content">
<h1 id='introduction'>Introduction</h1>
<p>Danbulant API is a wrapper around all of APIs available at danbulant.eu.
Most of endpoints currently don&#39;t require developer key, but for future use, we suggest still getting one. You won&#39;t do anything bad if you try to reach a free endpoint with developer key. You can contact us <a href="https://discord.gg/dZtq4Qu">here</a> on our discord server to get information about getting one.</p>
<h1 id='response-format'>Response format</h1><h2 id='fields'>Fields</h2>
<p>Response is currently always in JSON (but we might support XML and JSONP if there will be someone who might use it). Response always has these fields:</p>
<table><thead>
<tr>
<th>Field</th>
<th>Purpose</th>
<th>example content</th>
</tr>
</thead><tbody>
<tr>
<td>code</td>
<td>Contains the HTTP code</td>
<td><code>200</code></td>
</tr>
<tr>
<td>message</td>
<td>A string containing sample message.</td>
<td><code>Success, see type.</code></td>
</tr>
<tr>
<td>type</td>
<td>A string with the type of returned data</td>
<td><code>ping_response</code></td>
</tr>
</tbody></table>
<p>Response may have additional fields, such as <code>url</code> or <code>data</code>. These depends on the type.</p>
<h2 id='types'>Types</h2>
<p>Types that start with <code>e_</code> are <em>always</em> errors. The following type can be retrieved:</p>
<h3 id='e_invalid_key-key-only-endpoints'><code>e_invalid_key</code> | Key-only endpoints</h3>
<p>The key given is invalid and cannot be used.</p>
<h3 id='e_missing_query'><code>e_missing_query</code> | *</h3>
<p>Request lacks GET query string, which is required by the endpoint.</p>
<h3 id='e_invalid_query'><code>e_invalid_query</code> | *</h3>
<p>Request has invalid fields/missing fields/invalid values. See <code>message</code> in the response for more information.</p>
<h3 id='e_empty_response'><code>e_empty_response</code> | *</h3>
<p>Request succeeded, but the response provided by the endpoint was empty.</p>
<h3 id='e_cannot_get'><code>e_cannot_get</code> | *</h3>
<p>Request failed while trying to fetch external data.</p>
<h3 id='e_generic'><code>e_generic</code> | *</h3>
<p>Unknown error.</p>
<h3 id='e_ester_error-ester'><code>e_ester_error</code> | Ester</h3>
<p>An error occured inside Ester API. See <code>data</code> field (contains response from Ester API).</p>
<h3 id='e_bakalari_missing_school-bakalari'><code>e_bakalari_missing_school</code> | Bakalari</h3>
<p>Error occured during fetching data from the given domain, which usually means the schoold doesn&#39;t exists or has private API (currently no known school has private API).</p>
<h3 id='e_bakalari_missing_user-bakalari'><code>e_bakalari_missing_user</code> | Bakalari</h3>
<p>Request to school succeeded, but the user doesn&#39;t exists.</p>
<h3 id='e_missing_subreddit-reddit'><code>e_missing_subreddit</code> | Reddit</h3>
<p>Couldn&#39;t fetch subreddit. Subreddit may be NSFW (which are currently unsupported) or private or just simply doesn&#39;t exists.</p>
<h3 id='e_reddit_failed-reddit'><code>e_reddit_failed</code> | Reddit</h3>
<p>Reddit returned invalid response and/or error response.</p>
<h3 id='e_neko_type-nekos'><code>e_neko_type</code> | Nekos</h3>
<p>Unknown neko type.</p>
<hr>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, nothing to do"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"generic"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='generic'><code>generic</code> | *</h3>
<p>A response containing only the default 3 fields.</p>
<p><br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see types"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"neko_list"</span><span class="p">,</span><span class="w">
</span><span class="s2">"types"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="s2">"..."</span><span class="w"> </span><span class="p">]</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='neko_list-nekos'><code>neko_list</code> | Nekos</h3>
<p>List of available <code>neko</code> endpoints.</p>
<p><br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">404</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ICe API in development, see later"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ice_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='ice_response-ice'><code>ice_response</code> | Ice</h3>
<p>A generic bot response.</p>
<p><br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ice_http_code_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"http"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"standart"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
</span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"OK"</span><span class="p">,</span><span class="w">
</span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action."</span><span class="p">,</span><span class="w">
</span><span class="s2">"choices"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="s2">"source"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Wikipedia"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='ice_http_code_response-http'><code>ice_http_code_response</code> | Http</h3>
<p>A response containing information about given http code.</p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">400</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Missing parameter code. Use it as /http/:code"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"e_ice_http_missing_code"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='ice_http_code_list-ice'><code>ice_http_code_list</code> | Ice</h3>
<p>A <em>planned</em> response to list all available HTTP codes.</p>
<p><br>
<br>
<br>
<br></p>
<h3 id='pushr_response-pushr'><code>pushr_response</code> | Pushr</h3>
<p>A response from Pushr API (danbulant.eu API acts as pass-through for this).</p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see reddit"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"reddit_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"reddit"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"I really ininterested"</span><span class="p">,</span><span class="w">
</span><span class="s2">"image"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://imgur.com/tLBzS1h.jpg"</span><span class="p">,</span><span class="w">
</span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"nickjayr"</span><span class="p">,</span><span class="w">
</span><span class="s2">"authorIcon"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://www.redditstatic.com/avatars/avatar_default_17_0DD3BB.png"</span><span class="p">,</span><span class="w">
</span><span class="s2">"link"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://reddit.com/r/memes/comments/ey2hkb/i_really_ininterested/"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='redddit_response-reddit'><code>redddit_response</code> | Reddit</h3>
<p>Response from reddit API containing <code>reddit</code> object.</p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"path"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ester_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Čau!"</span><span class="p">,</span><span class="w">
</span><span class="s2">"user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Daniel"</span><span class="p">,</span><span class="w">
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="s2">"text"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Čau!"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='ester_response-ester'><code>ester_response</code> | Ester</h3>
<p>A generic response from Ester API.</p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"bakalari_response"</span><span class="p">,</span><span class="w">
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"verze"</span><span class="p">:</span><span class="w"> </span><span class="s2">"17/18.20191219"</span><span class="p">,</span><span class="w">
</span><span class="s2">"jmeno"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[NAME HIDDEN]"</span><span class="p">,</span><span class="w">
</span><span class="s2">"typ"</span><span class="p">:</span><span class="w"> </span><span class="s2">"R"</span><span class="p">,</span><span class="w">
</span><span class="s2">"strtyp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"rodič"</span><span class="p">,</span><span class="w">
</span><span class="s2">"skola"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[SCHOOL REDACTED]"</span><span class="p">,</span><span class="w">
</span><span class="s2">"typskoly"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
</span><span class="s2">"trida"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.A"</span><span class="p">,</span><span class="w">
</span><span class="s2">"rocnik"</span><span class="p">:</span><span class="w"> </span><span class="mi">-1</span><span class="p">,</span><span class="w">
</span><span class="s2">"moduly"</span><span class="p">:</span><span class="w"> </span><span class="s2">"*znamky*predvidac*rozvrh*predmety*vyuka*ukoly*akce*suplovani*absence*pololetni*prijate*odeslane*nastenka*setread*setok*komsend*komenslisty*komdel*"</span><span class="p">,</span><span class="w">
</span><span class="s2">"params"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
</span><span class="s2">"newmarkdays"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
</span><span class="p">},</span><span class="w">
</span><span class="s2">"result"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
</span><span class="p">}</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='bakalari_response-bakalari'><code>bakalari_response</code> | Bakalari</h3>
<p>Response from the <code>bakalari</code> API. Format depends on the bakalari response (e.g., try the desired info in browser to see, as danbulant.eu only converts xml to json).</p>
<p><br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br></p>
<blockquote>
<p>Example response:</p>
</blockquote>
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see url"</span><span class="p">,</span><span class="w">
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"image"</span><span class="p">,</span><span class="w">
</span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://i.imgur.com/wVUpmao.jpg"</span><span class="w">
</span><span class="p">}</span><span class="w">
</span></code></pre><h3 id='image'><code>image</code> | *</h3>
<p>Generic image response. The actual image is on adress inside the provided <code>url</code> field.</p>
<p><br>
<br>
<br>
<br>
<br></p>
<h1 id='libraries'>Libraries</h1><h2 id='js'>JS</h2>
<p><em>Currently unavailable, but planned.</em>
This library simplifies usage. It uses <code>got</code> under the hood for simplified request handling, and always returns promise.
Responses are just parsed JSON (as of now, but classes may be implemented in future).</p>
<h1 id='endpoints'>Endpoints</h1><h2 id='bakalari'>Bakalari</h2>
<blockquote>
<p>Example request</p>
</blockquote>
<pre class="highlight shell tab-shell"><code>curl <span class="s2">"https://api.danbulant.eu/v1/bakalari/rozvrh/user/domain.tld/SecretPassword123"</span>
</code></pre>
<p>Tries getting the info from Bakalari API.</p>
</div>
<div class="dark-box">
<div class="lang-selector">
<a href="#" data-language-name="shell">shell</a>
<a href="#" data-language-name="javascript">javascript</a>
</div>
</div>
</div>
</body>
</html>

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1 @@
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.content h1,.content h2,.content h3,.content h4,body{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:14px}.content h1,.content h2,.content h3,.content h4{font-weight:bold}.content pre,.content code{font-family:Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;font-size:12px;line-height:1.5}.content pre,.content code{word-break:break-all;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}@font-face{font-family:'slate';src:url(../fonts/slate-cfc9d06b.eot?-syv14m);src:url(../fonts/slate-cfc9d06b.eot?#iefix-syv14m) format("embedded-opentype"),url(../fonts/slate-ddd488db.woff2?-syv14m) format("woff2"),url(../fonts/slate-33847ce5.woff?-syv14m) format("woff"),url(../fonts/slate-7b7da4fe.ttf?-syv14m) format("truetype"),url(../fonts/slate-e55b8307.svg?-syv14m#slate) format("svg");font-weight:normal;font-style:normal}.content aside.warning:before,.content aside.notice:before,.content aside.success:before{font-family:'slate';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1}.content aside.warning:before{content:"\e600"}.content aside.notice:before{content:"\e602"}.content aside.success:before{content:"\e606"}.tocify,.toc-footer,.lang-selector,.search,#nav-button{display:none}.tocify-wrapper>img{margin:0 auto;display:block}.content{font-size:12px}.content pre,.content code{border:1px solid #999;border-radius:5px;font-size:0.8em}.content pre code{border:0}.content pre{padding:1.3em}.content code{padding:0.2em}.content table{border:1px solid #999}.content table tr{border-bottom:1px solid #999}.content table td,.content table th{padding:0.7em}.content p{line-height:1.5}.content a{text-decoration:none;color:#000}.content h1{font-size:2.5em;padding-top:0.5em;padding-bottom:0.5em;margin-top:1em;margin-bottom:21px;border:2px solid #ccc;border-width:2px 0;text-align:center}.content h2{font-size:1.8em;margin-top:2em;border-top:2px solid #ccc;padding-top:0.8em}.content h1+h2,.content h1+div+h2{border-top:none;padding-top:0;margin-top:0}.content h3,.content h4{font-size:0.8em;margin-top:1.5em;margin-bottom:0.8em;text-transform:uppercase}.content h5,.content h6{text-transform:uppercase}.content aside{padding:1em;border:1px solid #ccc;border-radius:5px;margin-top:1.5em;margin-bottom:1.5em;line-height:1.6}.content aside:before{vertical-align:middle;padding-right:0.5em;font-size:14px}

File diff suppressed because one or more lines are too long

16
lib/multilang.rb Normal file
View file

@ -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

View file

@ -0,0 +1,22 @@
# Nested unique header generation
require 'middleman-core/renderers/redcarpet'
class NestingUniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML
def initialize
super
@@headers_history = {} if !defined?(@@headers_history)
end
def header(text, header_level)
friendly_text = text.gsub(/<[^>]*>/,"").parameterize
@@headers_history[header_level] = text.parameterize
if header_level > 1
for i in (header_level - 1).downto(1)
friendly_text.prepend("#{@@headers_history[i]}-") if @@headers_history.key?(i)
end
end
return "<h#{header_level} id='#{friendly_text}'>#{text}</h#{header_level}>"
end
end

31
lib/toc_data.rb Normal file
View file

@ -0,0 +1,31 @@
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,
title: header.children.to_s.gsub(/<[^>]*>/, ''),
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

24
lib/unique_head.rb Normal file
View file

@ -0,0 +1,24 @@
# Unique header generation
require 'middleman-core/renderers/redcarpet'
require 'digest'
class UniqueHeadCounter < Middleman::Renderers::MiddlemanRedcarpetHTML
def initialize
super
@head_count = {}
end
def header(text, header_level)
friendly_text = text.gsub(/<[^>]*>/,"").parameterize
if friendly_text.strip.length == 0
# Looks like parameterize removed the whole thing! It removes many unicode
# characters like Chinese and Russian. To get a unique URL, let's just
# URI escape the whole header
friendly_text = Digest::SHA1.hexdigest(text)[0,10]
end
@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

0
source/fonts/slate.eot Executable file → Normal file
View file

0
source/fonts/slate.svg Executable file → Normal file
View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

0
source/fonts/slate.ttf Executable file → Normal file
View file

0
source/fonts/slate.woff Executable file → Normal file
View file

0
source/fonts/slate.woff2 Executable file → Normal file
View file

View file

@ -1,20 +0,0 @@
# Errors
<aside class="notice">This error section is stored in a separate file in `includes/_errors.md`. Slate allows you to optionally separate out your docs into many files...just save them to the `includes` folder and add them to the top of your `index.md`'s frontmatter. Files are included in the order listed.</aside>
The Kittn API uses the following error codes:
Error Code | Meaning
---------- | -------
400 | Bad Request -- Your request sucks
401 | Unauthorized -- Your API key is wrong
403 | Forbidden -- The kitten requested is hidden for administrators only
404 | Not Found -- The specified kitten could not be found
405 | Method Not Allowed -- You tried to access a kitten with an invalid method
406 | Not Acceptable -- You requested a format that isn't json
410 | Gone -- The kitten requested has been removed from our servers
418 | I'm a teapot
429 | Too Many Requests -- You're requesting too many kittens! Slow down!
500 | Internal Server Error -- We had a problem with our server. Try again later.
503 | Service Unavailable -- We're temporarially offline for maintanance. Please try again later.

View file

@ -0,0 +1,12 @@
# Endpoints
All endpoints can be found on [https://api.danbulant.eu/v1/](https://api.danbulant.eu/v1/)
## Bakalari
> Example request
```shell
curl "https://api.danbulant.eu/v1/bakalari/rozvrh/user/domain.tld/SecretPassword123"
```
Tries getting the info from Bakalari API.

View file

@ -0,0 +1,7 @@
# Libraries
## JS
*Currently unavailable, but planned.*
This library simplifies usage. It uses `got` under the hood for simplified request handling, and always returns promise.
Responses are just parsed JSON (as of now, but classes may be implemented in future).

View file

@ -0,0 +1,316 @@
# Response format
## Fields
Response is currently always in JSON (but we might support XML and JSONP if there will be someone who might use it). Response always has these fields:
| Field | Purpose | example content |
|---------|------------------------------------------|----------------------|
| code | Contains the HTTP code | `200` |
| message | A string containing sample message. | `Success, see type.` |
| type | A string with the type of returned data | `ping_response` |
Response may have additional fields, such as `url` or `data`. These depends on the type.
## Types
Types that start with `e_` are *always* errors. The following type can be retrieved:
### `e_invalid_key` | Key-only endpoints
The key given is invalid and cannot be used.
### `e_missing_query` | *
Request lacks GET query string, which is required by the endpoint.
### `e_invalid_query` | *
Request has invalid fields/missing fields/invalid values. See `message` in the response for more information.
### `e_empty_response` | *
Request succeeded, but the response provided by the endpoint was empty.
### `e_cannot_get` | *
Request failed while trying to fetch external data.
### `e_generic` | *
Unknown error.
### `e_ester_error` | Ester
An error occured inside Ester API. See `data` field (contains response from Ester API).
### `e_bakalari_missing_school` | Bakalari
Error occured during fetching data from the given domain, which usually means the schoold doesn't exists or has private API (currently no known school has private API).
### `e_bakalari_missing_user` | Bakalari
Request to school succeeded, but the user doesn't exists.
### `e_missing_subreddit` | Reddit
Couldn't fetch subreddit. Subreddit may be NSFW (which are currently unsupported) or private or just simply doesn't exists.
### `e_reddit_failed` | Reddit
Reddit returned invalid response and/or error response.
### `e_neko_type` | Nekos
Unknown neko type.
-----
> Example response:
```json
{
"code": 200,
"message": "Success, nothing to do",
"type": "generic"
}
```
### `generic` | *
A response containing only the default 3 fields.
<br>
<br>
<br>
<br>
> Example response:
```json
{
"code": 200,
"message": "Success, see types",
"type": "neko_list",
"types": [ "..." ]
}
```
### `neko_list` | Nekos
List of available `neko` endpoints.
<br>
<br>
<br>
<br>
<br>
> Example response:
```json
{
"code": 404,
"message": "ICe API in development, see later",
"type": "ice_response",
"data": {}
}
```
### `ice_response` | Ice
A generic bot response.
<br>
<br>
<br>
<br>
<br>
> Example response:
```json
{
"code": 200,
"type": "ice_http_code_response",
"http": {
"standart": true,
"title": "OK",
"description": "Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action.",
"choices": []
},
"source": "Wikipedia"
}
```
### `ice_http_code_response` | Http
A response containing information about given http code.
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
> Example response:
```json
{
"code": 400,
"message": "Missing parameter code. Use it as /http/:code",
"type": "e_ice_http_missing_code"
}
```
### `ice_http_code_list` | Ice
A *planned* response to list all available HTTP codes.
<br>
<br>
<br>
<br>
### `pushr_response` | Pushr
A response from Pushr API (danbulant.eu API acts as pass-through for this).
> Example response:
```json
{
"code": 200,
"message": "Success, see reddit",
"type": "reddit_response",
"reddit": {
"title": "I really ininterested",
"image": "https://imgur.com/tLBzS1h.jpg",
"author": "nickjayr",
"authorIcon": "https://www.redditstatic.com/avatars/avatar_default_17_0DD3BB.png",
"link": "https://reddit.com/r/memes/comments/ey2hkb/i_really_ininterested/"
}
}
```
### `redddit_response` | Reddit
Response from reddit API containing `reddit` object.
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
> Example response:
```json
{
"code": 200,
"message": "Success, see response",
"path": "/",
"type": "ester_response",
"data": {
"code": 200,
"message": "Čau!",
"user": {
"name": "Daniel",
"id": "1"
},
"text": "Čau!"
}
}
```
### `ester_response` | Ester
A generic response from Ester API.
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
> Example response:
```json
{
"code": 200,
"message": "Success",
"type": "bakalari_response",
"data": {
"verze": "17/18.20191219",
"jmeno": "[NAME HIDDEN]",
"typ": "R",
"strtyp": "rodič",
"skola": "[SCHOOL REDACTED]",
"typskoly": "",
"trida": "0.A",
"rocnik": -1,
"moduly": "*znamky*predvidac*rozvrh*predmety*vyuka*ukoly*akce*suplovani*absence*pololetni*prijate*odeslane*nastenka*setread*setok*komsend*komenslisty*komdel*",
"params": {
"newmarkdays": 1
},
"result": 1
}
}
```
### `bakalari_response` | Bakalari
Response from the `bakalari` API. Format depends on the bakalari response (e.g., try the desired info in browser to see, as danbulant.eu only converts xml to json).
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
> Example response:
```json
{
"code": 200,
"message": "Success, see url",
"type": "image",
"url": "https://i.imgur.com/wVUpmao.jpg"
}
```
### `image` | *
Generic image response. The actual image is on adress inside the provided `url` field.
<br>
<br>
<br>
<br>
<br>

View file

@ -1,168 +1,22 @@
---
title: API Reference
language_tabs:
language_tabs: # must be one of https://git.io/vQNgJ
- shell
- ruby
- python
- javascript
toc_footers:
- <a href='#'>Sign Up for a Developer Key</a>
- <a href='https://github.com/tripit/slate'>Documentation Powered by Slate</a>
- <a href='https://discord.gg/dZtq4Qu'>Contact us for a Developer Key</a>
includes:
- errors
- responses
- libraries
- endpoints
search: true
---
# Introduction
Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.
We have language bindings in Shell, Ruby, and Python! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
This example API documentation page was created with [Slate](https://github.com/tripit/slate). Feel free to edit it and use it as a base for your own API's documentation.
# Authentication
> To authorize, use this code:
```ruby
require 'kittn'
api = Kittn::APIClient.authorize!('meowmeowmeow')
```
```python
import kittn
api = kittn.authorize('meowmeowmeow')
```
```shell
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
-H "Authorization: meowmeowmeow"
```
> Make sure to replace `meowmeowmeow` with your API key.
Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our [developer portal](http://example.com/developers).
Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following:
`Authorization: meowmeowmeow`
<aside class="notice">
You must replace <code>meowmeowmeow</code> with your personal API key.
</aside>
# Kittens
## Get All Kittens
```ruby
require 'kittn'
api = Kittn::APIClient.authorize!('meowmeowmeow')
api.kittens.get
```
```python
import kittn
api = kittn.authorize('meowmeowmeow')
api.kittens.get()
```
```shell
curl "http://example.com/api/kittens"
-H "Authorization: meowmeowmeow"
```
> The above command returns JSON structured like this:
```json
[
{
"id": 1,
"name": "Fluffums",
"breed": "calico",
"fluffiness": 6,
"cuteness": 7
},
{
"id": 2,
"name": "Max",
"breed": "unknown",
"fluffiness": 5,
"cuteness": 10
}
]
```
This endpoint retrieves all kittens.
### HTTP Request
`GET http://example.com/api/kittens`
### Query Parameters
Parameter | Default | Description
--------- | ------- | -----------
include_cats | false | If set to true, the result will also include cats.
available | true | If set to false, the result will include kittens that have already been adopted.
<aside class="success">
Remember — a happy kitten is an authenticated kitten!
</aside>
## Get a Specific Kitten
```ruby
require 'kittn'
api = Kittn::APIClient.authorize!('meowmeowmeow')
api.kittens.get(2)
```
```python
import kittn
api = kittn.authorize('meowmeowmeow')
api.kittens.get(2)
```
```shell
curl "http://example.com/api/kittens/2"
-H "Authorization: meowmeowmeow"
```
> The above command returns JSON structured like this:
```json
{
"id": 2,
"name": "Max",
"breed": "unknown",
"fluffiness": 5,
"cuteness": 10
}
```
This endpoint retrieves a specific kitten.
<aside class="warning">Inside HTML code blocks like this one, you can't use Markdown, so use <code>&lt;code&gt;</code> blocks to denote code.</aside>
### HTTP Request
`GET http://example.com/kittens/<ID>`
### URL Parameters
Parameter | Description
--------- | -----------
ID | The ID of the kitten to retrieve
Danbulant API is a wrapper around all of APIs available at danbulant.eu.
Most of endpoints currently don't require developer key, but for future use, we suggest still getting one. You won't do anything bad if you try to reach a free endpoint with developer key. You can contact us [here](https://discord.gg/dZtq4Qu) on our discord server to get information about getting one.

View file

@ -1,4 +1,2 @@
//= require ./lib/_energize
//= require ./app/_lang
//= require ./all_nosearch
//= require ./app/_search
//= require ./app/_toc

View file

@ -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());
};

View file

@ -15,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;
@ -30,13 +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)) {
@ -97,7 +98,7 @@ under the License.
// gets the language set in the query string
function getLanguageFromQueryString() {
if (location.search.length >= 1) {
var language = parseURL(location.search).language
var language = parseURL(location.search).language;
if (language) {
return language;
} else if (jQuery.inArray(location.search.substr(1), languages) != -1) {
@ -159,8 +160,5 @@ under the License.
activateLanguage(language);
return false;
});
window.onpopstate = function() {
activateLanguage(getLanguageFromQueryString());
};
});
})(window);
})();

View file

@ -1,11 +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();
@ -27,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;
});
@ -54,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();
@ -73,3 +95,4 @@
content.unhighlight(highlightOpts);
}
})();

View file

@ -1,57 +1,122 @@
//= require ../lib/_jquery
//= require ../lib/_jquery_ui
//= require ../lib/_jquery.tocify
//= require ../lib/_imagesloaded.min
(function (global) {
;(function () {
'use strict';
var htmlPattern = /<[^>]*>/g;
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;
}
}).data('toc-tocify');
$("#nav-button").click(function() {
$(".tocify-wrapper").toggleClass('open');
$("#nav-button").toggleClass('open');
return false;
});
var best = null;
for (var name in headerHeights) {
if ((headerHeights[name] < currentTop && headerHeights[name] > headerHeights[best]) || best === null) {
best = name;
}
}
$(".page-wrapper").click(closeToc);
$(".tocify-item").click(closeToc);
};
// Catch the initial load case
if (currentTop == scrollOffset && !loaded) {
best = window.location.hash;
loaded = true;
}
// 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 $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.replaceState) {
window.history.replaceState(null, "", best);
}
var thisTitle = $best.data("title")
if (thisTitle !== undefined && thisTitle.length > 0) {
document.title = thisTitle + " " + originalTitle;
} else {
document.title = originalTitle;
}
}
};
var makeToc = function() {
recacheHeights();
refreshToc();
$("#nav-button").click(function() {
$(".toc-wrapper").toggleClass('open');
$("#nav-button").toggleClass('open');
return false;
});
$(".page-wrapper").click(closeToc);
$(".toc-link").click(closeToc);
// 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;
}
$(function() {
makeToc();
animate();
setupLanguages($('body').data('languages'));
$('.content').imagesLoaded( function() {
global.toc.calculateHeights();
});
});
})(window);
window.loadToc = loadToc;
})();

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,566 +0,0 @@
/*! jQuery UI - v1.11.3 - 2015-02-12
* http://jqueryui.com
* Includes: widget.js
* Copyright 2015 jQuery Foundation and other contributors; Licensed MIT */
(function( factory ) {
if ( typeof define === "function" && define.amd ) {
// AMD. Register as an anonymous module.
define([ "jquery" ], factory );
} else {
// Browser globals
factory( jQuery );
}
}(function( $ ) {
/*!
* jQuery UI Widget 1.11.3
* http://jqueryui.com
*
* Copyright jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/jQuery.widget/
*/
var widget_uuid = 0,
widget_slice = Array.prototype.slice;
$.cleanData = (function( orig ) {
return function( elems ) {
var events, elem, i;
for ( i = 0; (elem = elems[i]) != null; i++ ) {
try {
// Only trigger remove when necessary to save time
events = $._data( elem, "events" );
if ( events && events.remove ) {
$( elem ).triggerHandler( "remove" );
}
// http://bugs.jquery.com/ticket/8235
} catch ( e ) {}
}
orig( elems );
};
})( $.cleanData );
$.widget = function( name, base, prototype ) {
var fullName, existingConstructor, constructor, basePrototype,
// proxiedPrototype allows the provided prototype to remain unmodified
// so that it can be used as a mixin for multiple widgets (#8876)
proxiedPrototype = {},
namespace = name.split( "." )[ 0 ];
name = name.split( "." )[ 1 ];
fullName = namespace + "-" + name;
if ( !prototype ) {
prototype = base;
base = $.Widget;
}
// create selector for plugin
$.expr[ ":" ][ fullName.toLowerCase() ] = function( elem ) {
return !!$.data( elem, fullName );
};
$[ namespace ] = $[ namespace ] || {};
existingConstructor = $[ namespace ][ name ];
constructor = $[ namespace ][ name ] = function( options, element ) {
// allow instantiation without "new" keyword
if ( !this._createWidget ) {
return new constructor( options, element );
}
// allow instantiation without initializing for simple inheritance
// must use "new" keyword (the code above always passes args)
if ( arguments.length ) {
this._createWidget( options, element );
}
};
// extend with the existing constructor to carry over any static properties
$.extend( constructor, existingConstructor, {
version: prototype.version,
// copy the object used to create the prototype in case we need to
// redefine the widget later
_proto: $.extend( {}, prototype ),
// track widgets that inherit from this widget in case this widget is
// redefined after a widget inherits from it
_childConstructors: []
});
basePrototype = new base();
// we need to make the options hash a property directly on the new instance
// otherwise we'll modify the options hash on the prototype that we're
// inheriting from
basePrototype.options = $.widget.extend( {}, basePrototype.options );
$.each( prototype, function( prop, value ) {
if ( !$.isFunction( value ) ) {
proxiedPrototype[ prop ] = value;
return;
}
proxiedPrototype[ prop ] = (function() {
var _super = function() {
return base.prototype[ prop ].apply( this, arguments );
},
_superApply = function( args ) {
return base.prototype[ prop ].apply( this, args );
};
return function() {
var __super = this._super,
__superApply = this._superApply,
returnValue;
this._super = _super;
this._superApply = _superApply;
returnValue = value.apply( this, arguments );
this._super = __super;
this._superApply = __superApply;
return returnValue;
};
})();
});
constructor.prototype = $.widget.extend( basePrototype, {
// TODO: remove support for widgetEventPrefix
// always use the name + a colon as the prefix, e.g., draggable:start
// don't prefix for widgets that aren't DOM-based
widgetEventPrefix: existingConstructor ? (basePrototype.widgetEventPrefix || name) : name
}, proxiedPrototype, {
constructor: constructor,
namespace: namespace,
widgetName: name,
widgetFullName: fullName
});
// If this widget is being redefined then we need to find all widgets that
// are inheriting from it and redefine all of them so that they inherit from
// the new version of this widget. We're essentially trying to replace one
// level in the prototype chain.
if ( existingConstructor ) {
$.each( existingConstructor._childConstructors, function( i, child ) {
var childPrototype = child.prototype;
// redefine the child widget using the same prototype that was
// originally used, but inherit from the new version of the base
$.widget( childPrototype.namespace + "." + childPrototype.widgetName, constructor, child._proto );
});
// remove the list of existing child constructors from the old constructor
// so the old child constructors can be garbage collected
delete existingConstructor._childConstructors;
} else {
base._childConstructors.push( constructor );
}
$.widget.bridge( name, constructor );
return constructor;
};
$.widget.extend = function( target ) {
var input = widget_slice.call( arguments, 1 ),
inputIndex = 0,
inputLength = input.length,
key,
value;
for ( ; inputIndex < inputLength; inputIndex++ ) {
for ( key in input[ inputIndex ] ) {
value = input[ inputIndex ][ key ];
if ( input[ inputIndex ].hasOwnProperty( key ) && value !== undefined ) {
// Clone objects
if ( $.isPlainObject( value ) ) {
target[ key ] = $.isPlainObject( target[ key ] ) ?
$.widget.extend( {}, target[ key ], value ) :
// Don't extend strings, arrays, etc. with objects
$.widget.extend( {}, value );
// Copy everything else by reference
} else {
target[ key ] = value;
}
}
}
}
return target;
};
$.widget.bridge = function( name, object ) {
var fullName = object.prototype.widgetFullName || name;
$.fn[ name ] = function( options ) {
var isMethodCall = typeof options === "string",
args = widget_slice.call( arguments, 1 ),
returnValue = this;
if ( isMethodCall ) {
this.each(function() {
var methodValue,
instance = $.data( this, fullName );
if ( options === "instance" ) {
returnValue = instance;
return false;
}
if ( !instance ) {
return $.error( "cannot call methods on " + name + " prior to initialization; " +
"attempted to call method '" + options + "'" );
}
if ( !$.isFunction( instance[options] ) || options.charAt( 0 ) === "_" ) {
return $.error( "no such method '" + options + "' for " + name + " widget instance" );
}
methodValue = instance[ options ].apply( instance, args );
if ( methodValue !== instance && methodValue !== undefined ) {
returnValue = methodValue && methodValue.jquery ?
returnValue.pushStack( methodValue.get() ) :
methodValue;
return false;
}
});
} else {
// Allow multiple hashes to be passed on init
if ( args.length ) {
options = $.widget.extend.apply( null, [ options ].concat(args) );
}
this.each(function() {
var instance = $.data( this, fullName );
if ( instance ) {
instance.option( options || {} );
if ( instance._init ) {
instance._init();
}
} else {
$.data( this, fullName, new object( options, this ) );
}
});
}
return returnValue;
};
};
$.Widget = function( /* options, element */ ) {};
$.Widget._childConstructors = [];
$.Widget.prototype = {
widgetName: "widget",
widgetEventPrefix: "",
defaultElement: "<div>",
options: {
disabled: false,
// callbacks
create: null
},
_createWidget: function( options, element ) {
element = $( element || this.defaultElement || this )[ 0 ];
this.element = $( element );
this.uuid = widget_uuid++;
this.eventNamespace = "." + this.widgetName + this.uuid;
this.bindings = $();
this.hoverable = $();
this.focusable = $();
if ( element !== this ) {
$.data( element, this.widgetFullName, this );
this._on( true, this.element, {
remove: function( event ) {
if ( event.target === element ) {
this.destroy();
}
}
});
this.document = $( element.style ?
// element within the document
element.ownerDocument :
// element is window or document
element.document || element );
this.window = $( this.document[0].defaultView || this.document[0].parentWindow );
}
this.options = $.widget.extend( {},
this.options,
this._getCreateOptions(),
options );
this._create();
this._trigger( "create", null, this._getCreateEventData() );
this._init();
},
_getCreateOptions: $.noop,
_getCreateEventData: $.noop,
_create: $.noop,
_init: $.noop,
destroy: function() {
this._destroy();
// we can probably remove the unbind calls in 2.0
// all event bindings should go through this._on()
this.element
.unbind( this.eventNamespace )
.removeData( this.widgetFullName )
// support: jquery <1.6.3
// http://bugs.jquery.com/ticket/9413
.removeData( $.camelCase( this.widgetFullName ) );
this.widget()
.unbind( this.eventNamespace )
.removeAttr( "aria-disabled" )
.removeClass(
this.widgetFullName + "-disabled " +
"ui-state-disabled" );
// clean up events and states
this.bindings.unbind( this.eventNamespace );
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
},
_destroy: $.noop,
widget: function() {
return this.element;
},
option: function( key, value ) {
var options = key,
parts,
curOption,
i;
if ( arguments.length === 0 ) {
// don't return a reference to the internal hash
return $.widget.extend( {}, this.options );
}
if ( typeof key === "string" ) {
// handle nested keys, e.g., "foo.bar" => { foo: { bar: ___ } }
options = {};
parts = key.split( "." );
key = parts.shift();
if ( parts.length ) {
curOption = options[ key ] = $.widget.extend( {}, this.options[ key ] );
for ( i = 0; i < parts.length - 1; i++ ) {
curOption[ parts[ i ] ] = curOption[ parts[ i ] ] || {};
curOption = curOption[ parts[ i ] ];
}
key = parts.pop();
if ( arguments.length === 1 ) {
return curOption[ key ] === undefined ? null : curOption[ key ];
}
curOption[ key ] = value;
} else {
if ( arguments.length === 1 ) {
return this.options[ key ] === undefined ? null : this.options[ key ];
}
options[ key ] = value;
}
}
this._setOptions( options );
return this;
},
_setOptions: function( options ) {
var key;
for ( key in options ) {
this._setOption( key, options[ key ] );
}
return this;
},
_setOption: function( key, value ) {
this.options[ key ] = value;
if ( key === "disabled" ) {
this.widget()
.toggleClass( this.widgetFullName + "-disabled", !!value );
// If the widget is becoming disabled, then nothing is interactive
if ( value ) {
this.hoverable.removeClass( "ui-state-hover" );
this.focusable.removeClass( "ui-state-focus" );
}
}
return this;
},
enable: function() {
return this._setOptions({ disabled: false });
},
disable: function() {
return this._setOptions({ disabled: true });
},
_on: function( suppressDisabledCheck, element, handlers ) {
var delegateElement,
instance = this;
// no suppressDisabledCheck flag, shuffle arguments
if ( typeof suppressDisabledCheck !== "boolean" ) {
handlers = element;
element = suppressDisabledCheck;
suppressDisabledCheck = false;
}
// no element argument, shuffle and use this.element
if ( !handlers ) {
handlers = element;
element = this.element;
delegateElement = this.widget();
} else {
element = delegateElement = $( element );
this.bindings = this.bindings.add( element );
}
$.each( handlers, function( event, handler ) {
function handlerProxy() {
// allow widgets to customize the disabled handling
// - disabled as an array instead of boolean
// - disabled class as method for disabling individual parts
if ( !suppressDisabledCheck &&
( instance.options.disabled === true ||
$( this ).hasClass( "ui-state-disabled" ) ) ) {
return;
}
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
// copy the guid so direct unbinding works
if ( typeof handler !== "string" ) {
handlerProxy.guid = handler.guid =
handler.guid || handlerProxy.guid || $.guid++;
}
var match = event.match( /^([\w:-]*)\s*(.*)$/ ),
eventName = match[1] + instance.eventNamespace,
selector = match[2];
if ( selector ) {
delegateElement.delegate( selector, eventName, handlerProxy );
} else {
element.bind( eventName, handlerProxy );
}
});
},
_off: function( element, eventName ) {
eventName = (eventName || "").split( " " ).join( this.eventNamespace + " " ) +
this.eventNamespace;
element.unbind( eventName ).undelegate( eventName );
// Clear the stack to avoid memory leaks (#10056)
this.bindings = $( this.bindings.not( element ).get() );
this.focusable = $( this.focusable.not( element ).get() );
this.hoverable = $( this.hoverable.not( element ).get() );
},
_delay: function( handler, delay ) {
function handlerProxy() {
return ( typeof handler === "string" ? instance[ handler ] : handler )
.apply( instance, arguments );
}
var instance = this;
return setTimeout( handlerProxy, delay || 0 );
},
_hoverable: function( element ) {
this.hoverable = this.hoverable.add( element );
this._on( element, {
mouseenter: function( event ) {
$( event.currentTarget ).addClass( "ui-state-hover" );
},
mouseleave: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-hover" );
}
});
},
_focusable: function( element ) {
this.focusable = this.focusable.add( element );
this._on( element, {
focusin: function( event ) {
$( event.currentTarget ).addClass( "ui-state-focus" );
},
focusout: function( event ) {
$( event.currentTarget ).removeClass( "ui-state-focus" );
}
});
},
_trigger: function( type, event, data ) {
var prop, orig,
callback = this.options[ type ];
data = data || {};
event = $.Event( event );
event.type = ( type === this.widgetEventPrefix ?
type :
this.widgetEventPrefix + type ).toLowerCase();
// the original event may come from any element
// so we need to reset the target on the new event
event.target = this.element[ 0 ];
// copy original event properties over to the new event
orig = event.originalEvent;
if ( orig ) {
for ( prop in orig ) {
if ( !( prop in event ) ) {
event[ prop ] = orig[ prop ];
}
}
}
this.element.trigger( event, data );
return !( $.isFunction( callback ) &&
callback.apply( this.element[0], [ event ].concat( data ) ) === false ||
event.isDefaultPrevented() );
}
};
$.each( { show: "fadeIn", hide: "fadeOut" }, function( method, defaultEffect ) {
$.Widget.prototype[ "_" + method ] = function( element, options, callback ) {
if ( typeof options === "string" ) {
options = { effect: options };
}
var hasOptions,
effectName = !options ?
method :
options === true || typeof options === "number" ?
defaultEffect :
options.effect || defaultEffect;
options = options || {};
if ( typeof options === "number" ) {
options = { duration: options };
}
hasOptions = !$.isEmptyObject( options );
options.complete = callback;
if ( options.delay ) {
element.delay( options.delay );
}
if ( hasOptions && $.effects && $.effects.effect[ effectName ] ) {
element[ method ]( options );
} else if ( effectName !== method && element[ effectName ] ) {
element[ effectName ]( options.duration, options.easing, callback );
} else {
element.queue(function( next ) {
$( this )[ method ]();
if ( callback ) {
callback.call( element[ 0 ] );
}
next();
});
}
};
});
var widget = $.widget;
}));

View file

@ -14,6 +14,15 @@ License for the specific language governing permissions and limitations
under the License.
%>
<% 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>
@ -22,11 +31,11 @@ under the License.
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<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 %>
<style>
<%= Rouge::Themes::Base16::Monokai.render(:scope => '.highlight') %>
</style>
<% if current_page.data.search %>
<%= javascript_include_tag "all" %>
<% else %>
@ -41,9 +50,9 @@ under the License.
<%= 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 %>
@ -60,8 +69,22 @@ under the License.
</div>
<ul class="search-results"></ul>
<% end %>
<div id="toc">
</div>
<ul 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[:title] %>"><%= 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="<%= h2[:title] %>"><%= h2[:content] %></a>
</li>
<% end %>
</ul>
<% end %>
</li>
<% end %>
</ul>
<% if current_page.data.toc_footers %>
<ul class="toc-footer">
<% current_page.data.toc_footers.each do |footer| %>
@ -73,13 +96,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 %>

View file

@ -0,0 +1,140 @@
////////////////////////////////////////////////////////////////////////////////
// RTL Styles Variables
////////////////////////////////////////////////////////////////////////////////
$default: auto;
////////////////////////////////////////////////////////////////////////////////
// TABLE OF CONTENTS
////////////////////////////////////////////////////////////////////////////////
#toc>ul>li>a>span {
float: left;
}
.toc-wrapper {
transition: right 0.3s ease-in-out !important;
left: $default !important;
#{right}: 0;
}
.toc-h2 {
padding-#{right}: $nav-padding + $nav-indent;
}
#nav-button {
#{right}: 0;
transition: right 0.3s ease-in-out;
&.open {
right: $nav-width
}
}
////////////////////////////////////////////////////////////////////////////////
// PAGE LAYOUT AND CODE SAMPLE BACKGROUND
////////////////////////////////////////////////////////////////////////////////
.page-wrapper {
margin-#{left}: $default !important;
margin-#{right}: $nav-width;
.dark-box {
#{right}: $default;
#{left}: 0;
}
}
.lang-selector {
width: $default !important;
a {
float: right;
}
}
////////////////////////////////////////////////////////////////////////////////
// CODE SAMPLE STYLES
////////////////////////////////////////////////////////////////////////////////
.content {
&>h1,
&>h2,
&>h3,
&>h4,
&>h5,
&>h6,
&>p,
&>table,
&>ul,
&>ol,
&>aside,
&>dl {
margin-#{left}: $examples-width;
margin-#{right}: $default !important;
}
&>ul,
&>ol {
padding-#{right}: $main-padding + 15px;
}
table {
th,
td {
text-align: right;
}
}
dd {
margin-#{right}: 15px;
}
aside {
aside:before {
padding-#{left}: 0.5em;
}
.search-highlight {
background: linear-gradient(to top right, #F7E633 0%, #F1D32F 100%);
}
}
pre,
blockquote {
float: left !important;
clear: left !important;
}
}
////////////////////////////////////////////////////////////////////////////////
// TYPOGRAPHY
////////////////////////////////////////////////////////////////////////////////
h1,
h2,
h3,
h4,
h5,
h6,
p,
aside {
text-align: right;
direction: rtl;
}
.toc-wrapper {
text-align: right;
direction: rtl;
font-weight: 100 !important;
}
////////////////////////////////////////////////////////////////////////////////
// RESPONSIVE DESIGN
////////////////////////////////////////////////////////////////////////////////
@media (max-width: $tablet-width) {
.toc-wrapper {
#{right}: -$nav-width;
&.open {
#{right}: 0;
}
}
.page-wrapper {
margin-#{right}: 0;
}
}
@media (max-width: $phone-width) {
%left-col {
margin-#{left}: 0;
}
}

View file

@ -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;
////////////////////////////////////////////////////////////////////////////////

View file

@ -2,6 +2,7 @@
@import 'normalize';
@import 'variables';
@import 'icon-font';
// @import 'rtl'; // uncomment to switch to RTL format
/*
Copyright 2008-2013 Concur Technologies, Inc.
@ -46,16 +47,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;
@ -80,9 +72,10 @@ html, body {
}
// This is the logo at the top of the ToC
&>img {
.logo {
display: block;
max-width: 100%;
margin-bottom: $logo-margin;
}
&>.search {
@ -95,7 +88,7 @@ html, body {
padding: 6px 0 6px 20px;
box-sizing: border-box;
margin: $nav-v-padding $nav-padding;
width: $nav-width - 30;
width: $nav-width - ($nav-padding*2);
outline: none;
color: $nav-text;
border-radius: 0; /* ios has a default border radius */
@ -110,10 +103,6 @@ html, body {
}
}
img+.tocify {
margin-top: $logo-margin;
}
.search-results {
margin-top: 0;
box-sizing: border-box;
@ -123,13 +112,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;
@ -146,14 +134,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.
@ -168,32 +148,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 {
@ -216,7 +194,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: $nav-text;
transition-property: background;
transition-timing-function: linear;
transition-duration: 130ms;
}
// button to show navigation on mobile devices
@ -324,6 +314,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;
@ -339,7 +331,6 @@ html, body {
padding: 0 $main-padding;
box-sizing: border-box;
display: block;
text-shadow: $main-embossed-text-shadow;
@extend %left-col;
}
@ -355,14 +346,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 {
@ -372,13 +363,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
@ -412,6 +403,9 @@ html, body {
text-align: left;
vertical-align: top;
line-height: 1.6;
code {
white-space: nowrap;
}
}
th {
@ -470,7 +464,6 @@ html, body {
aside {
padding-top: 1em;
padding-bottom: 1em;
text-shadow: 0 1px 0 lighten($aside-notice-bg, 15%);
margin-top: 1.5em;
margin-bottom: 1.5em;
background: $aside-notice-bg;
@ -478,12 +471,10 @@ html, body {
&.warning {
background-color: $aside-warning-bg;
text-shadow: 0 1px 0 lighten($aside-warning-bg, 15%);
}
&.success {
background-color: $aside-success-bg;
text-shadow: 0 1px 0 lighten($aside-success-bg, 15%);
}
}
@ -507,10 +498,9 @@ html, body {
.search-highlight {
padding: 2px;
margin: -2px;
margin: -3px;
border-radius: 4px;
border: 1px solid #F7E633;
text-shadow: 1px 1px 0 #666;
background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%);
}
}
@ -525,7 +515,6 @@ html, body {
background-color: $code-bg;
color: #fff;
padding: 2em $main-padding;
margin: 0;
width: $examples-width;
@ -533,7 +522,6 @@ html, body {
clear:right;
box-sizing: border-box;
text-shadow: 0px 1px 2px rgba(0,0,0,0.4);
@extend %right-col;
@ -548,16 +536,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;
}
}
}
@ -569,7 +557,7 @@ html, body {
// There are also a couple styles disperesed
@media (max-width: $tablet-width) {
.tocify-wrapper {
.toc-wrapper {
left: -$nav-width;
&.open {
@ -585,7 +573,7 @@ html, body {
display: block;
}
.tocify-wrapper .tocify-item > a {
.toc-link {
padding-top: 0.3em;
padding-bottom: 0.3em;
}
@ -600,7 +588,7 @@ html, body {
margin-right: 0;
}
.tocify-wrapper .lang-selector {
.toc-wrapper .lang-selector {
display: block;
}
@ -624,4 +612,4 @@ html, body {
.highlight, .highlight .w {
background-color: $code-bg;
}
}