Commit 7f873ca9e058a7857f1e284edc9464e407f31694

Authored by Tariq Islam
2 parents 203bc792 415dcf2c

Merge pull request #281 from tripit/dev

Slate v1.2
holy moly that's a lot of changes! :+1:
.travis.yml
  1 +sudo: false
  2 +
  3 +language: ruby
  4 +
1 5 rvm:
2 6 - 1.9.3
3 7 - 2.0.0
  8 +
  9 +cache: bundler
... ...
CHANGELOG.md
1 1 # Changelog
2 2  
  3 +## Version 1.2
  4 +
  5 +*June 20, 2014*
  6 +
  7 +**Fixes:**
  8 +
  9 +- Remove crash on invalid languages
  10 +- Update Tocify to scroll to the highlighted header in the Table of Contents
  11 +- Fix variable leak and update search algorithms
  12 +- Update Python examples to be valid Python
  13 +- Update gems
  14 +- More misc. bugfixes of Javascript errors
  15 +- Add Dockerfile
  16 +- Remove unused gems
  17 +- Optimize images, fonts, and generated asset files
  18 +- Add chinese font support
  19 +- Remove RedCarpet header ID patch
  20 +- Update language tabs to not disturb existing query strings
  21 +
3 22 ## Version 1.1
4 23  
5 24 *July 27th, 2014*
... ...
1   -source 'http://rubygems.org'
  1 +source 'https://rubygems.org'
2 2  
3 3 # Middleman
4 4 gem 'middleman', '~>3.3.10'
5 5 gem 'middleman-gh-pages', '~> 0.0.3'
6 6 gem 'middleman-syntax', '~> 2.0.0'
7   -gem 'rouge', '~> 1.8.0'
8   -gem 'redcarpet', '~> 3.2.2'
  7 +gem 'middleman-autoprefixer', '~> 2.4.4'
  8 +gem 'rouge', '~> 1.9.0'
  9 +gem 'redcarpet', '~> 3.3.1'
9 10  
10 11 gem 'rake', '~> 10.4.2'
11 12 gem 'therubyracer', '~> 0.12.1', platforms: :ruby
... ...
Gemfile.lock
1 1 GEM
2   - remote: http://rubygems.org/
  2 + remote: https://rubygems.org/
3 3 specs:
4   - activesupport (4.1.10)
  4 + activesupport (4.1.11)
5 5 i18n (~> 0.6, >= 0.6.9)
6 6 json (~> 1.7, >= 1.7.7)
7 7 minitest (~> 5.1)
8 8 thread_safe (~> 0.1)
9 9 tzinfo (~> 1.1)
  10 + autoprefixer-rails (5.2.0.1)
  11 + execjs
  12 + json
10 13 celluloid (0.16.0)
11 14 timers (~> 4.0.0)
12 15 chunky_png (1.3.4)
... ... @@ -36,25 +39,28 @@ GEM
36 39 hooks (0.4.0)
37 40 uber (~> 0.0.4)
38 41 i18n (0.7.0)
39   - json (1.8.2)
  42 + json (1.8.3)
40 43 kramdown (1.7.0)
41 44 libv8 (3.16.14.7)
42   - listen (2.10.0)
  45 + listen (2.10.1)
43 46 celluloid (~> 0.16.0)
44 47 rb-fsevent (>= 0.9.3)
45 48 rb-inotify (>= 0.9)
46   - middleman (3.3.11)
  49 + middleman (3.3.12)
47 50 coffee-script (~> 2.2)
48 51 compass (>= 1.0.0, < 2.0.0)
49 52 compass-import-once (= 1.0.5)
50 53 execjs (~> 2.0)
51 54 haml (>= 4.0.5)
52 55 kramdown (~> 1.2)
53   - middleman-core (= 3.3.11)
  56 + middleman-core (= 3.3.12)
54 57 middleman-sprockets (>= 3.1.2)
55 58 sass (>= 3.4.0, < 4.0)
56 59 uglifier (~> 2.5)
57   - middleman-core (3.3.11)
  60 + middleman-autoprefixer (2.4.4)
  61 + autoprefixer-rails (~> 5.2.0)
  62 + middleman-core (>= 3.3.3)
  63 + middleman-core (3.3.12)
58 64 activesupport (~> 4.1.0)
59 65 bundler (~> 1.1)
60 66 erubis
... ... @@ -76,25 +82,25 @@ GEM
76 82 middleman-syntax (2.0.0)
77 83 middleman-core (~> 3.2)
78 84 rouge (~> 1.0)
79   - minitest (5.6.1)
80   - multi_json (1.11.0)
  85 + minitest (5.7.0)
  86 + multi_json (1.11.1)
81 87 padrino-helpers (0.12.5)
82 88 i18n (~> 0.6, >= 0.6.7)
83 89 padrino-support (= 0.12.5)
84 90 tilt (~> 1.4.1)
85 91 padrino-support (0.12.5)
86 92 activesupport (>= 3.1)
87   - rack (1.6.0)
  93 + rack (1.6.4)
88 94 rack-test (0.6.3)
89 95 rack (>= 1.0)
90 96 rake (10.4.2)
91   - rb-fsevent (0.9.4)
  97 + rb-fsevent (0.9.5)
92 98 rb-inotify (0.9.5)
93 99 ffi (>= 0.5.0)
94   - redcarpet (3.2.3)
  100 + redcarpet (3.3.1)
95 101 ref (1.0.5)
96   - rouge (1.8.0)
97   - sass (3.4.13)
  102 + rouge (1.9.0)
  103 + sass (3.4.14)
98 104 sprockets (2.12.3)
99 105 hike (~> 1.2)
100 106 multi_json (~> 1.0)
... ... @@ -125,9 +131,10 @@ PLATFORMS
125 131  
126 132 DEPENDENCIES
127 133 middleman (~> 3.3.10)
  134 + middleman-autoprefixer (~> 2.4.4)
128 135 middleman-gh-pages (~> 0.0.3)
129 136 middleman-syntax (~> 2.0.0)
130 137 rake (~> 10.4.2)
131   - redcarpet (~> 3.2.2)
132   - rouge (~> 1.8.0)
  138 + redcarpet (~> 3.3.1)
  139 + rouge (~> 1.9.0)
133 140 therubyracer (~> 0.12.1)
... ...
README.md
... ... @@ -102,7 +102,7 @@ Just [submit a issue](https://github.com/tripit/slate/issues) to the Slate Githu
102 102 Contributors
103 103 --------------------
104 104  
105   -Slate was built by [Robert Lord](http://lord.io) while at [TripIt](http://tripit.com).
  105 +Slate was built by [Robert Lord](https://lord.io) while at [TripIt](http://tripit.com).
106 106  
107 107 Thanks to the following people who have submitted major pull requests:
108 108  
... ...
Rakefile
1 1 require 'middleman-gh-pages'
  2 +require 'rake/clean'
  3 +
  4 +CLOBBER.include('build')
2 5  
3 6 task :default => [:build]
... ...
config.rb
... ... @@ -18,6 +18,12 @@ set :fonts_dir, &#39;fonts&#39;
18 18 # Activate the syntax highlighter
19 19 activate :syntax
20 20  
  21 +activate :autoprefixer do |config|
  22 + config.browsers = ['last 2 version', 'Firefox ESR']
  23 + config.cascade = false
  24 + config.inline = true
  25 +end
  26 +
21 27 # Github pages require relative links
22 28 activate :relative_assets
23 29 set :relative_links, true
... ...
font-selection.json 0 → 100755
  1 +{
  2 + "IcoMoonType": "selection",
  3 + "icons": [
  4 + {
  5 + "icon": {
  6 + "paths": [
  7 + "M438.857 73.143q119.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 785.714v-108.571q0-8-5.143-13.429t-12.571-5.429h-109.714q-7.429 0-13.143 5.714t-5.714 13.143v108.571q0 7.429 5.714 13.143t13.143 5.714h109.714q7.429 0 12.571-5.429t5.143-13.429zM510.857 589.143l10.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"
  8 + ],
  9 + "attrs": [],
  10 + "isMulticolor": false,
  11 + "tags": [
  12 + "exclamation-circle"
  13 + ],
  14 + "defaultCode": 61546,
  15 + "grid": 14
  16 + },
  17 + "attrs": [],
  18 + "properties": {
  19 + "id": 100,
  20 + "order": 4,
  21 + "prevSize": 28,
  22 + "code": 58880,
  23 + "name": "exclamation-sign",
  24 + "ligatures": ""
  25 + },
  26 + "setIdx": 0,
  27 + "iconIdx": 0
  28 + },
  29 + {
  30 + "icon": {
  31 + "paths": [
  32 + "M585.143 786.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-54.857v-292.571q0-8-5.143-13.143t-13.143-5.143h-182.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h54.857v182.857h-54.857q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h256q8 0 13.143-5.143t5.143-13.143zM512 274.286v-91.429q0-8-5.143-13.143t-13.143-5.143h-109.714q-8 0-13.143 5.143t-5.143 13.143v91.429q0 8 5.143 13.143t13.143 5.143h109.714q8 0 13.143-5.143t5.143-13.143zM877.714 512q0 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"
  33 + ],
  34 + "attrs": [],
  35 + "isMulticolor": false,
  36 + "tags": [
  37 + "info-circle"
  38 + ],
  39 + "defaultCode": 61530,
  40 + "grid": 14
  41 + },
  42 + "attrs": [],
  43 + "properties": {
  44 + "id": 85,
  45 + "order": 3,
  46 + "name": "info-sign",
  47 + "prevSize": 28,
  48 + "code": 58882
  49 + },
  50 + "setIdx": 0,
  51 + "iconIdx": 2
  52 + },
  53 + {
  54 + "icon": {
  55 + "paths": [
  56 + "M733.714 419.429q0-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 512q0 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"
  57 + ],
  58 + "attrs": [],
  59 + "isMulticolor": false,
  60 + "tags": [
  61 + "check-circle"
  62 + ],
  63 + "defaultCode": 61528,
  64 + "grid": 14
  65 + },
  66 + "attrs": [],
  67 + "properties": {
  68 + "id": 83,
  69 + "order": 9,
  70 + "prevSize": 28,
  71 + "code": 58886,
  72 + "name": "ok-sign"
  73 + },
  74 + "setIdx": 0,
  75 + "iconIdx": 6
  76 + },
  77 + {
  78 + "icon": {
  79 + "paths": [
  80 + "M658.286 475.429q0-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 950.857q0 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"
  81 + ],
  82 + "width": 951,
  83 + "attrs": [],
  84 + "isMulticolor": false,
  85 + "tags": [
  86 + "search"
  87 + ],
  88 + "defaultCode": 61442,
  89 + "grid": 14
  90 + },
  91 + "attrs": [],
  92 + "properties": {
  93 + "id": 2,
  94 + "order": 1,
  95 + "prevSize": 28,
  96 + "code": 58887,
  97 + "name": "icon-search"
  98 + },
  99 + "setIdx": 0,
  100 + "iconIdx": 7
  101 + }
  102 + ],
  103 + "height": 1024,
  104 + "metadata": {
  105 + "name": "slate",
  106 + "license": "SIL OFL 1.1"
  107 + },
  108 + "preferences": {
  109 + "showGlyphs": true,
  110 + "showQuickUse": true,
  111 + "showQuickUse2": true,
  112 + "showSVGs": true,
  113 + "fontPref": {
  114 + "prefix": "icon-",
  115 + "metadata": {
  116 + "fontFamily": "slate",
  117 + "majorVersion": 1,
  118 + "minorVersion": 0,
  119 + "description": "Based on FontAwesome",
  120 + "license": "SIL OFL 1.1"
  121 + },
  122 + "metrics": {
  123 + "emSize": 1024,
  124 + "baseline": 6.25,
  125 + "whitespace": 50
  126 + },
  127 + "resetPoint": 58880,
  128 + "showSelector": false,
  129 + "selector": "class",
  130 + "classSelector": ".icon",
  131 + "showMetrics": false,
  132 + "showMetadata": true,
  133 + "showVersion": true,
  134 + "ie7": false
  135 + },
  136 + "imagePref": {
  137 + "prefix": "icon-",
  138 + "png": true,
  139 + "useClassSelector": true,
  140 + "color": 4473924,
  141 + "bgColor": 16777215
  142 + },
  143 + "historySize": 100,
  144 + "showCodes": true,
  145 + "gridSize": 16,
  146 + "showLiga": false
  147 + }
  148 +}
... ...
source/fonts/icomoon.svg deleted
1   -<?xml version="1.0" standalone="no"?>
2   -<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
3   -<svg xmlns="http://www.w3.org/2000/svg">
4   -<metadata>Generated by IcoMoon</metadata>
5   -<defs>
6   -<font id="icomoon" horiz-adv-x="512">
7   -<font-face units-per-em="512" ascent="480" descent="-32" />
8   -<missing-glyph horiz-adv-x="512" />
9   -<glyph unicode="&#x20;" d="" horiz-adv-x="256" />
10   -<glyph unicode="&#xe600;" d="M219.429 475.428q59.715 0 110.143-29.428t79.857-79.857 29.428-110.143-29.428-110.143-79.857-79.857-110.143-29.428-110.143 29.428-79.857 79.857-29.428 110.143 29.428 110.143 79.857 79.857 110.143 29.428zM256 119.143v54.286q0 4-2.571 6.714t-6.286 2.714h-54.857q-3.714 0-6.572-2.857t-2.857-6.572v-54.286q0-3.714 2.857-6.572t6.572-2.857h54.857q3.714 0 6.286 2.714t2.571 6.714zM255.429 217.428l5.143 177.428q0 3.429-2.857 5.143-2.857 2.286-6.857 2.286h-62.857q-4 0-6.857-2.286-2.857-1.714-2.857-5.143l4.857-177.428q0-2.857 2.857-5t6.857-2.143h52.857q4 0 6.714 2.143t3 5z" horiz-adv-x="439" />
11   -<glyph unicode="&#xe601;" d="M256 118.857v54.857q0 4-2.571 6.572t-6.571 2.572h-54.857q-4 0-6.571-2.572t-2.571-6.572v-54.857q0-4 2.571-6.572t6.572-2.572h54.857q4 0 6.571 2.572t2.572 6.572zM329.143 310.857q0 25.143-15.857 46.572t-39.572 33.143-48.572 11.714q-69.428 0-106-60.857-4.285-6.857 2.285-12l37.715-28.571q2-1.714 5.428-1.714 4.572 0 7.143 3.428 15.143 19.429 24.571 26.286 9.714 6.857 24.572 6.857 13.714 0 24.428-7.429t10.714-16.857q0-10.857-5.714-17.428t-19.428-12.857q-18-8-33-24.715t-15-35.857v-10.286q0-4 2.571-6.572t6.571-2.572h54.857q4 0 6.571 2.572t2.572 6.572q0 5.428 6.143 14.143t15.572 14.143q9.143 5.143 14 8.143t13.143 10 12.714 13.714 8 17.286 3.572 23.143zM438.857 256q0-59.714-29.428-110.143t-79.857-79.857-110.143-29.428-110.143 29.428-79.857 79.857-29.428 110.143 29.428 110.143 79.857 79.857 110.143 29.428 110.143-29.428 79.857-79.857 29.428-110.143z" horiz-adv-x="439" />
12   -<glyph unicode="&#xe602;" d="M292.572 118.857v45.714q0 4-2.572 6.572t-6.572 2.572h-27.428v146.286q0 4-2.571 6.572t-6.571 2.571h-91.428q-4 0-6.572-2.571t-2.571-6.572v-45.714q0-4 2.571-6.572t6.572-2.572h27.428v-91.428h-27.428q-4 0-6.572-2.572t-2.571-6.572v-45.714q0-4 2.571-6.572t6.572-2.572h128q4 0 6.572 2.572t2.572 6.572zM256 374.857v45.715q0 4-2.571 6.572t-6.571 2.571h-54.857q-4 0-6.571-2.571t-2.571-6.572v-45.715q0-4 2.571-6.571t6.572-2.572h54.857q4 0 6.571 2.572t2.572 6.571zM438.857 256q0-59.714-29.428-110.143t-79.857-79.857-110.143-29.428-110.143 29.428-79.857 79.857-29.428 110.143 29.428 110.143 79.857 79.857 110.143 29.428 110.143-29.428 79.857-79.857 29.428-110.143z" horiz-adv-x="439" />
13   -<glyph unicode="&#xe603;" d="M328.286 191.428q0 7.428-5.428 12.857l-51.714 51.714 51.714 51.714q5.428 5.428 5.428 12.857 0 7.715-5.428 13.143l-25.714 25.714q-5.428 5.429-13.143 5.429-7.428 0-12.857-5.429l-51.714-51.714-51.714 51.714q-5.428 5.429-12.857 5.429-7.714 0-13.143-5.429l-25.715-25.714q-5.428-5.428-5.428-13.143 0-7.428 5.428-12.857l51.715-51.714-51.715-51.714q-5.428-5.428-5.428-12.857 0-7.714 5.428-13.143l25.715-25.714q5.428-5.428 13.143-5.428 7.429 0 12.857 5.428l51.714 51.714 51.714-51.714q5.428-5.428 12.857-5.428 7.714 0 13.143 5.428l25.714 25.714q5.428 5.428 5.428 13.143zM438.857 256q0-59.714-29.428-110.143t-79.857-79.857-110.143-29.428-110.143 29.428-79.857 79.857-29.428 110.143 29.428 110.143 79.857 79.857 110.143 29.428 110.143-29.428 79.857-79.857 29.428-110.143z" horiz-adv-x="439" />
14   -<glyph unicode="&#xe604;" d="M347.428 237.714v36.572q0 7.428-5.428 12.857t-12.857 5.428h-73.143v73.143q0 7.428-5.428 12.857t-12.857 5.428h-36.571q-7.428 0-12.857-5.428t-5.429-12.857v-73.143h-73.143q-7.428 0-12.857-5.428t-5.428-12.857v-36.572q0-7.428 5.428-12.857t12.857-5.429h73.143v-73.143q0-7.428 5.428-12.857t12.857-5.428h36.571q7.428 0 12.857 5.428t5.429 12.857v73.143h73.143q7.428 0 12.857 5.428t5.428 12.857zM438.857 256q0-59.714-29.428-110.143t-79.857-79.857-110.143-29.428-110.143 29.428-79.857 79.857-29.428 110.143 29.428 110.143 79.857 79.857 110.143 29.428 110.143-29.428 79.857-79.857 29.428-110.143z" horiz-adv-x="439" />
15   -<glyph unicode="&#xe605;" d="M347.428 237.714v36.572q0 7.428-5.428 12.857t-12.857 5.428h-219.429q-7.428 0-12.857-5.428t-5.428-12.857v-36.572q0-7.428 5.428-12.857t12.857-5.429h219.429q7.428 0 12.857 5.428t5.428 12.857zM438.857 256q0-59.714-29.428-110.143t-79.857-79.857-110.143-29.428-110.143 29.428-79.857 79.857-29.428 110.143 29.428 110.143 79.857 79.857 110.143 29.428 110.143-29.428 79.857-79.857 29.428-110.143z" horiz-adv-x="439" />
16   -<glyph unicode="&#xe606;" d="M366.857 302.286q0 8-5.143 13.143l-26 25.715q-5.428 5.428-12.857 5.428t-12.857-5.428l-116.572-116.286-64.572 64.572q-5.428 5.428-12.857 5.428t-12.857-5.428l-26-25.714q-5.143-5.143-5.143-13.143 0-7.714 5.143-12.857l103.428-103.428q5.428-5.428 12.857-5.428 7.714 0 13.143 5.428l155.143 155.143q5.143 5.143 5.143 12.857zM438.857 256q0-59.714-29.428-110.143t-79.857-79.857-110.143-29.428-110.143 29.428-79.857 79.857-29.428 110.143 29.428 110.143 79.857 79.857 110.143 29.428 110.143-29.428 79.857-79.857 29.428-110.143z" horiz-adv-x="439" />
17   -<glyph unicode="&#xe607;" d="M496.131 44.302l-121.276 103.147c-12.537 11.283-25.945 16.463-36.776 15.963 28.628 33.534 45.921 77.039 45.921 124.588 0 106.039-85.961 192-192 192-106.038 0-192-85.961-192-192 0-106.039 85.961-192 192-192 47.549 0 91.054 17.293 124.588 45.922-0.5-10.831 4.68-24.239 15.963-36.776l103.147-121.276c17.661-19.623 46.511-21.277 64.11-3.678s15.946 46.449-3.677 64.11zM192 160c-70.692 0-128 57.308-128 128s57.308 128 128 128 128-57.308 128-128-57.307-128-128-128z" />
18   -</font></defs></svg>
19 0 \ No newline at end of file
source/fonts/icomoon.ttf deleted
No preview for this file type
source/fonts/icomoon.woff deleted
No preview for this file type
source/fonts/icomoon.eot renamed to source/fonts/slate.eot
No preview for this file type
source/fonts/slate.svg 0 → 100755
  1 +<?xml version="1.0" standalone="no"?>
  2 +<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
  3 +<svg xmlns="http://www.w3.org/2000/svg">
  4 +<metadata>Generated by IcoMoon</metadata>
  5 +<defs>
  6 +<font id="slate" horiz-adv-x="1024">
  7 +<font-face units-per-em="1024" ascent="960" descent="-64" />
  8 +<missing-glyph horiz-adv-x="1024" />
  9 +<glyph unicode="&#x20;" d="" horiz-adv-x="512" />
  10 +<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" />
  11 +<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" />
  12 +<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" />
  13 +<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" />
  14 +</font></defs></svg>
... ...
source/fonts/slate.ttf 0 → 100755
No preview for this file type
source/fonts/slate.woff 0 → 100755
No preview for this file type
source/fonts/slate.woff2 0 → 100755
No preview for this file type
source/index.md
... ... @@ -106,7 +106,7 @@ This endpoint retrieves all kittens.
106 106  
107 107 ### HTTP Request
108 108  
109   -`GET http://example.com/kittens`
  109 +`GET http://example.com/api/kittens`
110 110  
111 111 ### Query Parameters
112 112  
... ... @@ -136,7 +136,7 @@ api.kittens.get(2)
136 136 ```
137 137  
138 138 ```shell
139   -curl "http://example.com/api/kittens/3"
  139 +curl "http://example.com/api/kittens/2"
140 140 -H "Authorization: meowmeowmeow"
141 141 ```
142 142  
... ... @@ -164,5 +164,5 @@ This endpoint retrieves a specific kitten.
164 164  
165 165 Parameter | Description
166 166 --------- | -----------
167   -ID | The ID of the cat to retrieve
  167 +ID | The ID of the kitten to retrieve
168 168  
... ...
source/javascripts/all.js
1   -//= require_tree ./lib
2   -//= require_tree ./app
  1 +//= require ./lib/_energize
  2 +//= require ./app/_lang
  3 +//= require ./app/_search
  4 +//= require ./app/_toc
... ...
source/javascripts/all_nosearch.js
1   -//= require_tree ./lib
2   -//= require_tree ./app
3   -//= stub ./app/search.js
4   -//= stub ./lib/lunr.js
  1 +//= require ./lib/_energize
  2 +//= require ./app/_lang
  3 +//= require ./app/_toc
... ...
source/javascripts/app/lang.js renamed to source/javascripts/app/_lang.js
... ... @@ -40,6 +40,80 @@ under the License.
40 40 }
41 41 }
42 42  
  43 + // parseURL and stringifyURL are from https://github.com/sindresorhus/query-string
  44 + // MIT licensed
  45 + // https://github.com/sindresorhus/query-string/blob/7bee64c16f2da1a326579e96977b9227bf6da9e6/license
  46 + function parseURL(str) {
  47 + if (typeof str !== 'string') {
  48 + return {};
  49 + }
  50 +
  51 + str = str.trim().replace(/^(\?|#|&)/, '');
  52 +
  53 + if (!str) {
  54 + return {};
  55 + }
  56 +
  57 + return str.split('&').reduce(function (ret, param) {
  58 + var parts = param.replace(/\+/g, ' ').split('=');
  59 + var key = parts[0];
  60 + var val = parts[1];
  61 +
  62 + key = decodeURIComponent(key);
  63 + // missing `=` should be `null`:
  64 + // http://w3.org/TR/2012/WD-url-20120524/#collect-url-parameters
  65 + val = val === undefined ? null : decodeURIComponent(val);
  66 +
  67 + if (!ret.hasOwnProperty(key)) {
  68 + ret[key] = val;
  69 + } else if (Array.isArray(ret[key])) {
  70 + ret[key].push(val);
  71 + } else {
  72 + ret[key] = [ret[key], val];
  73 + }
  74 +
  75 + return ret;
  76 + }, {});
  77 + };
  78 +
  79 + function stringifyURL(obj) {
  80 + return obj ? Object.keys(obj).sort().map(function (key) {
  81 + var val = obj[key];
  82 +
  83 + if (Array.isArray(val)) {
  84 + return val.sort().map(function (val2) {
  85 + return encodeURIComponent(key) + '=' + encodeURIComponent(val2);
  86 + }).join('&');
  87 + }
  88 +
  89 + return encodeURIComponent(key) + '=' + encodeURIComponent(val);
  90 + }).join('&') : '';
  91 + };
  92 +
  93 + // gets the language set in the query string
  94 + function getLanguageFromQueryString() {
  95 + if (location.search.length >= 1) {
  96 + var language = parseURL(location.search).language
  97 + if (language) {
  98 + return language;
  99 + } else if (jQuery.inArray(location.search.substr(1), languages) != -1) {
  100 + return location.search.substr(1);
  101 + }
  102 + }
  103 +
  104 + return false;
  105 + }
  106 +
  107 + // returns a new query string with the new language in it
  108 + function generateNewQueryString(language) {
  109 + var url = parseURL(location.search);
  110 + if (url.language) {
  111 + url.language = language;
  112 + return stringifyURL(url);
  113 + }
  114 + return language;
  115 + }
  116 +
43 117 // if a button is clicked, add the state to the history
44 118 function pushURL(language) {
45 119 if (!history) { return; }
... ... @@ -47,23 +121,23 @@ under the License.
47 121 if (hash) {
48 122 hash = hash.replace(/^#+/, '');
49 123 }
50   - history.pushState({}, '', '?' + language + '#' + hash);
  124 + history.pushState({}, '', '?' + generateNewQueryString(language) + '#' + hash);
51 125  
52 126 // save language as next default
53 127 localStorage.setItem("language", language);
54 128 }
55 129  
56 130 function setupLanguages(l) {
57   - var currentLanguage = l[0];
58 131 var defaultLanguage = localStorage.getItem("language");
59 132  
60 133 languages = l;
61 134  
62   - if ((location.search.substr(1) !== "") && (jQuery.inArray(location.search.substr(1), languages)) != -1) {
  135 + var presetLanguage = getLanguageFromQueryString();
  136 + if (presetLanguage) {
63 137 // the language is in the URL, so use that language!
64   - activateLanguage(location.search.substr(1));
  138 + activateLanguage(presetLanguage);
65 139  
66   - localStorage.setItem("language", location.search.substr(1));
  140 + localStorage.setItem("language", presetLanguage);
67 141 } else if ((defaultLanguage !== null) && (jQuery.inArray(defaultLanguage, languages) != -1)) {
68 142 // the language was the last selected one saved in localstorage, so use that language!
69 143 activateLanguage(defaultLanguage);
... ... @@ -81,8 +155,8 @@ under the License.
81 155 activateLanguage(language);
82 156 return false;
83 157 });
84   - window.onpopstate = function(event) {
85   - activateLanguage(window.location.search.substr(1));
  158 + window.onpopstate = function() {
  159 + activateLanguage(getLanguageFromQueryString());
86 160 };
87 161 });
88 162 })(window);
... ...
source/javascripts/app/search.js renamed to source/javascripts/app/_search.js
1   -(function (global) {
  1 +//= require ../lib/_lunr
  2 +//= require ../lib/_jquery.highlight
  3 +(function () {
2 4 'use strict';
3 5  
4   - var $global = $(global);
5   - var content, darkBox, searchResults;
  6 + var content, searchResults;
6 7 var highlightOpts = { element: 'span', className: 'search-highlight' };
7 8  
8 9 var index = new lunr.Index();
... ... @@ -29,7 +30,6 @@
29 30  
30 31 function bind() {
31 32 content = $('.content');
32   - darkBox = $('.dark-box');
33 33 searchResults = $('.search-results');
34 34  
35 35 $('#input-search').on('keyup', search);
... ... @@ -56,7 +56,7 @@
56 56 highlight.call(this);
57 57 } else {
58 58 searchResults.html('<li></li>');
59   - $('.search-results li').text('No Results Found for "' + this.value + '"');
  59 + $('.search-results li').text('No Results Found for "' + this.value + '"');
60 60 }
61 61 } else {
62 62 unhighlight();
... ... @@ -71,5 +71,4 @@
71 71 function unhighlight() {
72 72 content.unhighlight(highlightOpts);
73 73 }
74   -
75   -})(window);
  74 +})();
... ...
source/javascripts/app/toc.js renamed to source/javascripts/app/_toc.js
  1 +//= require ../lib/_jquery_ui
  2 +//= require ../lib/_jquery.tocify
1 3 (function (global) {
2 4 'use strict';
3 5  
... ...
source/javascripts/lib/energize.js renamed to source/javascripts/lib/_energize.js
source/javascripts/lib/jquery.highlight.js renamed to source/javascripts/lib/_jquery.highlight.js
source/javascripts/lib/jquery.tocify.js renamed to source/javascripts/lib/_jquery.tocify.js
1   -//= require ./jquery_ui
2 1 /* jquery Tocify - v1.8.0 - 2013-09-16
3 2 * http://www.gregfranko.com/jquery.tocify.js/
4 3 * Copyright (c) 2013 Greg Franko; Licensed MIT
... ... @@ -1040,4 +1039,4 @@
1040 1039  
1041 1040 });
1042 1041  
1043   -})); //end of plugin
1044 1042 \ No newline at end of file
  1043 +})); //end of plugin
... ...
source/javascripts/lib/jquery_ui.js renamed to source/javascripts/lib/_jquery_ui.js
source/javascripts/lib/lunr.js renamed to source/javascripts/lib/_lunr.js
source/stylesheets/_icon-font.scss
1 1 @font-face {
2   - font-family: 'icomoon';
3   - src:font-url('icomoon.eot');
4   - src:font-url('icomoon.eot?#iefix') format('embedded-opentype'),
5   - font-url('icomoon.ttf') format('truetype'),
6   - font-url('icomoon.woff') format('woff'),
7   - font-url('icomoon.svg#icomoon') format('svg');
  2 + font-family: 'slate';
  3 + src:font-url('slate.eot?-syv14m');
  4 + src:font-url('slate.eot?#iefix-syv14m') format('embedded-opentype'),
  5 + font-url('slate.woff2?-syv14m') format('woff2'),
  6 + font-url('slate.woff?-syv14m') format('woff'),
  7 + font-url('slate.ttf?-syv14m') format('truetype'),
  8 + font-url('slate.svg?-syv14m#slate') format('svg');
8 9 font-weight: normal;
9 10 font-style: normal;
10 11 }
11 12  
12 13 %icon {
13   - font-family: 'icomoon';
  14 + font-family: 'slate';
14 15 speak: none;
15 16 font-style: normal;
16 17 font-weight: normal;
... ... @@ -23,26 +24,10 @@
23 24 @extend %icon;
24 25 content: "\e600";
25 26 }
26   -%icon-question-sign {
27   - @extend %icon;
28   - content: "\e601";
29   -}
30 27 %icon-info-sign {
31 28 @extend %icon;
32 29 content: "\e602";
33 30 }
34   -%icon-remove-sign {
35   - @extend %icon;
36   - content: "\e603";
37   -}
38   -%icon-plus-sign {
39   - @extend %icon;
40   - content: "\e604";
41   -}
42   -%icon-minus-sign {
43   - @extend %icon;
44   - content: "\e605";
45   -}
46 31 %icon-ok-sign {
47 32 @extend %icon;
48 33 content: "\e606";
... ...
source/stylesheets/_variables.scss
... ... @@ -68,7 +68,7 @@ $phone-width: $tablet-width - $nav-width; // min width before reverting to mobil
68 68 // FONTS
69 69 ////////////////////
70 70 %default-font {
71   - font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  71 + font-family: "Helvetica Neue", Helvetica, Arial, "Microsoft Yahei","微软雅黑", STXihei, "华文细黑", sans-serif;
72 72 font-size: 13px;
73 73 }
74 74  
... ... @@ -100,13 +100,10 @@ $search-box-border-color: #666;
100 100 // These settings are probably best left alone.
101 101  
102 102 %break-words {
103   - -ms-word-break: break-all;
104 103 word-break: break-all;
105 104  
106 105 /* Non standard for webkit */
107 106 word-break: break-word;
108 107  
109   --webkit-hyphens: auto;
110   - -moz-hyphens: auto;
111 108 hyphens: auto;
112 109 }
... ...
source/stylesheets/screen.css.scss
... ... @@ -49,25 +49,17 @@ html, body {
49 49 }
50 50  
51 51 @mixin embossed-bg {
52   - @include background(
53   - linear-gradient(top,
54   - rgba(#000, 0.2),
55   - rgba(#000, 0) 8px),
56   - linear-gradient(bottom,
57   - rgba(#000, 0.2),
58   - rgba(#000, 0) 8px),
59   - linear-gradient(top,
60   - rgba($nav-embossed-border-top, 1),
61   - rgba($nav-embossed-border-top, 0) 1.5px),
62   - linear-gradient(bottom,
63   - rgba($nav-embossed-border-bottom, 1),
64   - rgba($nav-embossed-border-bottom, 0) 1.5px),
65   - $nav-subitem-bg
66   - );
  52 + background:
  53 + linear-gradient(to bottom, rgba(#000, 0.2), rgba(#000, 0) 8px),
  54 + linear-gradient(to top, rgba(#000, 0.2), rgba(#000, 0) 8px),
  55 + linear-gradient(to bottom, rgba($nav-embossed-border-top, 1), rgba($nav-embossed-border-top, 0) 1.5px),
  56 + linear-gradient(to top, rgba($nav-embossed-border-bottom, 1), rgba($nav-embossed-border-bottom, 0) 1.5px),
  57 + $nav-subitem-bg;
67 58 }
68 59  
69 60 .tocify-wrapper {
70   - @include transition(left ease-in-out 0.3s);
  61 + transition: left 0.3s ease-in-out;
  62 +
71 63 overflow-y: auto;
72 64 overflow-x: hidden;
73 65 position: fixed;
... ... @@ -102,7 +94,7 @@ html, body {
102 94 border-width: 0 0 1px 0;
103 95 border-color: $search-box-border-color;
104 96 padding: 6px 0 6px 20px;
105   - @include box-sizing(border-box);
  97 + box-sizing: border-box;
106 98 margin: $nav-v-padding $nav-padding;
107 99 width: $nav-width - 30;
108 100 outline: none;
... ... @@ -125,13 +117,13 @@ html, body {
125 117  
126 118 .search-results {
127 119 margin-top: 0;
128   - @include box-sizing(border-box);
  120 + box-sizing: border-box;
129 121 height: 0;
130 122 overflow-y: auto;
131 123 overflow-x: hidden;
132   - @include transition-property(height margin);
133   - @include transition-duration(180ms);
134   - @include transition-timing-function(ease-in-out);
  124 + transition-property: height, margin;
  125 + transition-duration: 180ms;
  126 + transition-timing-function: ease-in-out;
135 127 &.visible {
136 128 height: 30%;
137 129 margin-bottom: 1em;
... ... @@ -175,14 +167,14 @@ html, body {
175 167  
176 168 li {
177 169 color: $nav-text;
178   - @include transition-property('background');
179   - @include transition-timing-function('linear');
180   - @include transition-duration(230ms);
  170 + transition-property: background;
  171 + transition-timing-function: linear;
  172 + transition-duration: 230ms;
181 173 }
182 174  
183 175 // This is the currently selected ToC entry
184 176 .tocify-focus {
185   - @include box-shadow(0px 1px 0px $nav-active-shadow);
  177 + box-shadow: 0px 1px 0px $nav-active-shadow;
186 178 background-color: $nav-active-bg;
187 179 color: $nav-active-text;
188 180 }
... ... @@ -235,8 +227,8 @@ html, body {
235 227 $side-pad: $main-padding / 2 - 8px;
236 228 padding: $side-pad $side-pad $side-pad;
237 229 background-color: rgba($main-bg, 0.7);
238   - @include transform-origin(0, 0);
239   - @include transform(rotate(-90deg) translate(-100%, 0));
  230 + transform-origin: 0 0;
  231 + transform: rotate(-90deg) translate(-100%, 0);
240 232 border-radius: 0 0 0 5px;
241 233 }
242 234 padding: 0 1.5em 5em 0; // increase touch size area
... ... @@ -255,7 +247,7 @@ html, body {
255 247 vertical-align: bottom;
256 248 }
257 249  
258   - @include transition(left ease-in-out 0.3s);
  250 + transition: left 0.3s ease-in-out;
259 251  
260 252 &:hover { opacity: 1; }
261 253 &.open {left: $nav-width}
... ... @@ -346,7 +338,7 @@ html, body {
346 338 &>h1, &>h2, &>h3, &>h4, &>h5, &>h6, &>p, &>table, &>ul, &>ol, &>aside, &>dl {
347 339 margin-right: $examples-width;
348 340 padding: 0 $main-padding;
349   - @include box-sizing(border-box);
  341 + box-sizing: border-box;
350 342 display: block;
351 343 @include text-shadow($main-embossed-text-shadow);
352 344  
... ... @@ -371,9 +363,7 @@ html, body {
371 363 margin-bottom: $h1-margin-bottom;
372 364 margin-top: 2em;
373 365 border-top: 1px solid #ddd;
374   - @include background-image(
375   - linear-gradient(top, #fff, #f9f9f9)
376   - );
  366 + background-image: linear-gradient(to bottom, #fff, #f9f9f9);
377 367 }
378 368  
379 369 h1:first-child, div:first-child + h1 {
... ... @@ -389,9 +379,7 @@ html, body {
389 379 border-top: 1px solid #ccc;
390 380 padding-top: 1.2em;
391 381 padding-bottom: 1.2em;
392   - @include background-image(
393   - linear-gradient(top, rgba(#fff,0.4), rgba(#fff, 0))
394   - );
  382 + background-image: linear-gradient(to bottom, rgba(#fff, 0.4), rgba(#fff, 0));
395 383 }
396 384  
397 385 // h2s right after h1s should bump right up
... ... @@ -403,10 +391,9 @@ html, body {
403 391  
404 392 h3, h4, h5, h6 {
405 393 @extend %header-font;
406   - font-size: 12px;
  394 + font-size: 15px;
407 395 margin-top: 2.5em;
408 396 margin-bottom: 0.8em;
409   - text-transform: uppercase;
410 397 }
411 398  
412 399 h4, h5, h6 {
... ... @@ -525,7 +512,7 @@ html, body {
525 512 border-radius: 4px;
526 513 border: 1px solid #F7E633;
527 514 @include text-shadow(1px 1px 0 #666);
528   - @include background(linear-gradient(bottom right, #F7E633 0%, #F1D32F 100%));
  515 + background: linear-gradient(to top left, #F7E633 0%, #F1D32F 100%);
529 516 }
530 517 }
531 518  
... ... @@ -546,7 +533,7 @@ html, body {
546 533 float:right;
547 534 clear:right;
548 535  
549   - @include box-sizing(border-box);
  536 + box-sizing: border-box;
550 537 @include text-shadow(0px 1px 2px rgba(0,0,0,0.4));
551 538  
552 539 @extend %right-col;
... ...