History

Fix merge conflicts

Jasper van Merle committed 8 years ago

Commit bf53a002 parents cdd86a8 e8d52c9124 files · +844 −748Browse files

Unified · Split

124 files
  1. .travis.yml +3 −0
  2. Gemfile +1 −0
  3. Gemfile.lock +30 −26
  4. README.md +4 −8
  5. assets/javascripts/app/app.coffee +1 −6
  6. assets/javascripts/lib/page.coffee +1 −1
  7. assets/javascripts/news.json +3 −0
  8. assets/javascripts/templates/error_tmpl.coffee +4 −7
  9. assets/javascripts/templates/pages/about_tmpl.coffee +10 −0
  10. assets/javascripts/templates/pages/root_tmpl.coffee.erb +0 −11
  11. assets/javascripts/views/content/root_page.coffee +0 −4
  12. assets/javascripts/views/content/settings_page.coffee +3 −4
  13. assets/stylesheets/application-dark.css.scss +0 −107
  14. assets/stylesheets/application.css.scss +3 −1
  15. assets/stylesheets/components/_app.scss +5 −5
  16. assets/stylesheets/components/_content.scss +27 −32
  17. assets/stylesheets/components/_fail.scss +2 −2
  18. assets/stylesheets/components/_header.scss +25 −35
  19. assets/stylesheets/components/_mobile.scss +2 −2
  20. assets/stylesheets/components/_notice.scss +5 −5
  21. assets/stylesheets/components/_notif.scss +12 −12
  22. assets/stylesheets/components/_page.scss +4 −4
  23. assets/stylesheets/components/_path.scss +6 −6
  24. assets/stylesheets/components/_prism.scss +25 −32
  25. assets/stylesheets/components/_settings.scss +12 −12
  26. assets/stylesheets/components/_sidebar.scss +37 −39
  27. assets/stylesheets/global/_base.scss +37 −31
  28. assets/stylesheets/global/_classes.scss +24 −25
  29. assets/stylesheets/global/_icons.scss.erb +2 −2
  30. assets/stylesheets/global/_mixins.scss +6 −0
  31. assets/stylesheets/global/_print.scss +2 −2
  32. assets/stylesheets/global/_variables-dark.scss +53 −69
  33. assets/stylesheets/global/_variables-light.scss +76 −0
  34. assets/stylesheets/global/_variables.scss +25 −82
  35. assets/stylesheets/pages/_angularjs.scss +1 −1
  36. assets/stylesheets/pages/_async.scss +2 −2
  37. assets/stylesheets/pages/_bash.scss +1 −1
  38. assets/stylesheets/pages/_bootstrap.scss +1 −1
  39. assets/stylesheets/pages/_c.scss +2 −2
  40. assets/stylesheets/pages/_clojure.scss +1 −1
  41. assets/stylesheets/pages/_d.scss +3 −3
  42. assets/stylesheets/pages/_dart.scss +1 −1
  43. assets/stylesheets/pages/_dojo.scss +1 −1
  44. assets/stylesheets/pages/_ember.scss +2 −2
  45. assets/stylesheets/pages/_erlang.scss +1 −1
  46. assets/stylesheets/pages/_jquery.scss +2 −2
  47. assets/stylesheets/pages/_love.scss +2 −2
  48. assets/stylesheets/pages/_mdn.scss +3 −3
  49. assets/stylesheets/pages/_meteor.scss +2 −2
  50. assets/stylesheets/pages/_npm.scss +1 −1
  51. assets/stylesheets/pages/_phalcon.scss +1 −1
  52. assets/stylesheets/pages/_php.scss +2 −2
  53. assets/stylesheets/pages/_postgres.scss +1 −1
  54. assets/stylesheets/pages/_qt.scss +1 −1
  55. assets/stylesheets/pages/_rdoc.scss +4 −4
  56. assets/stylesheets/pages/_react_native.scss +1 −1
  57. assets/stylesheets/pages/_redis.scss +2 −2
  58. assets/stylesheets/pages/_rfc.scss +1 −1
  59. assets/stylesheets/pages/_rust.scss +10 −1
  60. assets/stylesheets/pages/_simple.scss +1 −31
  61. assets/stylesheets/pages/_sphinx.scss +2 −2
  62. assets/stylesheets/pages/_sphinx_simple.scss +1 −1
  63. assets/stylesheets/pages/_support_tables.scss +1 −1
  64. assets/stylesheets/pages/_yard.scss +1 −1
  65. assets/stylesheets/pages/_yii.scss +1 −1
  66. lib/app.rb +2 −16
  67. lib/docs/filters/elixir/clean_html.rb +1 −0
  68. lib/docs/filters/express/clean_html.rb +5 −0
  69. lib/docs/filters/handlebars/clean_html.rb +44 −0
  70. lib/docs/filters/handlebars/entries.rb +19 −0
  71. lib/docs/filters/puppeteer/clean_html.rb +24 −0
  72. lib/docs/filters/puppeteer/entries.rb +41 −0
  73. lib/docs/filters/python/clean_html.rb +5 −3
  74. lib/docs/filters/python/entries_v3.rb +12 −10
  75. lib/docs/filters/rust/clean_html.rb +32 −4
  76. lib/docs/filters/rust/entries.rb +8 −5
  77. lib/docs/scrapers/apache_pig.rb +1 −1
  78. lib/docs/scrapers/bower.rb +1 −1
  79. lib/docs/scrapers/chai.rb +1 −1
  80. lib/docs/scrapers/codeceptjs.rb +1 −1
  81. lib/docs/scrapers/docker.rb +1 −1
  82. lib/docs/scrapers/electron.rb +1 −1
  83. lib/docs/scrapers/elixir.rb +1 −1
  84. lib/docs/scrapers/express.rb +1 −1
  85. lib/docs/scrapers/fish.rb +1 −1
  86. lib/docs/scrapers/flow.rb +1 −1
  87. lib/docs/scrapers/gnu.rb +1 −1
  88. lib/docs/scrapers/grunt.rb +1 −1
  89. lib/docs/scrapers/handlebars.rb +23 −0
  90. lib/docs/scrapers/haxe.rb +1 −1
  91. lib/docs/scrapers/immutable.rb +1 −1
  92. lib/docs/scrapers/influxdata.rb +1 −1
  93. lib/docs/scrapers/jasmine.rb +1 −1
  94. lib/docs/scrapers/jest.rb +1 −1
  95. lib/docs/scrapers/laravel.rb +13 −0
  96. lib/docs/scrapers/less.rb +1 −1
  97. lib/docs/scrapers/lodash.rb +1 −1
  98. lib/docs/scrapers/marionette.rb +1 −1
  99. lib/docs/scrapers/markdown.rb +1 −1
  100. lib/docs/scrapers/mocha.rb +1 −1
  101. lib/docs/scrapers/mongoose.rb +1 −1
  102. lib/docs/scrapers/nim.rb +1 −1
  103. lib/docs/scrapers/puppeteer.rb +18 −0
  104. lib/docs/scrapers/redux.rb +1 −1
  105. lib/docs/scrapers/requirejs.rb +1 −1
  106. lib/docs/scrapers/rust.rb +1 −1
  107. lib/docs/scrapers/typescript.rb +1 −1
  108. lib/docs/scrapers/vagrant.rb +1 −1
  109. lib/docs/scrapers/vulkan.rb +1 −1
  110. lib/docs/scrapers/yarn.rb +1 −1
  111. lib/tasks/docs.thor +6 −2
  112. lib/tasks/sprites.thor +1 −1
  113. public/icons/docs/handlebars/16.png +0 −0
  114. public/icons/docs/handlebars/16@2x.png +0 −0
  115. public/icons/docs/handlebars/SOURCE +1 −0
  116. public/icons/docs/puppeteer/16.png +0 −0
  117. public/icons/docs/puppeteer/16@2x.png +0 −0
  118. public/icons/docs/puppeteer/SOURCE +1 −0
  119. public/images/webapp-icon-512.png +0 −0
  120. public/manifest.json +5 −0
  121. test/app_test.rb +43 −21
  122. views/index.erb +2 −2
  123. views/other.erb +2 −2
  124. views/unsupported.erb +4 −7
.travis.yml+3−0
@@ -1,4 +1,7 @@
1language: ruby1language: ruby
2
3cache: bundler
4
2before_script:5before_script:
3 - gem update --system6 - gem update --system
4 - gem install bundler7 - gem install bundler
Gemfile+1−0
@@ -11,6 +11,7 @@ group :app do · 10 unmodified lines
11 gem 'rack'11 gem 'rack'
12 gem 'sinatra'12 gem 'sinatra'
13 gem 'sinatra-contrib'13 gem 'sinatra-contrib'
14 gem 'rack-ssl-enforcer'
14 gem 'thin'15 gem 'thin'
15 gem 'sprockets'16 gem 'sprockets'
16 gem 'sprockets-helpers'17 gem 'sprockets-helpers'
Gemfile.lock+30−26
@@ -1,13 +1,13 @@
1GEM1GEM
2 remote: https://rubygems.org/2 remote: https://rubygems.org/
3 specs:3 specs:
4 activesupport (5.2.0)4 activesupport (5.2.1)
5 concurrent-ruby (~> 1.0, >= 1.0.2)5 concurrent-ruby (~> 1.0, >= 1.0.2)
6 i18n (>= 0.7, < 2)6 i18n (>= 0.7, < 2)
7 minitest (~> 5.1)7 minitest (~> 5.1)
8 tzinfo (~> 1.1)8 tzinfo (~> 1.1)
9 backports (3.11.3)9 backports (3.11.4)
10 better_errors (2.4.0)10 better_errors (2.5.0)
11 coderay (>= 1.0.0)11 coderay (>= 1.0.0)
12 erubi (>= 1.0.0)12 erubi (>= 1.0.0)
13 rack (>= 0.9.0)13 rack (>= 0.9.0)
@@ -28,42 +28,43 @@ GEM · 14 unmodified lines
28 exifr (1.3.4)28 exifr (1.3.4)
29 ffi (1.9.25)29 ffi (1.9.25)
30 fspath (3.1.0)30 fspath (3.1.0)
31 highline (1.7.10)31 highline (2.0.0)
32 html-pipeline (2.8.4)32 html-pipeline (2.8.4)
33 activesupport (>= 2)33 activesupport (>= 2)
34 nokogiri (>= 1.4)34 nokogiri (>= 1.4)
35 i18n (1.0.1)35 i18n (1.1.1)
36 concurrent-ruby (~> 1.0)36 concurrent-ruby (~> 1.0)
37 image_optim (0.26.1)37 image_optim (0.26.3)
38 exifr (~> 1.2, >= 1.2.2)38 exifr (~> 1.2, >= 1.2.2)
39 fspath (~> 3.0)39 fspath (~> 3.0)
40 image_size (~> 1.5)40 image_size (>= 1.5, < 3)
41 in_threads (~> 1.3)41 in_threads (~> 1.3)
42 progress (~> 3.0, >= 3.0.1)42 progress (~> 3.0, >= 3.0.1)
43 image_optim_pack (0.5.1)43 image_optim_pack (0.5.1)
44 fspath (>= 2.1, < 4)44 fspath (>= 2.1, < 4)
45 image_optim (~> 0.19)45 image_optim (~> 0.19)
46 image_size (1.5.0)46 image_size (2.0.0)
47 in_threads (1.5.0)47 in_threads (1.5.0)
48 method_source (0.9.0)48 method_source (0.9.0)
49 mini_portile2 (2.3.0)49 mini_portile2 (2.3.0)
50 minitest (5.11.3)50 minitest (5.11.3)
51 multi_json (1.13.1)51 multi_json (1.13.1)
52 mustermann (1.0.2)52 mustermann (1.0.3)
53 newrelic_rpm (5.2.0.345)53 newrelic_rpm (5.4.0.347)
54 nokogiri (1.8.4)54 nokogiri (1.8.5)
55 mini_portile2 (~> 2.3.0)55 mini_portile2 (~> 2.3.0)
56 options (2.3.2)56 options (2.3.2)
57 progress (3.4.0)57 progress (3.5.0)
58 progress_bar (1.2.0)58 progress_bar (1.3.0)
59 highline (~> 1.6)59 highline (>= 1.6, < 3)
60 options (~> 2.3.0)60 options (~> 2.3.0)
61 pry (0.11.3)61 pry (0.11.3)
62 coderay (~> 1.1.0)62 coderay (~> 1.1.0)
63 method_source (~> 0.9.0)63 method_source (~> 0.9.0)
64 rack (2.0.5)64 rack (2.0.5)
65 rack-protection (2.0.3)65 rack-protection (2.0.4)
66 rack66 rack
67 rack-ssl-enforcer (0.2.9)
67 rack-test (1.1.0)68 rack-test (1.1.0)
68 rack (>= 1.0, < 3)69 rack (>= 1.0, < 3)
69 rake (12.3.1)70 rake (12.3.1)
@@ -71,23 +72,23 @@ GEM · 1 unmodified line
71 rb-inotify (0.9.10)72 rb-inotify (0.9.10)
72 ffi (>= 0.5.0, < 2)73 ffi (>= 0.5.0, < 2)
73 rr (1.2.1)74 rr (1.2.1)
74 sass (3.5.7)75 sass (3.6.0)
75 sass-listen (~> 4.0.0)76 sass-listen (~> 4.0.0)
76 sass-listen (4.0.0)77 sass-listen (4.0.0)
77 rb-fsevent (~> 0.9, >= 0.9.4)78 rb-fsevent (~> 0.9, >= 0.9.4)
78 rb-inotify (~> 0.9, >= 0.9.7)79 rb-inotify (~> 0.9, >= 0.9.7)
79 sinatra (2.0.3)80 sinatra (2.0.4)
80 mustermann (~> 1.0)81 mustermann (~> 1.0)
81 rack (~> 2.0)82 rack (~> 2.0)
82 rack-protection (= 2.0.3)83 rack-protection (= 2.0.4)
83 tilt (~> 2.0)84 tilt (~> 2.0)
84 sinatra-contrib (2.0.3)85 sinatra-contrib (2.0.4)
85 activesupport (>= 4.0.0)86 activesupport (>= 4.0.0)
86 backports (>= 2.8.2)87 backports (>= 2.8.2)
87 multi_json88 multi_json
88 mustermann (~> 1.0)89 mustermann (~> 1.0)
89 rack-protection (= 2.0.3)90 rack-protection (= 2.0.4)
90 sinatra (= 2.0.3)91 sinatra (= 2.0.4)
91 tilt (>= 1.3, < 3)92 tilt (>= 1.3, < 3)
92 sprockets (3.7.2)93 sprockets (3.7.2)
93 concurrent-ruby (~> 1.0)94 concurrent-ruby (~> 1.0)
@@ -96,9 +97,11 @@ GEM · 2 unmodified lines
96 sprockets (>= 2.2)97 sprockets (>= 2.2)
97 sprockets-sass (2.0.0.beta2)98 sprockets-sass (2.0.0.beta2)
98 sprockets (>= 2.0, < 4.0)99 sprockets (>= 2.0, < 4.0)
99 strings (0.1.1)100 strings (0.1.4)
100 unicode-display_width (~> 1.3.0)101 strings-ansi (~> 0.1.0)
102 unicode-display_width (~> 1.4.0)
101 unicode_utils (~> 1.4.0)103 unicode_utils (~> 1.4.0)
104 strings-ansi (0.1.0)
102 thin (1.7.2)105 thin (1.7.2)
103 daemons (~> 1.0, >= 1.0.9)106 daemons (~> 1.0, >= 1.0.9)
104 eventmachine (~> 1.0, >= 1.0.4)107 eventmachine (~> 1.0, >= 1.0.4)
@@ -116,9 +119,9 @@ GEM · 11 unmodified lines
116 ethon (>= 0.9.0)119 ethon (>= 0.9.0)
117 tzinfo (1.2.5)120 tzinfo (1.2.5)
118 thread_safe (~> 0.1)121 thread_safe (~> 0.1)
119 uglifier (4.1.17)122 uglifier (4.1.19)
120 execjs (>= 0.3.0, < 3)123 execjs (>= 0.3.0, < 3)
121 unicode-display_width (1.3.3)124 unicode-display_width (1.4.0)
122 unicode_utils (1.4.0)125 unicode_utils (1.4.0)
123 unix_utils (0.0.15)126 unix_utils (0.0.15)
124 yajl-ruby (1.4.1)127 yajl-ruby (1.4.1)
@@ -142,6 +145,7 @@ DEPENDENCIES · 17 unmodified lines
142 progress_bar145 progress_bar
143 pry (~> 0.11.0)146 pry (~> 0.11.0)
144 rack147 rack
148 rack-ssl-enforcer
145 rack-test149 rack-test
146 rake150 rake
147 rr151 rr
@@ -163,4 +167,4 @@ RUBY VERSION · 15 unmodified lines
163 ruby 2.5.1p57167 ruby 2.5.1p57
164 168
165BUNDLED WITH169BUNDLED WITH
166 1.16.4170 1.16.6
README.md+4−8
@@ -64,14 +64,10 @@ Another driving factor is performance and the fact that everything happens in th · 63 unmodified lines
64 64
65DevDocs being a developer tool, the browser requirements are high:65DevDocs being a developer tool, the browser requirements are high:
66 66
671. On the desktop:67* Recent versions of Firefox, Chrome, or Opera
68 * Recent version of Chrome, Firefox, or Opera68* Safari 9.1+
69 * Safari 8+69* Edge 16+
70 * IE / Edge 10+70* iOS 10+
712. On mobile:
72 * iOS 8+
73 * Android 4.1+
74 * Windows Phone 8+
75 71
76This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun!72This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun!
77 73
assets/javascripts/app/app.coffee+1−6
@@ -245,7 +245,7 @@ · 244 unmodified lines
245 matchMedia: !!window.matchMedia245 matchMedia: !!window.matchMedia
246 insertAdjacentHTML: !!document.body.insertAdjacentHTML246 insertAdjacentHTML: !!document.body.insertAdjacentHTML
247 defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false247 defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false
248 cssGradients: supportsCssGradients()248 cssVariables: CSS.supports and CSS.supports('(--t: 0)')
249 249
250 for key, value of features when not value250 for key, value of features when not value
251 Raven.captureMessage "unsupported/#{key}", level: 'info'251 Raven.captureMessage "unsupported/#{key}", level: 'info'
@@ -268,9 +268,4 @@ · 16 unmodified lines
268 isInvalidLocation: ->268 isInvalidLocation: ->
269 @config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0269 @config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0
270 270
271supportsCssGradients = ->
272 el = document.createElement('div')
273 el.style.cssText = "background-image: -webkit-linear-gradient(top, #000, #fff); background-image: linear-gradient(to top, #000, #fff);"
274 el.style.backgroundImage.indexOf('gradient') >= 0
275
276$.extend app, Events271$.extend app, Events
assets/javascripts/lib/page.coffee+1−1
@@ -190,7 +190,7 @@ isSameOrigin = (url) -> · 189 unmodified lines
190 190
191updateCanonicalLink = ->191updateCanonicalLink = ->
192 @canonicalLink ||= document.head.querySelector('link[rel="canonical"]')192 @canonicalLink ||= document.head.querySelector('link[rel="canonical"]')
193 @canonicalLink.setAttribute('href', "http://#{location.host}#{location.pathname}")193 @canonicalLink.setAttribute('href', "https://#{location.host}#{location.pathname}")
194 194
195trackers = []195trackers = []
196 196
assets/javascripts/news.json+3−0
@@ -1,5 +1,8 @@
1[1[
2 [2 [
3 "2018-09-23",
4 "New documentations: <a href=\"/puppeteer/\">Puppeteer</a> and <a href=\"/handlebars/\">Handlebars.js</a>"
5 ], [
3 "2018-08-12",6 "2018-08-12",
4 "New documentations: <a href=\"/dart/\">Dart</a> and <a href=\"/qt/\">Qt</a>"7 "New documentations: <a href=\"/dart/\">Dart</a> and <a href=\"/qt/\">Qt</a>"
5 ], [8 ], [
assets/javascripts/templates/error_tmpl.coffee+4−7
@@ -56,13 +56,10 @@ app.templates.unsupportedBrowser = """ · 55 unmodified lines
56 <h1 class="_fail-title">Your browser is unsupported, sorry.</h1>56 <h1 class="_fail-title">Your browser is unsupported, sorry.</h1>
57 <p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers:57 <p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers:
58 <ul class="_fail-list">58 <ul class="_fail-list">
59 <li>Recent versions of Chrome and Firefox59 <li>Recent versions of Firefox, Chrome, or Opera
60 <li>Safari 5.1+60 <li>Safari 9.1+
61 <li>Opera 12.1+61 <li>Edge 16+
62 <li>Internet Explorer 10+62 <li>iOS 10+
63 <li>iOS 6+
64 <li>Android 4.1+
65 <li>Windows Phone 8+
66 </ul>63 </ul>
67 <p class="_fail-text">64 <p class="_fail-text">
68 If you're unable to upgrade, I apologize.65 If you're unable to upgrade, I apologize.
assets/javascripts/templates/pages/about_tmpl.coffee+10−0
@@ -310,6 +310,11 @@ credits = [ · 309 unmodified lines
310 'GruntJS Team',310 'GruntJS Team',
311 'MIT',311 'MIT',
312 'https://github.com/gruntjs/grunt-docs/blob/master/package.json#L10'312 'https://github.com/gruntjs/grunt-docs/blob/master/package.json#L10'
313 ], [
314 'Handlebars',
315 '2011-2017 Yehuda Katz',
316 'MIT',
317 'https://raw.githubusercontent.com/wycats/handlebars.js/master/LICENSE'
313 ], [318 ], [
314 'Haskell',319 'Haskell',
315 'The University of Glasgow',320 'The University of Glasgow',
@@ -560,6 +565,11 @@ credits = [ · 244 unmodified lines
560 '1996-2018 The PostgreSQL Global Development Group<br>&copy; 1994 The Regents of the University of California',565 '1996-2018 The PostgreSQL Global Development Group<br>&copy; 1994 The Regents of the University of California',
561 'PostgreSQL',566 'PostgreSQL',
562 'https://www.postgresql.org/about/licence/'567 'https://www.postgresql.org/about/licence/'
568 ], [
569 'Puppeteer',
570 '2017 Google Inc',
571 'Apache',
572 'https://raw.githubusercontent.com/GoogleChrome/puppeteer/master/LICENSE'
563 ], [573 ], [
564 'Pygame',574 'Pygame',
565 'Pygame Developpers',575 'Pygame Developpers',
assets/javascripts/templates/pages/root_tmpl.coffee.erb+0−11
@@ -72,14 +72,3 @@ app.templates.androidWarning = """ · 71 unmodified lines
72 <p>To install DevDocs on your phone, visit <a href="https://devdocs.io" target="_blank" rel="noopener">devdocs.io</a> in Chrome and select "Add to home screen" in the menu.72 <p>To install DevDocs on your phone, visit <a href="https://devdocs.io" target="_blank" rel="noopener">devdocs.io</a> in Chrome and select "Add to home screen" in the menu.
73 </div>73 </div>
74"""74"""
75
76app.templates.httpWarning = """
77 <div class="_intro"><div class="_intro-message">
78 <h2 class="_intro-title">Hi there!</h2>
79 <p>DevDocs is migrating to HTTPS.
80 <p>Please update your bookmarks to point to <a href="https://devdocs.io">https://devdocs.io</a>.
81 <p>When using the HTTPS version, your preferences will carry over automatically, but your offline data will be reset. Simply re-download documentation in the <a href="https://devdocs.io/offline">Offline area</a>, and you'll be all set to use DevDocs securely offline.
82 <p>Sorry for the inconvenience. This migration is needed because browsers are removing support for certain DOM APIs that power DevDocs's offline mode over non-secure origins.
83 <p>Thanks for using DevDocs, and happy coding!
84 </div></div>
85"""
assets/javascripts/views/content/root_page.coffee+0−4
@@ -19,10 +19,6 @@ class app.views.RootPage extends app.View · 18 unmodified lines
19 else19 else
20 'intro'20 'intro'
21 21
22 # temporary
23 if location.host is 'devdocs.io' and location.protocol is 'http:'
24 tmpl = 'httpWarning'
25
26 @append @tmpl(tmpl)22 @append @tmpl(tmpl)
27 return23 return
28 24
assets/javascripts/views/content/settings_page.coffee+3−4
@@ -24,10 +24,9 @@ class app.views.SettingsPage extends app.View · 23 unmodified lines
24 'Preferences'24 'Preferences'
25 25
26 toggleDark: (enable) ->26 toggleDark: (enable) ->
27 css = $('link[rel="stylesheet"][data-alt]')27 html = document.documentElement
28 alt = css.getAttribute('data-alt')28 html.classList.toggle('_theme-default')
29 css.setAttribute('data-alt', css.getAttribute('href'))29 html.classList.toggle('_theme-dark')
30 css.setAttribute('href', alt)
31 app.settings.set('dark', !!enable)30 app.settings.set('dark', !!enable)
32 app.appCache?.updateInBackground()31 app.appCache?.updateInBackground()
33 return32 return
assets/stylesheets/application-dark.css.scss+0−107
@@ -1,107 +0,0 @@
1//= depend_on sprites/docs.png
2//= depend_on sprites/docs@2x.png
3//= depend_on sprites/docs.json
4
5/*!
6 * Copyright 2013-2018 Thibaut Courouble and other contributors
7 *
8 * This source code is licensed under the terms of the Mozilla
9 * Public License, v. 2.0, a copy of which may be obtained at:
10 * http://mozilla.org/MPL/2.0/
11 */
12
13@import 'global/variables-dark',
14 'global/mixins',
15 'global/icons',
16 'global/classes',
17 'global/base';
18
19@import 'components/app',
20 'components/header',
21 'components/notif',
22 'components/sidebar',
23 'components/settings',
24 'components/content',
25 'components/page',
26 'components/fail',
27 'components/path',
28 'components/notice',
29 'components/prism',
30 'components/mobile';
31
32@import 'pages/simple',
33 'pages/angular',
34 'pages/angularjs',
35 'pages/apache',
36 'pages/async',
37 'pages/bash',
38 'pages/bootstrap',
39 'pages/c',
40 'pages/cakephp',
41 'pages/clojure',
42 'pages/codeception',
43 'pages/coffeescript',
44 'pages/cordova',
45 'pages/crystal',
46 'pages/d',
47 'pages/d3',
48 'pages/dart',
49 'pages/dojo',
50 'pages/drupal',
51 'pages/elixir',
52 'pages/ember',
53 'pages/erlang',
54 'pages/express',
55 'pages/git',
56 'pages/github',
57 'pages/go',
58 'pages/graphite',
59 'pages/haskell',
60 'pages/jekyll',
61 'pages/jquery',
62 'pages/julia',
63 'pages/knockout',
64 'pages/kotlin',
65 'pages/laravel',
66 'pages/liquid',
67 'pages/love',
68 'pages/lua',
69 'pages/mdn',
70 'pages/meteor',
71 'pages/modernizr',
72 'pages/moment',
73 'pages/nginx',
74 'pages/node',
75 'pages/npm',
76 'pages/openjdk',
77 'pages/perl',
78 'pages/phalcon',
79 'pages/phaser',
80 'pages/php',
81 'pages/phpunit',
82 'pages/postgres',
83 'pages/pug',
84 'pages/python',
85 'pages/qt',
86 'pages/ramda',
87 'pages/rdoc',
88 'pages/react_native',
89 'pages/redis',
90 'pages/rethinkdb',
91 'pages/rfc',
92 'pages/rubydoc',
93 'pages/rust',
94 'pages/sinon',
95 'pages/socketio',
96 'pages/sphinx',
97 'pages/sphinx_simple',
98 'pages/sqlite',
99 'pages/support_tables',
100 'pages/tcl_tk',
101 'pages/tensorflow',
102 'pages/terraform',
103 'pages/underscore',
104 'pages/vue',
105 'pages/webpack',
106 'pages/yard',
107 'pages/yii';
assets/stylesheets/application.css.scss+3−1
@@ -10,7 +10,9 @@ · 9 unmodified lines
10 * http://mozilla.org/MPL/2.0/10 * http://mozilla.org/MPL/2.0/
11 */11 */
12 12
13@import 'global/variables',13@import 'global/variables-light',
14 'global/variables-dark',
15 'global/variables',
14 'global/mixins',16 'global/mixins',
15 'global/icons',17 'global/icons',
16 'global/classes',18 'global/classes',
assets/stylesheets/components/_app.scss+5−5
@@ -1,6 +1,6 @@
1html._booting { background: $contentBackground; }1html._booting { background: var(--contentBackground); }
2body._max-width { background: none; }2body._max-width { background: none; }
3html._booting body._max-width { background: $documentBackground; }3html._booting body._max-width { background: var(--documentBackground); }
4 4
5._app {5._app {
6 position: relative;6 position: relative;
@@ -15,8 +15,8 @@ html._booting body._max-width { background: $documentBackground; } · 8 unmodified lines
15 15
16 ._max-width & {16 ._max-width & {
17 margin: 0 auto;17 margin: 0 auto;
18 max-width: $maxWidth;18 max-width: var(--maxWidth);
19 background: $contentBackground;19 background: var(--contentBackground);
20 box-shadow: 1px 0 $headerBorder, -1px 0 $headerBorder;20 box-shadow: 1px 0 var(--headerBorder), -1px 0 var(--headerBorder);
21 }21 }
22}22}
assets/stylesheets/components/_content.scss+27−32
@@ -4,13 +4,13 @@ · 3 unmodified lines
4 4
5._container {5._container {
6 position: relative;6 position: relative;
7 z-index: $contentZ;7 z-index: var(--contentZ);
8 height: 100%;8 height: 100%;
9 margin-left: $sidebarWidth;9 margin-left: var(--sidebarWidth);
10 pointer-events: none;10 pointer-events: none;
11 @extend %border-box;11 @extend %border-box;
12 12
13 @media #{$mediumScreen} { margin-left: $sidebarMediumWidth; }13 @include mobile { margin-left: var(--sidebarMediumWidth); }
14 14
15 ._sidebar-hidden & { margin-left: 0; }15 ._sidebar-hidden & { margin-left: 0; }
16 body:not(._native-scrollbars) & { -webkit-margin-end: -1px; }16 body:not(._native-scrollbars) & { -webkit-margin-end: -1px; }
@@ -30,7 +30,7 @@ · 13 unmodified lines
30 ._sidebar-hidden &:before {30 ._sidebar-hidden &:before {
31 content: '';31 content: '';
32 display: block;32 display: block;
33 margin-top: $headerHeight;33 margin-top: var(--headerHeight);
34 }34 }
35 35
36 ._overlay-scrollbars & { padding-left: .625rem; }36 ._overlay-scrollbars & { padding-left: .625rem; }
@@ -54,7 +54,7 @@ · 17 unmodified lines
54 font-size: 4rem;54 font-size: 4rem;
55 font-weight: 300;55 font-weight: 300;
56 letter-spacing: -.125rem;56 letter-spacing: -.125rem;
57 color: $loadingText;57 color: var(--loadingText);
58 text-align: center;58 text-align: center;
59 cursor: default;59 cursor: default;
60}60}
@@ -68,7 +68,7 @@ · 7 unmodified lines
68//68//
69 69
70._splash-title {70._splash-title {
71 color: $splashText;71 color: var(--splashText);
72 @extend %loading, %user-select-none;72 @extend %loading, %user-select-none;
73}73}
74 74
@@ -88,7 +88,7 @@ · 13 unmodified lines
88 min-height: calc(100vh - 2.375rem);88 min-height: calc(100vh - 2.375rem);
89 89
90 ._sidebar-hidden & {90 ._sidebar-hidden & {
91 min-height: calc(100vh - 2.375rem - #{$headerHeight});91 min-height: calc(100vh - 2.375rem - var(--headerHeight));
92 }92 }
93}93}
94 94
@@ -140,12 +140,12 @@ · 45 unmodified lines
140 140
141._error-text {141._error-text {
142 margin: 0 0 1rem;142 margin: 0 0 1rem;
143 color: $textColorLight;143 color: var(--textColorLight);
144}144}
145 145
146._error-links {146._error-links {
147 font-size: 1rem;147 font-size: 1rem;
148 font-weight: $boldFontWeight;148 font-weight: var(--boldFontWeight);
149}149}
150 150
151._error-link { padding: 0 .5rem; }151._error-link { padding: 0 .5rem; }
@@ -167,7 +167,7 @@ · 15 unmodified lines
167 height: 1px;167 height: 1px;
168 margin-top: .25rem;168 margin-top: .25rem;
169 margin-left: 1rem;169 margin-left: 1rem;
170 background: $boxBorderLight;170 background: var(--boxBorderLight);
171 }171 }
172}172}
173 173
@@ -197,7 +197,7 @@ · 23 unmodified lines
197._toc-title {197._toc-title {
198 margin: 0 0 .5rem;198 margin: 0 0 .5rem;
199 font-size: inherit;199 font-size: inherit;
200 font-weight: $boldFontWeight;200 font-weight: var(--boldFontWeight);
201}201}
202 202
203._toc-list {203._toc-list {
@@ -252,7 +252,7 @@ · 48 unmodified lines
252._docs-size {252._docs-size {
253 text-align: right;253 text-align: right;
254 254
255 > small { color: $textColorLight; }255 > small { color: var(--textColorLight); }
256}256}
257 257
258._docs-tools {258._docs-tools {
@@ -285,7 +285,7 @@ · 26 unmodified lines
285 padding: 0 .75rem;285 padding: 0 .75rem;
286 }286 }
287 ._btn-link:not(._show) { display: none; }287 ._btn-link:not(._show) { display: none; }
288 ._btn-link._show ~ ._btn-link._show { border-left: 1px solid $boxBorder; }288 ._btn-link._show ~ ._btn-link._show { border-left: 1px solid var(--boxBorder); }
289}289}
290 290
291//291//
@@ -297,7 +297,7 @@ · 5 unmodified lines
297 position: relative;297 position: relative;
298 padding-left: 10em;298 padding-left: 10em;
299 font-size: .8125rem;299 font-size: .8125rem;
300 color: $textColorLight;300 color: var(--textColorLight);
301 301
302 + ._news-row { margin-top: 1em; }302 + ._news-row { margin-top: 1em; }
303 }303 }
@@ -305,7 +305,7 @@ · 1 unmodified line
305 ._news-title {305 ._news-title {
306 display: block;306 display: block;
307 font-size: .875rem;307 font-size: .875rem;
308 color: $textColor;308 color: var(--textColor);
309 }309 }
310 310
311 ._news-date {311 ._news-date {
@@ -372,12 +372,12 @@ · 60 unmodified lines
372// Utilities372// Utilities
373//373//
374 374
375._bold { font-weight: $boldFontWeight; }375._bold { font-weight: var(--boldFontWeight); }
376._note { @extend %note; }376._note { @extend %note; }
377._note-green { @extend %note-green; }377._note-green { @extend %note-green; }
378._label { @extend %label; }378._label { @extend %label; }
379._code { @extend %code; }379._code { @extend %code; }
380._highlight { background: $highlightBackground !important; }380._highlight { background: var(--highlightBackground) !important; }
381 381
382._table { width: 100%; }382._table { width: 100%; }
383._mobile ._table { overflow-x: auto; }383._mobile ._table { overflow-x: auto; }
@@ -396,12 +396,9 @@ · 12 unmodified lines
396 pre:hover > & { display: block; }396 pre:hover > & { display: block; }
397 &:hover { opacity: 1; }397 &:hover { opacity: 1; }
398 398
399 > svg { @extend %svg-icon; }399 > svg {
400 400 @extend %svg-icon;
401 @if $style == 'dark' {401 fill: var(--absolute);
402 > svg { fill: white; }
403 } @else {
404 > svg { fill: black; }
405 }402 }
406 403
407 &._pre-clip-success > svg,404 &._pre-clip-success > svg,
@@ -419,15 +416,13 @@ · 11 unmodified lines
419 line-height: normal;416 line-height: normal;
420 white-space: nowrap;417 white-space: nowrap;
421 padding: .375rem .675rem;418 padding: .375rem .675rem;
422 background-image: linear-gradient(lighten($boxBackground, 4%), darken($boxBackground, 2%));419 background-color: var(--boxBackground);
423 border: 1px solid $boxBorder;420 border: 1px solid var(--boxBorder);
424 border-radius: 3px;421 border-radius: 3px;
425 box-shadow: 0 1px rgba($boxBorder, .08);
426 cursor: pointer;422 cursor: pointer;
427 423
428 &:active {424 &:active {
429 background-color: $boxBackground;425 box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px var(--boxBorder);
430 box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px $boxBorder;
431 }426 }
432}427}
433 428
@@ -447,18 +442,18 @@ · 13 unmodified lines
447 442
448._btn-link {443._btn-link {
449 line-height: inherit;444 line-height: inherit;
450 color: $linkColor;445 color: var(--linkColor);
451 text-decoration: $linkTextDecoration;446 text-decoration: var(--linkTextDecoration);
452 447
453 &:hover {448 &:hover {
454 color: $linkColorHover;449 color: var(--linkColorHover);
455 text-decoration: underline;450 text-decoration: underline;
456 }451 }
457}452}
458 453
459._reset-btn,454._reset-btn,
460._reset-btn:hover {455._reset-btn:hover {
461 color: $textColorRed;456 color: var(--textColorRed);
462}457}
463 458
464._github-btn {459._github-btn {
assets/stylesheets/components/_fail.scss+2−2
@@ -1,4 +1,4 @@
1._fail {1._fail { // Don't use CSS variables, in case the browser doesn't support them.
2 display: block;2 display: block;
3 position: relative;3 position: relative;
4 top: 1.5rem;4 top: 1.5rem;
@@ -23,7 +23,7 @@ · 18 unmodified lines
23._fail-title {23._fail-title {
24 margin: 0 0 1rem;24 margin: 0 0 1rem;
25 font-size: 1rem;25 font-size: 1rem;
26 font-weight: $boldFontWeight;26 font-weight: bold;
27}27}
28 28
29._fail-text, ._fail-list {29._fail-text, ._fail-list {
assets/stylesheets/components/_header.scss+25−35
@@ -4,20 +4,20 @@ · 3 unmodified lines
4 4
5._header {5._header {
6 position: absolute;6 position: absolute;
7 z-index: $headerZ;7 z-index: var(--headerZ);
8 top: 0;8 top: 0;
9 left: 0;9 left: 0;
10 display: -ms-flexbox;10 display: -ms-flexbox;
11 display: flex;11 display: flex;
12 width: $sidebarWidth;12 width: var(--sidebarWidth);
13 height: $headerHeight;13 height: var(--headerHeight);
14 background: $headerBackground;14 background: var(--headerBackground);
15 border-bottom: 1px solid $headerBorder;15 border-bottom: 1px solid var(--headerBorder);
16 border-right: 1px solid $headerBorder;16 border-right: 1px solid var(--headerBorder);
17 @extend %border-box;17 @extend %border-box;
18 @extend %user-select-none;18 @extend %user-select-none;
19 19
20 @media #{$mediumScreen} { width: $sidebarMediumWidth; }20 @include mobile { width: var(--sidebarMediumWidth); }
21}21}
22 22
23._header-left {23._header-left {
@@ -35,7 +35,7 @@ · 11 unmodified lines
35 flex: 0 0 auto;35 flex: 0 0 auto;
36 width: 2.25rem;36 width: 2.25rem;
37 height: 100%;37 height: 100%;
38 color: $textColorLight;38 color: var(--textColorLight);
39 text-align: center;39 text-align: center;
40 40
41 &[hidden] { display: none; }41 &[hidden] { display: none; }
@@ -67,8 +67,8 @@ · 25 unmodified lines
67 word-wrap: normal;67 word-wrap: normal;
68 overflow-wrap: normal;68 overflow-wrap: normal;
69 font-size: .875rem;69 font-size: .875rem;
70 background: $contentBackground;70 background: var(--contentBackground);
71 border: 1px solid $headerBorder;71 border: 1px solid var(--headerBorder);
72 border-radius: 3px;72 border-radius: 3px;
73 box-shadow: -1px 1px 1px rgba(black, .05);73 box-shadow: -1px 1px 1px rgba(black, .05);
74 transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms;74 transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms;
@@ -98,10 +98,10 @@ · 23 unmodified lines
98 margin: 0;98 margin: 0;
99 line-height: 1.5rem;99 line-height: 1.5rem;
100 font-size: 1rem;100 font-size: 1rem;
101 font-weight: $boldFontWeight;101 font-weight: var(--boldFontWeight);
102 letter-spacing: -.5px;102 letter-spacing: -.5px;
103 background: $sidebarBackground;103 background: var(--sidebarBackground);
104 border-bottom: 1px solid $sidebarBorder;104 border-bottom: 1px solid var(--sidebarBorder);
105 border-radius: 2px 2px 0 0;105 border-radius: 2px 2px 0 0;
106}106}
107 107
@@ -109,7 +109,7 @@ · 1 unmodified line
109._menu-title-link:hover {109._menu-title-link:hover {
110 display: block;110 display: block;
111 padding: .5rem 1rem;111 padding: .5rem 1rem;
112 color: $focusText;112 color: var(--focusText);
113 text-decoration: none;113 text-decoration: none;
114}114}
115 115
@@ -121,9 +121,9 @@ · 5 unmodified lines
121 text-decoration: none;121 text-decoration: none;
122 122
123 &:hover {123 &:hover {
124 color: $focusText;124 color: var(--focusText);
125 text-decoration: none;125 text-decoration: none;
126 background: $sidebarBackground;126 background: var(--sidebarBackground);
127 }127 }
128 128
129 &:last-child { border-radius: 0 0 2px 2px; }129 &:last-child { border-radius: 0 0 2px 2px; }
@@ -151,11 +151,7 @@ · 21 unmodified lines
151 opacity: .42;151 opacity: .42;
152 @extend %svg-icon;152 @extend %svg-icon;
153 153
154 @if $style == 'dark' {154 fill: var(--absolute);
155 fill: white;
156 } @else {
157 fill: black;
158 }
159 }155 }
160}156}
161 157
@@ -166,21 +162,19 @@ · 4 unmodified lines
166 height: 100%;162 height: 100%;
167 padding: 0 .75rem 1px 1.75rem;163 padding: 0 .75rem 1px 1.75rem;
168 font-size: .875rem;164 font-size: .875rem;
169 background: $contentBackground;165 background: var(--contentBackground);
170 border: 1px solid;166 border: 1px solid;
171 border-color: darken($headerBorder, 2%);167 border-color: var(--searchBorder);
172 border-radius: 3px;168 border-radius: 3px;
173 169
174 &:focus {170 &:focus {
175 outline: 0;171 outline: 0;
176 @if $inputFocusBorder {172 border-color: var(--inputFocusBorder);
177 border-color: $inputFocusBorder;173 box-shadow: 0 0 1px var(--inputFocusBorder);
178 box-shadow: 0 0 1px $inputFocusBorder;
179 }
180 }174 }
181 175
182 &[disabled] {176 &[disabled] {
183 background: $sidebarBackground;177 background: var(--sidebarBackground);
184 cursor: not-allowed;178 cursor: not-allowed;
185 }179 }
186}180}
@@ -202,13 +196,9 @@ · 15 unmodified lines
202 top: .5rem;196 top: .5rem;
203 left: .375rem;197 left: .375rem;
204 @extend %svg-icon;198 @extend %svg-icon;
199 fill: var(--absolute);
205 }200 }
206 201
207 @if $style == 'dark' {
208 > svg { fill: white; }
209 } @else {
210 > svg { fill: black; }
211 }
212 ._search-active > & { display: block; }202 ._search-active > & { display: block; }
213}203}
214 204
@@ -222,8 +212,8 @@ · 7 unmodified lines
222 line-height: 1.25rem;212 line-height: 1.25rem;
223 max-width: 50%;213 max-width: 50%;
224 font-size: .8125rem;214 font-size: .8125rem;
225 color: $textColorLight;215 color: var(--textColorLight);
226 background: darken($headerBackground, 5%);216 background: var(--searchTagBackground);
227 border-radius: 2px;217 border-radius: 2px;
228 @extend %truncate-text;218 @extend %truncate-text;
229}219}
assets/stylesheets/components/_mobile.scss+2−2
@@ -4,7 +4,7 @@ · 3 unmodified lines
4 4
5._mobile {5._mobile {
6 font-size: 100%;6 font-size: 100%;
7 background: $contentBackground;7 background: var(--contentBackground);
8 8
9 ._hide-on-mobile { display: none; }9 ._hide-on-mobile { display: none; }
10 10
@@ -18,7 +18,7 @@ · 7 unmodified lines
18 18
19 ._container {19 ._container {
20 margin: 0;20 margin: 0;
21 padding-top: $headerHeight;21 padding-top: var(--headerHeight);
22 }22 }
23 23
24 ._content {24 ._content {
assets/stylesheets/components/_notice.scss+5−5
@@ -1,15 +1,15 @@
1._notice {1._notice {
2 position: absolute;2 position: absolute;
3 z-index: $noticeZ;3 z-index: var(--noticeZ);
4 bottom: 0;4 bottom: 0;
5 left: $sidebarWidth;5 left: var(--sidebarWidth);
6 right: 0;6 right: 0;
7 height: 2.5rem;7 height: 2.5rem;
8 padding: 0 1.25rem;8 padding: 0 1.25rem;
9 background: $noticeBackground;9 background: var(--noticeBackground);
10 box-shadow: inset 0 1px $noticeBorder;10 box-shadow: inset 0 1px var(--noticeBorder);
11 11
12 @media #{$mediumScreen} { left: $sidebarMediumWidth; }12 @include mobile { left: var(--sidebarMediumWidth); }
13 13
14 ._sidebar-hidden & { left: 0; }14 ._sidebar-hidden & { left: 0; }
15 15
assets/stylesheets/components/_notif.scss+12−12
@@ -7,9 +7,9 @@ · 6 unmodified lines
7 max-width: 90%;7 max-width: 90%;
8 padding: .625rem 1rem;8 padding: .625rem 1rem;
9 font-size: .75rem;9 font-size: .75rem;
10 color: $notifColor;10 color: var(--notifColor);
11 background: $notifBackground;11 background: var(--notifBackground);
12 border: $notifBorder;12 border: var(--notifBorder);
13 border-radius: .25rem;13 border-radius: .25rem;
14 transition: opacity .2s;14 transition: opacity .2s;
15 opacity: 0;15 opacity: 0;
@@ -30,7 +30,7 @@ · 14 unmodified lines
30 30
31._notif-info {31._notif-info {
32 float: right;32 float: right;
33 color: $notifColorLight;33 color: var(--notifColorLight);
34}34}
35 35
36._notif-link,36._notif-link,
@@ -69,13 +69,13 @@ · 32 unmodified lines
69 &::-webkit-scrollbar { width: 10px !important; }69 &::-webkit-scrollbar { width: 10px !important; }
70 70
71 &::-webkit-scrollbar-track {71 &::-webkit-scrollbar-track {
72 background: $notifBackground !important;72 background: var(--notifBackground) !important;
73 border: 0 !important;73 border: 0 !important;
74 border-radius: 5px !important;74 border-radius: 5px !important;
75 }75 }
76 76
77 &::-webkit-scrollbar-thumb {77 &::-webkit-scrollbar-thumb {
78 border: 3px solid $notifBackground !important;78 border: 3px solid var(--notifBackground) !important;
79 79
80 &:hover, &:active { border-width: 2px !important; }80 &:hover, &:active { border-width: 2px !important; }
81 }81 }
@@ -90,7 +90,7 @@ · 8 unmodified lines
90 > ._news-row {90 > ._news-row {
91 line-height: 1.125rem;91 line-height: 1.125rem;
92 font-size: .6875rem;92 font-size: .6875rem;
93 color: $notifColorLight;93 color: var(--notifColorLight);
94 margin-bottom: .25rem;94 margin-bottom: .25rem;
95 95
96 + ._news-row { margin-top: .625rem; }96 + ._news-row { margin-top: .625rem; }
@@ -107,7 +107,7 @@ · 10 unmodified lines
107 ._news-date {107 ._news-date {
108 float: right;108 float: right;
109 margin-left: 1rem;109 margin-left: 1rem;
110 font-weight: $boldFontWeight;110 font-weight: var(--boldFontWeight);
111 }111 }
112 112
113 code {113 code {
@@ -128,9 +128,9 @@ · 14 unmodified lines
128}128}
129 129
130._notif-tip {130._notif-tip {
131 color: $textColor;131 color: var(--textColor);
132 background: $tipBackground;132 background: var(--tipBackground);
133 border: $tipBorder;133 border: var(--tipBorder);
134 134
135 ._notif-info { color: $textColorLight; }135 ._notif-info { color: var(--textColorLight); }
136}136}
assets/stylesheets/components/_page.scss+4−4
@@ -23,7 +23,7 @@ · 22 unmodified lines
23 max-width: 100%;23 max-width: 100%;
24 margin-bottom: 1em;24 margin-bottom: 1em;
25 padding: 1px;25 padding: 1px;
26 border: 1px dotted $boxBorder;26 border: 1px dotted var(--boxBorder);
27 border-radius: 3px;27 border-radius: 3px;
28 @extend %border-box;28 @extend %border-box;
29 }29 }
@@ -50,7 +50,7 @@ · 20 unmodified lines
50 display: inline-block;50 display: inline-block;
51 vertical-align: top;51 vertical-align: top;
52 padding: 0 .5rem;52 padding: 0 .5rem;
53 background: $contentBackground;53 background: var(--contentBackground);
54 @extend %internal-link;54 @extend %internal-link;
55 55
56 & + & { margin-left: .75rem; }56 & + & { margin-left: .75rem; }
@@ -66,7 +66,7 @@ · 9 unmodified lines
66 clear: both;66 clear: both;
67 margin: 2rem 0 1.5rem;67 margin: 2rem 0 1.5rem;
68 font-size: .75rem;68 font-size: .75rem;
69 color: $textColorLight;69 color: var(--textColorLight);
70 text-align: center;70 text-align: center;
71 -webkit-font-smoothing: subpixel-antialiased;71 -webkit-font-smoothing: subpixel-antialiased;
72 72
@@ -78,7 +78,7 @@ · 5 unmodified lines
78 display: inline-block;78 display: inline-block;
79 margin: 0;79 margin: 0;
80 padding: .25rem .75rem;80 padding: .25rem .75rem;
81 background: $labelBackground;81 background: var(--labelBackground);
82 border-radius: 3px;82 border-radius: 3px;
83}83}
84 84
assets/stylesheets/components/_path.scss+6−6
@@ -1,17 +1,17 @@
1._path {1._path {
2 position: absolute;2 position: absolute;
3 z-index: $noticeZ - 1;3 z-index: var(--headerZ);
4 bottom: 0;4 bottom: 0;
5 left: $sidebarWidth;5 left: var(--sidebarWidth);
6 right: 0;6 right: 0;
7 height: 2rem;7 height: 2rem;
8 line-height: 2rem;8 line-height: 2rem;
9 padding: 0 .375rem;9 padding: 0 .375rem;
10 font-size: .875rem;10 font-size: .875rem;
11 background: $pathBackground;11 background: var(--pathBackground);
12 box-shadow: inset 0 1px $pathBorder;12 box-shadow: inset 0 1px var(--pathBorder);
13 13
14 @media #{$mediumScreen} { left: $sidebarMediumWidth; }14 @include mobile { left: var(--sidebarMediumWidth); }
15 15
16 ._sidebar-hidden & { left: 0; }16 ._sidebar-hidden & { left: 0; }
17 17
@@ -24,7 +24,7 @@ · 6 unmodified lines
24 display: inline-block;24 display: inline-block;
25 vertical-align: top;25 vertical-align: top;
26 padding: 0 .375rem;26 padding: 0 .375rem;
27 color: $textColor;27 color: var(--textColor);
28 text-decoration: none;28 text-decoration: none;
29 29
30 &:first-child:before {30 &:first-child:before {
assets/stylesheets/components/_prism.scss+25−32
@@ -1,9 +1,26 @@
1html {
2 --prismValue: #905;
3 --prismText: #5e8e01;
4 --prismOperator: #a67f59;
5 --prismKeyword: #0070a3;
6 --prismFunction: #dd4a68;
7 --prismVariable: #e90;
8}
9html._theme-dark {
10 --prismValue: #eb8160;
11 --prismText: #ddcf88;
12 --prismOperator: #b1c676;
13 --prismKeyword: #91b3ed;
14 --prismFunction: #c79e6b;
15 --prismVariable: #e9c062;
16}
17
1.token.comment,18.token.comment,
2.token.prolog,19.token.prolog,
3.token.doctype,20.token.doctype,
4.token.cdata,21.token.cdata,
5.token.punctuation {22.token.punctuation {
6 color: $textColorLight;23 color: var(--textColorLight);
7}24}
8 25
9.namespace {26.namespace {
@@ -17,11 +34,7 @@ · 7 unmodified lines
17.token.constant,34.token.constant,
18.token.symbol,35.token.symbol,
19.token.deleted {36.token.deleted {
20 @if $style == 'dark' {37 color: var(--prismValue);
21 color: #eb8160;
22 } @else {
23 color: #905;
24 }
25}38}
26 39
27.token.selector,40.token.selector,
@@ -30,11 +43,7 @@ · 2 unmodified lines
30.token.char,43.token.char,
31.token.builtin,44.token.builtin,
32.token.inserted {45.token.inserted {
33 @if $style == 'dark' {46 color: var(--prismText);
34 color: #ddcf88;
35 } @else {
36 color: #5e8e01;
37 }
38}47}
39 48
40.token.operator,49.token.operator,
@@ -42,44 +51,28 @@ · 1 unmodified line
42.token.url,51.token.url,
43.language-css .token.string,52.language-css .token.string,
44.style .token.string {53.style .token.string {
45 @if $style == 'dark' {54 color: var(--prismOperator);
46 color: #b1c676;
47 } @else {
48 color: #a67f59;
49 }
50}55}
51 56
52.token.atrule,57.token.atrule,
53.token.attr-value,58.token.attr-value,
54.token.keyword {59.token.keyword {
55 @if $style == 'dark' {60 color: var(--prismKeyword);
56 color: #91b3ed;
57 } @else {
58 color: #0070a3;
59 }
60}61}
61 62
62.token.function {63.token.function {
63 @if $style == 'dark' {64 color: var(--prismFunction);
64 color: #c79e6b;
65 } @else {
66 color: #dd4a68;
67 }
68}65}
69 66
70.token.regex,67.token.regex,
71.token.important,68.token.important,
72.token.variable {69.token.variable {
73 @if $style == 'dark' {70 color: var(--prismVariable);
74 color: #e9c062;
75 } @else {
76 color: #e90;
77 }
78}71}
79 72
80.token.important,73.token.important,
81.token.bold {74.token.bold {
82 font-weight: $boldFontWeight;75 font-weight: var(--boldFontWeight);
83}76}
84 77
85.token.italic {78.token.italic {
assets/stylesheets/components/_settings.scss+12−12
@@ -7,15 +7,15 @@ · 6 unmodified lines
7 position: absolute;7 position: absolute;
8 top: 0;8 top: 0;
9 bottom: 0;9 bottom: 0;
10 z-index: $headerZ;10 z-index: var(--headerZ);
11 11
12 &._in { display: block; }12 &._in { display: block; }
13 13
14 > ._header { justify-content: space-between; }14 > ._header { justify-content: space-between; }
15 15
16 &._dirty > ._header {16 &._dirty > ._header {
17 background: $noteGreenBackground;17 background: var(--noteGreenBackground);
18 border-color: $noteGreenBorder;18 border-color: var(--noteGreenBorder);
19 }19 }
20}20}
21 21
@@ -37,7 +37,7 @@ · 15 unmodified lines
37 padding-right: .5rem;37 padding-right: .5rem;
38 line-height: inherit;38 line-height: inherit;
39 font-size: inherit;39 font-size: inherit;
40 font-weight: $boldFontWeight;40 font-weight: var(--boldFontWeight);
41 text-align: right;41 text-align: right;
42 @extend %border-box;42 @extend %border-box;
43}43}
@@ -52,7 +52,7 @@ · 8 unmodified lines
52 52
53 > small {53 > small {
54 display: block;54 display: block;
55 color: $textColorLight;55 color: var(--textColorLight);
56 margin-left: 1.75rem;56 margin-left: 1.75rem;
57 }57 }
58 58
@@ -62,7 +62,7 @@ · 3 unmodified lines
62 }62 }
63}63}
64 64
65@media (max-width: $maxWidth) {65@media (max-width: 80rem) {
66 ._setting-max-width { display: none; }66 ._setting-max-width { display: none; }
67}67}
68 68
@@ -80,7 +80,7 @@ · 11 unmodified lines
80 line-height: 1.5rem;80 line-height: 1.5rem;
81 padding: 0 .75rem;81 padding: 0 .75rem;
82 font-size: .875rem;82 font-size: .875rem;
83 font-weight: $boldFontWeight;83 font-weight: var(--boldFontWeight);
84 color: inherit;84 color: inherit;
85 text-align: left;85 text-align: left;
86 cursor: pointer;86 cursor: pointer;
@@ -119,12 +119,12 @@ · 32 unmodified lines
119 position: relative;119 position: relative;
120 vertical-align: top;120 vertical-align: top;
121 padding: 0 .75rem;121 padding: 0 .75rem;
122 line-height: $headerHeight;122 line-height: var(--headerHeight);
123 color: $textColorLight;123 color: var(--textColorLight);
124 124
125 &.active {125 &.active {
126 color: $textColor;126 color: var(--textColor);
127 font-weight: $boldFontWeight;127 font-weight: var(--boldFontWeight);
128 box-shadow: inset 0 -2px $linkColor;128 box-shadow: inset 0 -2px var(--linkColor);
129 }129 }
130}130}
assets/stylesheets/components/_sidebar.scss+37−39
@@ -4,14 +4,14 @@ · 3 unmodified lines
4 4
5._sidebar {5._sidebar {
6 position: absolute;6 position: absolute;
7 z-index: $sidebarZ;7 z-index: var(--sidebarZ);
8 top: 0;8 top: 0;
9 bottom: 0;9 bottom: 0;
10 left: 0;10 left: 0;
11 overflow-x: hidden;11 overflow-x: hidden;
12 overflow-y: scroll;12 overflow-y: scroll;
13 padding-top: $headerHeight;13 padding-top: var(--headerHeight);
14 background: $sidebarBackground;14 background: var(--sidebarBackground);
15 background-clip: content-box;15 background-clip: content-box;
16 -webkit-overflow-scrolling: touch;16 -webkit-overflow-scrolling: touch;
17 -ms-overflow-style: none; // IE 10 doesn't support pointer-events17 -ms-overflow-style: none; // IE 10 doesn't support pointer-events
@@ -22,13 +22,13 @@ · 4 unmodified lines
22 22
23 ._overlay-scrollbars & {23 ._overlay-scrollbars & {
24 padding-top: 0;24 padding-top: 0;
25 top: $headerHeight;25 top: var(--headerHeight);
26 }26 }
27 27
28 body:not(._native-scrollbars) & {28 body:not(._native-scrollbars) & {
29 &::-webkit-scrollbar { width: 10px; }29 &::-webkit-scrollbar { width: 10px; }
30 &::-webkit-scrollbar-track {30 &::-webkit-scrollbar-track {
31 background: $contentBackground;31 background: var(--contentBackground);
32 border: 0;32 border: 0;
33 }33 }
34 &::-webkit-scrollbar-thumb {34 &::-webkit-scrollbar-thumb {
@@ -52,10 +52,10 @@ · 17 unmodified lines
52 52
53._resizer {53._resizer {
54 position: absolute;54 position: absolute;
55 z-index: $sidebarZ + 1;55 z-index: var(--headerZ);
56 top: $headerHeight;56 top: var(--headerHeight);
57 bottom: $headerHeight;57 bottom: var(--headerHeight);
58 left: $sidebarWidth;58 left: var(--sidebarWidth);
59 margin-left: -2px;59 margin-left: -2px;
60 width: 3px;60 width: 3px;
61 cursor: col-resize;61 cursor: col-resize;
@@ -72,11 +72,11 @@ · 10 unmodified lines
72 margin: 0;72 margin: 0;
73 padding: 0;73 padding: 0;
74 list-style: none;74 list-style: none;
75 width: $sidebarWidth;75 width: var(--sidebarWidth);
76 box-shadow: inset -1px 0 $sidebarBorder;76 box-shadow: inset -1px 0 var(--sidebarBorder);
77 @extend %border-box;77 @extend %border-box;
78 78
79 @media #{$mediumScreen} { width: $sidebarMediumWidth; }79 @include mobile { width: var(--sidebarMediumWidth); }
80 80
81 ._sidebar > & { min-height: 100%; }81 ._sidebar > & { min-height: 100%; }
82 82
@@ -89,7 +89,7 @@ · 6 unmodified lines
89 padding: 0 .75rem 0 2.125rem;89 padding: 0 .75rem 0 2.125rem;
90 line-height: 2rem;90 line-height: 2rem;
91 font-size: .75rem;91 font-size: .75rem;
92 color: $textColorLight;92 color: var(--textColorLight);
93 text-transform: uppercase;93 text-transform: uppercase;
94 cursor: default;94 cursor: default;
95}95}
@@ -110,8 +110,8 @@ · 14 unmodified lines
110 line-height: 1.5rem;110 line-height: 1.5rem;
111 font-size: .875rem;111 font-size: .875rem;
112 cursor: default;112 cursor: default;
113 background: $sidebarBackground;113 background: var(--sidebarBackground);
114 box-shadow: inset -1px 0 $sidebarBorder;114 box-shadow: inset -1px 0 var(--sidebarBorder);
115 @extend %truncate-text;115 @extend %truncate-text;
116 116
117 &, &:hover {117 &, &:hover {
@@ -123,16 +123,16 @@ · 5 unmodified lines
123 &.focus:hover,123 &.focus:hover,
124 &.active,124 &.active,
125 &.active:hover {125 &.active:hover {
126 color: $focusText;126 color: var(--focusText);
127 background: $focusBackground;127 background: var(--focusBackground);
128 box-shadow: inset -1px 0 $focusBorder;128 box-shadow: inset -1px 0 var(--focusBorder);
129 }129 }
130 130
131 &.active,131 &.active,
132 &.active:hover {132 &.active:hover {
133 color: $selectionText;133 color: var(--selectionText);
134 background: $selectionBackground;134 background: var(--selectionBackground);
135 box-shadow: inset -1px 0 $selectionBorder;135 box-shadow: inset -1px 0 var(--selectionBorder);
136 }136 }
137 137
138 &:before {138 &:before {
@@ -160,7 +160,7 @@ · 21 unmodified lines
160}160}
161 161
162._list-count {162._list-count {
163 color: $textColorLighter;163 color: var(--textColorLighter);
164 pointer-events: none;164 pointer-events: none;
165 165
166 ._list-disabled:hover > & { display: none; }166 ._list-disabled:hover > & { display: none; }
@@ -168,7 +168,7 @@ · 1 unmodified line
168 168
169._list-enable {169._list-enable {
170 display: none;170 display: none;
171 color: $linkColor;171 color: var(--linkColor);
172 cursor: pointer;172 cursor: pointer;
173 173
174 &:hover { text-decoration: underline; }174 &:hover { text-decoration: underline; }
@@ -188,7 +188,7 @@ · 13 unmodified lines
188._list-disabled {188._list-disabled {
189 @extend %_list-dir;189 @extend %_list-dir;
190 190
191 &, &:hover { color: $textColorLight; }191 &, &:hover { color: var(--textColorLight); }
192 &:before { opacity: .7; }192 &:before { opacity: .7; }
193}193}
194 194
@@ -200,11 +200,9 @@ · 5 unmodified lines
200 width: 1rem;200 width: 1rem;
201 height: 1rem;201 height: 1rem;
202 cursor: pointer;202 cursor: pointer;
203 fill: black;203 fill: var(--absolute);
204 opacity: .4;204 opacity: .4;
205 205
206 @if $style == 'dark' { fill: white; }
207
208 &:hover { opacity: .65; }206 &:hover { opacity: .65; }
209 207
210 ._list-rdir > & {208 ._list-rdir > & {
@@ -239,11 +237,11 @@ · 28 unmodified lines
239//237//
240 238
241._list-pagelink {239._list-pagelink {
242 color: $linkColor;240 color: var(--linkColor);
243 cursor: pointer;241 cursor: pointer;
244 242
245 &:hover {243 &:hover {
246 color: $linkColorHover;244 color: var(--linkColorHover);
247 text-decoration: underline;245 text-decoration: underline;
248 }246 }
249}247}
@@ -275,9 +273,9 @@ · 25 unmodified lines
275 left: .75rem;273 left: .75rem;
276 width: .75rem;274 width: .75rem;
277 height: 1px;275 height: 1px;
278 background: rgba($selectionText, .9);276 background: var(--transparentSelectionText);
279 box-shadow: 0 -3px rgba($selectionText, .9), // top line277 box-shadow: 0 -3px var(--transparentSelectionText), // top line
280 0 3px rgba($selectionText, .9); // bottom line278 0 3px var(--transparentSelectionText); // bottom line
281 }279 }
282}280}
283 281
@@ -289,7 +287,7 @@ · 5 unmodified lines
289 padding: .5rem .75rem;287 padding: .5rem .75rem;
290 line-height: 1.25rem;288 line-height: 1.25rem;
291 font-size: .8125rem;289 font-size: .8125rem;
292 color: $textColorLight;290 color: var(--textColorLight);
293 291
294 & + & { padding-top: 0; }292 & + & { padding-top: 0; }
295}293}
@@ -303,9 +301,9 @@ · 7 unmodified lines
303._list-hover.clone {301._list-hover.clone {
304 position: fixed;302 position: fixed;
305 overflow: visible;303 overflow: visible;
306 z-index: $hoverZ;304 z-index: var(--hoverZ);
307 left: 0;305 left: 0;
308 min-width: $sidebarWidth;306 min-width: var(--sidebarWidth);
309 padding: .25rem .75rem;307 padding: .25rem .75rem;
310 pointer-events: none;308 pointer-events: none;
311 -webkit-font-smoothing: subpixel-antialiased;309 -webkit-font-smoothing: subpixel-antialiased;
@@ -313,7 +311,7 @@ · 1 unmodified line
313 transform: translate3d(0, 0, 0);311 transform: translate3d(0, 0, 0);
314 @extend %border-box;312 @extend %border-box;
315 313
316 @media #{$mediumScreen} { min-width: $sidebarMediumWidth; }314 @include mobile { min-width: var(--sidebarMediumWidth); }
317 315
318 > ._list-text { display: inline; }316 > ._list-text { display: inline; }
319 317
@@ -346,10 +344,10 @@ · 26 unmodified lines
346 padding: .5rem .75rem .25rem .75rem;344 padding: .5rem .75rem .25rem .75rem;
347 line-height: 1.5rem;345 line-height: 1.5rem;
348 font-size: .75rem;346 font-size: .75rem;
349 font-weight: $bolderFontWeight;347 font-weight: var(--bolderFontWeight);
350 color: $textColorLight;348 color: var(--textColorLight);
351 text-transform: uppercase;349 text-transform: uppercase;
352 background: linear-gradient(to bottom, $sidebarBackground, $sidebarBackground 75%, rgba($sidebarBackground, 0));350 background: linear-gradient(to bottom, var(--sidebarBackground), var(--sidebarBackground) 75%, var(--transparentSidebarBackground));
353 cursor: default;351 cursor: default;
354}352}
355 353
assets/stylesheets/global/_base.scss+37−31
@@ -1,9 +1,10 @@
1html {1html {
2 height: 100%;2 height: 100%;
3 font-size: 100%;3 font-size: 100%;
4 background: $documentBackground;4 background: #fff; // fallback to show the error message to browsers that don't support CSS variables.
5 background: var(--documentBackground);
5 6
6 @media #{$mediumScreen} { font-size: 93.75%; }7 @include mobile { font-size: 93.75%; }
7 8
8 @include print { background: none; }9 @include print { background: none; }
9 @import 'global/print';10 @import 'global/print';
@@ -17,10 +18,11 @@ body { · 7 unmodified lines
17 font-weight: normal;18 font-weight: normal;
18 font-family: $baseFont;19 font-family: $baseFont;
19 line-height: 1.7;20 line-height: 1.7;
20 color: $textColor;21 color: $textColor; // fallback to show the error message to browsers that don't support CSS variables.
22 color: var(--textColor);
21 word-wrap: break-word;23 word-wrap: break-word;
22 overflow-wrap: break-word;24 overflow-wrap: break-word;
23 background: $contentBackground;25 background: var(--contentBackground);
24 touch-action: manipulation;26 touch-action: manipulation;
25 -webkit-tap-highlight-color: rgba(black, 0);27 -webkit-tap-highlight-color: rgba(black, 0);
26 -webkit-touch-callout: none;28 -webkit-touch-callout: none;
@@ -29,11 +31,11 @@ body { · 2 unmodified lines
29}31}
30 32
31a {33a {
32 color: $linkColor;34 color: var(--linkColor);
33 text-decoration: $linkTextDecoration;35 text-decoration: var(--linkTextDecoration);
34 36
35 &:hover {37 &:hover {
36 color: $linkColorHover;38 color: var(--linkColorHover);
37 text-decoration: underline;39 text-decoration: underline;
38 }40 }
39}41}
@@ -47,7 +49,7 @@ img { · 7 unmodified lines
47h1, h2, h3, h4, h5, h6 {49h1, h2, h3, h4, h5, h6 {
48 margin: 1.5em 0 1em;50 margin: 1.5em 0 1em;
49 line-height: 1.3;51 line-height: 1.3;
50 font-weight: $bolderFontWeight;52 font-weight: var(--bolderFontWeight);
51}53}
52 54
53h1 { font-size: 1.5em; }55h1 { font-size: 1.5em; }
@@ -59,7 +61,7 @@ h5, h6 { font-size: 1em; } · 5 unmodified lines
59p { margin: 0 0 1em; }61p { margin: 0 0 1em; }
60p:last-child { margin-bottom: 0; }62p:last-child { margin-bottom: 0; }
61 63
62b, strong { font-weight: $boldFontWeight; }64b, strong { font-weight: var(--boldFontWeight); }
63 65
64small { font-size: .9em; }66small { font-size: .9em; }
65 67
@@ -79,7 +81,7 @@ li > ul, li > ol, dd > ul, dd > ol { margin: .5em 0; } · 13 unmodified lines
79li > p { margin-bottom: .25em; }81li > p { margin-bottom: .25em; }
80 82
81dl { margin: 1.5em 0; }83dl { margin: 1.5em 0; }
82dt { font-weight: $boldFontWeight; }84dt { font-weight: var(--boldFontWeight); }
83dd {85dd {
84 margin: .375em;86 margin: .375em;
85 padding-left: 1em;87 padding-left: 1em;
@@ -91,15 +93,15 @@ dfn, var { font-style: normal; } · 5 unmodified lines
91 93
92abbr, acronym, dfn {94abbr, acronym, dfn {
93 cursor: help;95 cursor: help;
94 border-bottom: 1px dotted $textColor;96 border-bottom: 1px dotted var(--textColor);
95}97}
96 98
97pre, code, samp, %pre, %code {99pre, code, samp, %pre, %code {
98 font-family: $monoFont;100 font-family: var(--monoFont);
99 font-weight: normal;101 font-weight: normal;
100 font-style: normal;102 font-style: normal;
101 font-size: .9em;103 font-size: .9em;
102 color: $textColor;104 color: var(--textColor);
103 white-space: pre-wrap;105 white-space: pre-wrap;
104 direction: ltr;106 direction: ltr;
105 -moz-tab-size: 2;107 -moz-tab-size: 2;
@@ -121,14 +123,14 @@ a > code { color: inherit; } · 15 unmodified lines
121table {123table {
122 margin: 1.5em 0;124 margin: 1.5em 0;
123 background: none;125 background: none;
124 border: 1px solid $boxBorder;126 border: 1px solid var(--boxBorder);
125 border-collapse: separate;127 border-collapse: separate;
126 border-spacing: 0;128 border-spacing: 0;
127 border-radius: 3px;129 border-radius: 3px;
128}130}
129 131
130caption {132caption {
131 font-weight: $boldFontWeight;133 font-weight: var(--boldFontWeight);
132 padding: 0 .7em .3em;134 padding: 0 .7em .3em;
133}135}
134 136
@@ -142,15 +144,15 @@ th, td { · 7 unmodified lines
142}144}
143 145
144th {146th {
145 font-weight: $boldFontWeight;147 font-weight: var(--boldFontWeight);
146 border: 0;148 border: 0;
147 border-bottom: 1px solid $boxBorder;149 border-bottom: 1px solid var(--boxBorder);
148 border-radius: 0;150 border-radius: 0;
149 @extend %heading-box;151 @extend %heading-box;
150 152
151 &:empty { background: none; }153 &:empty { background: none; }
152 154
153 + th, + td { border-left: 1px solid $boxBorder; }155 + th, + td { border-left: 1px solid var(--boxBorder); }
154 156
155 tr:first-child > &:first-child { border-top-left-radius: 3px; }157 tr:first-child > &:first-child { border-top-left-radius: 3px; }
156 tr:first-child > &:last-child { border-top-right-radius: 3px; }158 tr:first-child > &:last-child { border-top-right-radius: 3px; }
@@ -161,10 +163,10 @@ th { · 4 unmodified lines
161}163}
162 164
163td {165td {
164 background: $contentBackground;166 background: var(--contentBackground);
165 border-bottom: 1px solid $boxBorderLight;167 border-bottom: 1px solid var(--boxBorderLight);
166 168
167 + td { border-left: 1px solid $boxBorderLight; }169 + td { border-left: 1px solid var(--boxBorderLight); }
168 tr:last-child > & { border-bottom: 0; }170 tr:last-child > & { border-bottom: 0; }
169 171
170 > pre:only-child, > p:only-child, > ul:only-child, > ol:only-child {172 > pre:only-child, > p:only-child, > ul:only-child, > ol:only-child {
@@ -190,7 +192,7 @@ input, button { · 19 unmodified lines
190 margin: 0;192 margin: 0;
191 font-family: inherit;193 font-family: inherit;
192 font-size: 100%;194 font-size: 100%;
193 color: $textColor;195 color: var(--textColor);
194 line-height: normal;196 line-height: normal;
195 @extend %border-box;197 @extend %border-box;
196}198}
@@ -218,6 +220,10 @@ button:focus { · 21 unmodified lines
218 outline: -webkit-focus-ring-color auto 5px;220 outline: -webkit-focus-ring-color auto 5px;
219}221}
220 222
223img, iframe {
224 background: var(--externalsBackground);
225}
226
221input[type="search"]::-webkit-search-cancel-button,227input[type="search"]::-webkit-search-cancel-button,
222input[type="search"]::-webkit-search-decoration {228input[type="search"]::-webkit-search-decoration {
223 -webkit-appearance: none;229 -webkit-appearance: none;
@@ -230,9 +236,9 @@ input[type="search"]::-webkit-search-decoration { · 6 unmodified lines
230 border: 0 !important;236 border: 0 !important;
231}237}
232 238
233::-webkit-input-placeholder { color: $textColorLighter; }239::-webkit-input-placeholder { color: var(--textColorLighter); }
234::-moz-placeholder { color: $textColorLighter; opacity: 1; }240::-moz-placeholder { color: var(--textColorLighter); opacity: 1; }
235:-ms-input-placeholder { color: $textColorLighter; }241:-ms-input-placeholder { color: var(--textColorLighter); }
236 242
237body:not(._native-scrollbars) {243body:not(._native-scrollbars) {
238 *::-webkit-scrollbar { -webkit-appearance: none; }244 *::-webkit-scrollbar { -webkit-appearance: none; }
@@ -243,12 +249,12 @@ body:not(._native-scrollbars) { · 4 unmodified lines
243 *::-webkit-scrollbar-corner { display: none; }249 *::-webkit-scrollbar-corner { display: none; }
244 250
245 *::-webkit-scrollbar-track {251 *::-webkit-scrollbar-track {
246 background: $contentBackground;252 background: var(--contentBackground);
247 border: 1px solid $contentBackground;253 border: 1px solid var(--contentBackground);
248 254
249 &:hover {255 &:hover {
250 background: $sidebarBackground;256 background: var(--sidebarBackground);
251 border-color: $sidebarBorder;257 border-color: var(--sidebarBorder);
252 }258 }
253 259
254 &:vertical { border-width: 0 0 0 1px; }260 &:vertical { border-width: 0 0 0 1px; }
@@ -266,14 +272,14 @@ body:not(._native-scrollbars) { · 11 unmodified lines
266 272
267 *::-webkit-scrollbar-thumb {273 *::-webkit-scrollbar-thumb {
268 min-height: 2rem;274 min-height: 2rem;
269 background: $scrollbarColor;275 background: var(--scrollbarColor);
270 background-clip: padding-box;276 background-clip: padding-box;
271 border: 5px solid rgba(black, 0);277 border: 5px solid rgba(black, 0);
272 border-radius: 10px;278 border-radius: 10px;
273 279
274 &:hover,280 &:hover,
275 &:active {281 &:active {
276 background-color: $scrollbarColorHover;282 background-color: var(--scrollbarColorHover);
277 border-width: 4px;283 border-width: 4px;
278 }284 }
279 }285 }
assets/stylesheets/global/_classes.scss+24−25
@@ -36,15 +36,15 @@ · 35 unmodified lines
36//36//
37 37
38%box {38%box {
39 background: $boxBackground;39 background: var(--boxBackground);
40 border: 1px solid $boxBorder;40 border: 1px solid var(--boxBorder);
41 border-radius: 3px;41 border-radius: 3px;
42}42}
43 43
44%heading-box {44%heading-box {
45 color: $boxHeaderColor;45 color: var(--boxHeaderColor);
46 background: $boxHeaderBackground;46 background: var(--boxHeaderBackground);
47 border: 1px solid $boxBorder;47 border: 1px solid var(--boxBorder);
48 border-radius: 3px;48 border-radius: 3px;
49}49}
50 50
@@ -82,15 +82,15 @@ · 31 unmodified lines
82%note {82%note {
83 margin: 1.5rem 0;83 margin: 1.5rem 0;
84 padding: .5rem .875rem;84 padding: .5rem .875rem;
85 background: $noteBackground;85 background: var(--noteBackground);
86 border: 1px solid $noteBorder;86 border: 1px solid var(--noteBorder);
87 border-radius: 3px;87 border-radius: 3px;
88}88}
89 89
90%label {90%label {
91 margin: 0 1px;91 margin: 0 1px;
92 padding: 1px 4px 2px;92 padding: 1px 4px 2px;
93 background: $labelBackground;93 background: var(--labelBackground);
94 border-radius: 3px;94 border-radius: 3px;
95}95}
96 96
@@ -102,35 +102,35 @@ · 5 unmodified lines
102 padding-right: .5em;102 padding-right: .5em;
103 overflow: hidden;103 overflow: hidden;
104 font-size: inherit;104 font-size: inherit;
105 color: $boxHeaderColor;105 color: var(--boxHeaderColor);
106 border: 1px solid $boxBorder;106 border: 1px solid var(--boxBorder);
107 border-radius: 2px;107 border-radius: 2px;
108 @extend %label;108 @extend %label;
109}109}
110 110
111%label-yellow {111%label-yellow {
112 background: $noteBackground;112 background: var(--noteBackground);
113 border-color: $noteBorder;113 border-color: var(--noteBorder);
114}114}
115 115
116%note-green, %label-green {116%note-green, %label-green {
117 background: $noteGreenBackground;117 background: var(--noteGreenBackground);
118 border-color: $noteGreenBorder;118 border-color: var(--noteGreenBorder);
119}119}
120 120
121%note-blue, %label-blue {121%note-blue, %label-blue {
122 background: $noteBlueBackground;122 background: var(--noteBlueBackground);
123 border-color: $noteBlueBorder;123 border-color: var(--noteBlueBorder);
124}124}
125 125
126%note-orange, %label-orange {126%note-orange, %label-orange {
127 background: $noteOrangeBackground;127 background: var(--noteOrangeBackground);
128 border-color: $noteOrangeBorder;128 border-color: var(--noteOrangeBorder);
129}129}
130 130
131%note-red, %label-red {131%note-red, %label-red {
132 background: $noteRedBackground;132 background: var(--noteRedBackground);
133 border-color: $noteRedBorder;133 border-color: var(--noteRedBorder);
134}134}
135 135
136//136//
@@ -149,12 +149,11 @@ · 12 unmodified lines
149 pointer-events: none;149 pointer-events: none;
150 150
151 // <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15,15H2V6h2.595c0,0,0.689-0.896,2.17-2H1C0.447,4,0,4.449,0,5v11c0,0.553,0.447,1,1,1h15c0.553,0,1-0.447,1-1v-3.746 l-2,1.645V15z M13.361,8.05v3.551L20,6.4l-6.639-4.999v3.131C5.3,4.532,5.3,12.5,5.3,12.5C7.582,8.752,8.986,8.05,13.361,8.05z"/></svg>151 // <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15,15H2V6h2.595c0,0,0.689-0.896,2.17-2H1C0.447,4,0,4.449,0,5v11c0,0.553,0.447,1,1,1h15c0.553,0,1-0.447,1-1v-3.746 l-2,1.645V15z M13.361,8.05v3.551L20,6.4l-6.639-4.999v3.131C5.3,4.532,5.3,12.5,5.3,12.5C7.582,8.752,8.986,8.05,13.361,8.05z"/></svg>
152 @if $style == 'dark' {152 background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
153 background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
154 } @else {
155 background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
156 }
157 }153 }
158}154}
155html._theme-dark %external-link:after {
156 background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
157}
159 158
160%internal-link:after { content: none !important; }159%internal-link:after { content: none !important; }
assets/stylesheets/global/_icons.scss.erb+2−2
@@ -22,8 +22,8 @@ · 21 unmodified lines
22 %doc-icon { background-image: image-url('sprites/docs@2x.png'); }22 %doc-icon { background-image: image-url('sprites/docs@2x.png'); }
23}23}
24 24
25%darkIconFix {25html._theme-dark {
26 @if $style == 'dark' {26 %darkIconFix {
27 filter: invert(100%) grayscale(100%);27 filter: invert(100%) grayscale(100%);
28 -webkit-filter: invert(100%) grayscale(100%);28 -webkit-filter: invert(100%) grayscale(100%);
29 }29 }
assets/stylesheets/global/_mixins.scss+6−0
@@ -7,3 +7,9 @@ · 6 unmodified lines
7 @content;7 @content;
8 }8 }
9}9}
10
11@mixin mobile {
12 @media (max-width: 800px) {
13 @content;
14 }
15}
assets/stylesheets/global/_print.scss+2−2
@@ -25,14 +25,14 @@ · 24 unmodified lines
25 25
26 ._attribution-p {26 ._attribution-p {
27 background: none;27 background: none;
28 border: 2px solid $boxBorder;28 border: 2px solid var(--boxBorder);
29 }29 }
30 30
31 ._attribution:last-child:after {31 ._attribution:last-child:after {
32 content: 'Exported from DevDocs \2014 https://devdocs.io';32 content: 'Exported from DevDocs \2014 https://devdocs.io';
33 display: block;33 display: block;
34 margin-top: 1rem;34 margin-top: 1rem;
35 font-weight: $bolderFontWeight;35 font-weight: var(--bolderFontWeight);
36 }36 }
37 37
38 ._attribution {38 ._attribution {
assets/stylesheets/global/_variables-dark.scss+53−69
@@ -1,92 +1,76 @@
1$baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;1html._theme-dark {
2$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;2 --absolute: white;
3$boldFontWeight: 500;
4$bolderFontWeight: 600;
5 3
6$style: 'dark';4 --documentBackground: #222;
5 --contentBackground: #33373a;
7 6
8$maxWidth: 80rem;7 --textColor: #cbd0d0;
9$headerHeight: 3rem;8 --textColorLight: #9da5ad;
10$sidebarWidth: 20rem;9 --textColorLighter: #77787a;
11$sidebarMediumWidth: 16rem;
12 10
13$documentBackground: #222;11 --externalsBackground: #fff;
14$contentBackground: #33373a;
15 12
16$textColor: #cbd0d0;13 --inputFocusBorder: transparent;
17$textColorLight: #9da5ad;
18$textColorLighter: #77787a;
19$textColorRed: #f44336;
20 14
21$inputFocusBorder: false;15 --focusBackground: #3f4042;
16 --focusBorder: #000;
17 --focusText: #f7f2f2;
22 18
23$focusBackground: #3f4042;19 --loadingText: #5d6164;
24$focusBorder: #000;
25$focusText: #f7f2f2;
26 20
27$loadingText: #5d6164;21 --selectionBackground: #007acc;
28$splashText: $loadingText;22 --selectionBorder: #000;
29 23
30$selectionBackground: #007acc;24 --highlightBackground: #64675f;
31$selectionBorder: #000;
32$selectionText: #fff;
33 25
34$highlightBackground: #64675f;26 --linkColor: var(--textColor);
27 --linkColorHover: white;
28 --linkTextDecoration: underline;
35 29
36$linkColor: $textColor;30 --headerBackground: #1c1c1c;
37$linkColorHover: white;31 --headerBorder: #000;
38$linkTextDecoration: underline;32 --searchTagBackground: #{darken(#1c1c1c, 5%)};
33 --searchBorder: #{darken(#000, 2%)};
39 34
40$headerBackground: #1c1c1c;35 --sidebarBackground: #24282a;
41$headerBorder: #000;36 --transparentSidebarBackground: #{rgba(#24282a, 0)};
37 --sidebarBorder: #000;
42 38
43$sidebarBackground: #24282a;39 --scrollbarColor: #6c6c6f;
44$sidebarBorder: #000;40 --scrollbarColorHover: #949697;
45 41
46$scrollbarColor: #6c6c6f;42 --pathBackground: var(--headerBackground);
47$scrollbarColorHover: #949697;43 --pathBorder: var(--headerBorder);
48 44
49$pathBackground: $headerBackground;45 --noticeBackground: var(--sidebarBackground);
50$pathBorder: $headerBorder;46 --noticeBorder: var(--sidebarBorder);
51 47
52$noticeBackground: $sidebarBackground;48 --boxBackground: var(--sidebarBackground);
53$noticeBorder: $sidebarBorder;49 --boxBorder: var(--headerBorder);
50 --boxBorderLight: var(--headerBorder);
51 --boxHeaderColor: #dbe4e4;
52 --boxHeaderBackground: var(--sidebarBackground);
54 53
55$boxBackground: $sidebarBackground;54 --noteBackground: #45474b;
56$boxBorder: $headerBorder;55 --noteBorder: #000;
57$boxBorderLight: $headerBorder;
58$boxHeaderColor: #dbe4e4;
59$boxHeaderBackground: $sidebarBackground;
60 56
61$noteBackground: #45474b;57 --noteGreenBackground: #284a2a;
62$noteBorder: #000;58 --noteGreenBorder: #000;
63 59
64$noteGreenBackground: #284a2a;60 --noteBlueBackground: #2a4151;
65$noteGreenBorder: #000;61 --noteBlueBorder: #000;
66 62
67$noteBlueBackground: #2a4151;63 --noteOrangeBackground: #563322;
68$noteBlueBorder: #000;64 --noteOrangeBorder: #000;
69 65
70$noteOrangeBackground: #563322;66 --noteRedBackground: #603033;
71$noteOrangeBorder: #000;67 --noteRedBorder: #000;
72 68
73$noteRedBackground: #603033;69 --labelBackground: var(--boxBackground);
74$noteRedBorder: #000;
75 70
76$labelBackground: $boxBackground;71 --notifBackground: #{rgba(#555, .95)};
72 --notifBorder: 1px solid #000;
77 73
78$notifBackground: rgba(#555, .95);74 --tipBackground: var(--notifBackground);
79$notifBorder: 1px solid #000;75 --tipBorder: var(--notifBorder);
80$notifColor: #fff;76}
81$notifColorLight: #ccc;
82
83$tipBackground: $notifBackground;
84$tipBorder: $notifBorder;
85
86$mediumScreen: '(max-width: 800px)';
87
88$contentZ: 1;
89$sidebarZ: 2;
90$headerZ: 3;
91$noticeZ: 4;
92$hoverZ: 5;
assets/stylesheets/global/_variables-light.scss+76−0
@@ -0,0 +1,76 @@
1html._theme-default {
2 --absolute: black;
3
4 --documentBackground: #f3f3f3;
5 --contentBackground: #fff;
6
7 --textColor: #333;
8 --textColorLight: #666;
9 --textColorLighter: #888;
10
11 --externalsBackground: #fff;
12
13 --inputFocusBorder: #35b5f4;
14
15 --focusBackground: #e5e5e5;
16 --focusBorder: #d4d4d4;
17 --focusText: #000;
18
19 --loadingText: #ccc;
20
21 --selectionBackground: #398df0;
22 --selectionBorder: #196fc2;
23
24 --highlightBackground: #fffdcd;
25
26 --linkColor: #3377c0;
27 --linkColorHover: #2f6cb6;
28 --linkTextDecoration: none;
29
30 --headerBackground: #eee;
31 --headerBorder: #d7d7d7;
32 --searchTagBackground: #{darken(#eee, 5%)};
33 --searchBorder: #{darken(#d7d7d7, 2%)};
34
35 --sidebarBackground: #f9f9f9;
36 --transparentSidebarBackground: #{rgba(#f9f9f9, 0)};
37 --sidebarBorder: #e1e1e1;
38
39 --scrollbarColor: #ccc;
40 --scrollbarColorHover: #999;
41
42 --pathBackground: var(--sidebarBackground);
43 --pathBorder: var(--sidebarBorder);
44
45 --noticeBackground: #faf9e2;
46 --noticeBorder: #e2e2c1;
47
48 --boxBackground: #fafafa;
49 --boxBorder: #d8d8d8;
50 --boxBorderLight: #e5e5e5;
51 --boxHeaderColor: var(--textColor);
52 --boxHeaderBackground: #f5f5f5;
53
54 --noteBackground: #f8f8dd;
55 --noteBorder: #d3d952;
56
57 --noteGreenBackground: #e7f8e1;
58 --noteGreenBorder: #89da70;
59
60 --noteBlueBackground: #d4f3fd;
61 --noteBlueBorder: #94bbeb;
62
63 --noteOrangeBackground: #fbe6d1;
64 --noteOrangeBorder: #ec8b01;
65
66 --noteRedBackground: #fed5d3;
67 --noteRedBorder: #dc7874;
68
69 --labelBackground: #f4f4f4;
70
71 --notifBackground: #{rgba(#333, .85)};
72 --notifBorder: none;
73
74 --tipBackground: #{rgba(#fffdcd, .95)};
75 --tipBorder: 1px solid #e7dca9;
76}
assets/stylesheets/global/_variables.scss+25−82
@@ -1,92 +1,35 @@
1// Variables needed to style the error message for browsers that don't support CSS variables.
1$baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;2$baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
2$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
3$boldFontWeight: 500;
4$bolderFontWeight: 600;
5
6$style: 'light';
7
8$maxWidth: 80rem;
9$headerHeight: 3rem;
10$sidebarWidth: 20rem;
11$sidebarMediumWidth: 16rem;
12
13$documentBackground: #f3f3f3;
14$contentBackground: #fff;
15
16$textColor: #333;3$textColor: #333;
17$textColorLight: #666;
18$textColorLighter: #888;
19$textColorRed: #f44336;
20
21$inputFocusBorder: #35b5f4;
22
23$focusBackground: #e5e5e5;
24$focusBorder: #d4d4d4;
25$focusText: #000;
26
27$loadingText: #ccc;
28$splashText: #ccc;
29
30$selectionBackground: #398df0;
31$selectionBorder: #196fc2;
32$selectionText: #fff;
33
34$highlightBackground: #fffdcd;
35
36$linkColor: #3377c0;
37$linkColorHover: #2f6cb6;
38$linkTextDecoration: none;
39
40$headerBackground: #eee;
41$headerBorder: #d7d7d7;
42
43$sidebarBackground: #f9f9f9;
44$sidebarBorder: #e1e1e1;
45
46$scrollbarColor: #ccc;
47$scrollbarColorHover: #999;
48
49$pathBackground: $sidebarBackground;
50$pathBorder: $sidebarBorder;
51
52$noticeBackground: #faf9e2;
53$noticeBorder: #e2e2c1;
54
55$boxBackground: #fafafa;
56$boxBorder: #d8d8d8;
57$boxBorderLight: #e5e5e5;
58$boxHeaderColor: $textColor;
59$boxHeaderBackground: #f5f5f5;
60
61$noteBackground: #f8f8dd;
62$noteBorder: #d3d952;
63
64$noteGreenBackground: #e7f8e1;
65$noteGreenBorder: #89da70;
66 4
67$noteBlueBackground: #d4f3fd;5html {
68$noteBlueBorder: #94bbeb;6 --baseFont: #{$baseFont};
7 --monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
8 --boldFontWeight: 500;
9 --bolderFontWeight: 600;
69 10
70$noteOrangeBackground: #fbe6d1;11 --textColorRed: #f44336;
71$noteOrangeBorder: #ec8b01;
72 12
73$noteRedBackground: #fed5d3;13 --splashText: var(--loadingText);
74$noteRedBorder: #dc7874;
75 14
76$labelBackground: #f4f4f4;15 --selectionText: #fff;
16 --transparentSelectionText: rgba(255, 255, 255, 0.9);
77 17
78$notifBackground: rgba(#333, .85);18 --notifColor: #fff;
79$notifBorder: none;19 --notifColorLight: #ccc;
80$notifColor: #fff;
81$notifColorLight: #ccc;
82 20
83$tipBackground: rgba(#fffdcd, .95);21 --maxWidth: 80rem;
84$tipBorder: 1px solid #e7dca9;22 --headerHeight: 3rem;
23 --sidebarWidth: 20rem;
24 --sidebarMediumWidth: 16rem;
85 25
86$mediumScreen: '(max-width: 800px)';26 --focusBackground: #e5e5e5;
27 --focusBorder: #d4d4d4;
28 --focusText: #000;
87 29
88$contentZ: 1;30 --contentZ: 1;
89$sidebarZ: 2;31 --sidebarZ: 2;
90$headerZ: 3;32 --headerZ: 3;
91$noticeZ: 4;33 --noticeZ: 4;
92$hoverZ: 5;34 --hoverZ: 5;
35}
assets/stylesheets/pages/_angularjs.scss+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
8 .nav-index-section {8 .nav-index-section {
9 margin: 1.5em 0 1em -2em;9 margin: 1.5em 0 1em -2em;
10 list-style: none;10 list-style: none;
11 font-weight: $boldFontWeight;11 font-weight: var(--boldFontWeight);
12 text-transform: capitalize;12 text-transform: capitalize;
13 }13 }
14 14
assets/stylesheets/pages/_async.scss+2−2
@@ -3,13 +3,13 @@ · 2 unmodified lines
3 3
4 h3 > .type-signature {4 h3 > .type-signature {
5 float: right;5 float: right;
6 color: $textColorLight;6 color: var(--textColorLight);
7 }7 }
8 8
9 h3 > .signature-attributes {9 h3 > .signature-attributes {
10 font-size: .75rem;10 font-size: .75rem;
11 font-weight: normal;11 font-weight: normal;
12 font-style: italic;12 font-style: italic;
13 color: $textColorLighter;13 color: var(--textColorLighter);
14 }14 }
15}15}
assets/stylesheets/pages/_bash.scss+1−1
@@ -5,7 +5,7 @@ · 4 unmodified lines
5 }5 }
6 6
7 th[align=left] {7 th[align=left] {
8 border-left: 1px solid $boxBorder;8 border-left: 1px solid var(--boxBorder);
9 }9 }
10 10
11 code { @extend %label; }11 code { @extend %label; }
assets/stylesheets/pages/_bootstrap.scss+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
4 h4 > code, h5 > code, strong > code { @extend %label; }4 h4 > code, h5 > code, strong > code { @extend %label; }
5 5
6 h2 > small {6 h2 > small {
7 color: $textColorLight;7 color: var(--textColorLight);
8 float: right;8 float: right;
9 }9 }
10 10
assets/stylesheets/pages/_c.scss+2−2
@@ -23,7 +23,7 @@ · 22 unmodified lines
23 23
24 .t-spar { // language/switch, language/for, etc.24 .t-spar { // language/switch, language/for, etc.
25 font-style: italic;25 font-style: italic;
26 color: $textColorLight;26 color: var(--textColorLight);
27 }27 }
28 .t-sdsc-nopad dl, .t-sdsc-nopad dd { margin: 0; }28 .t-sdsc-nopad dl, .t-sdsc-nopad dd { margin: 0; }
29 29
@@ -57,7 +57,7 @@ · 27 unmodified lines
57 margin: 1rem 0;57 margin: 1rem 0;
58 padding: .375rem;58 padding: .375rem;
59 font-size: .75rem;59 font-size: .75rem;
60 border: 1px solid $boxBorder;60 border: 1px solid var(--boxBorder);
61 border-radius: 2px;61 border-radius: 2px;
62 }62 }
63 63
assets/stylesheets/pages/_clojure.scss+1−1
@@ -5,6 +5,6 @@ · 4 unmodified lines
5 .type {5 .type {
6 float: right;6 float: right;
7 font-size: .9em;7 font-size: .9em;
8 color: $textColorLight;8 color: var(--textColorLight);
9 }9 }
10}10}
assets/stylesheets/pages/_d.scss+3−3
@@ -2,10 +2,10 @@ · 1 unmodified line
2 h2 { @extend %block-heading; }2 h2 { @extend %block-heading; }
3 h3, .d_decl { @extend %block-label, %label-blue; }3 h3, .d_decl { @extend %block-label, %label-blue; }
4 .d_decl { @extend %code; }4 .d_decl { @extend %code; }
5 .d_decl > small { color: $textColorLight; }5 .d_decl > small { color: var(--textColorLight); }
6 .d_decl > strong { font-weight: $bolderFontWeight; }6 .d_decl > strong { font-weight: var(--bolderFontWeight); }
7 7
8 p > code, li > code, td > code, dd > code { @extend %label; }8 p > code, li > code, td > code, dd > code { @extend %label; }
9 9
10 span.red { color: $textColorRed; }10 span.red { color: var(--textColorRed); }
11}11}
assets/stylesheets/pages/_dart.scss+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
6 6
7 .features {7 .features {
8 float: right;8 float: right;
9 color: $textColorLight;9 color: var(--textColorLight);
10 }10 }
11 }11 }
12}12}
assets/stylesheets/pages/_dojo.scss+1−1
@@ -1,5 +1,5 @@
1._dojo {1._dojo {
2 @extend %simple;2 @extend %simple;
3 3
4 .jsdoc-inheritance { color: $textColorLight; }4 .jsdoc-inheritance { color: var(--textColorLight); }
5}5}
assets/stylesheets/pages/_ember.scss+2−2
@@ -5,7 +5,7 @@ · 4 unmodified lines
5 5
6 h3 > .access {6 h3 > .access {
7 float: right;7 float: right;
8 color: $textColorLight;8 color: var(--textColorLight);
9 font-weight: normal;9 font-weight: normal;
10 }10 }
11 11
@@ -15,6 +15,6 @@ · 3 unmodified lines
15 }15 }
16 16
17 p.github-link {17 p.github-link {
18 color: $textColorLight;18 color: var(--textColorLight);
19 }19 }
20}20}
assets/stylesheets/pages/_erlang.scss+1−1
@@ -5,5 +5,5 @@ · 4 unmodified lines
5 code.code { @extend %label; }5 code.code { @extend %label; }
6 .note { @extend %note; }6 .note { @extend %note; }
7 .warning { @extend %note, %note-red; }7 .warning { @extend %note, %note-red; }
8 .note .label, .warning .label { font-weight: $boldFontWeight; }8 .note .label, .warning .label { font-weight: var(--boldFontWeight); }
9}9}
assets/stylesheets/pages/_jquery.scss+2−2
@@ -32,7 +32,7 @@ · 31 unmodified lines
32 32
33 .toc-list {33 .toc-list {
34 margin-top: 0;34 margin-top: 0;
35 font-weight: $boldFontWeight;35 font-weight: var(--boldFontWeight);
36 36
37 > li + li { margin-top: 1em; }37 > li + li { margin-top: 1em; }
38 > li > ul { font-weight: normal; }38 > li > ul { font-weight: normal; }
@@ -48,7 +48,7 @@ · 9 unmodified lines
48 .returns,48 .returns,
49 .option-type {49 .option-type {
50 float: right;50 float: right;
51 font-weight: $boldFontWeight;51 font-weight: var(--boldFontWeight);
52 margin-left: 1em;52 margin-left: 1em;
53 }53 }
54 54
assets/stylesheets/pages/_love.scss+2−2
@@ -12,6 +12,6 @@ · 11 unmodified lines
12 .smwtable { width: 100%; }12 .smwtable { width: 100%; }
13 .smwtable td:nth-last-child(2), .smwtable td:last-child { width: 2.5em; }13 .smwtable td:nth-last-child(2), .smwtable td:last-child { width: 2.5em; }
14 14
15 .cell-green { background: $noteGreenBackground; }15 .cell-green { background: var(--noteGreenBackground); }
16 .cell-red { background: $noteRedBackground; }16 .cell-red { background: var(--noteRedBackground); }
17}17}
assets/stylesheets/pages/_mdn.scss+3−3
@@ -7,7 +7,7 @@ · 6 unmodified lines
7 > span {7 > span {
8 display: block;8 display: block;
9 font-size: 1rem;9 font-size: 1rem;
10 font-weight: $boldFontWeight;10 font-weight: var(--boldFontWeight);
11 }11 }
12 12
13 ul, ol {13 ul, ol {
@@ -42,7 +42,7 @@ · 28 unmodified lines
42 > .note {42 > .note {
43 em {43 em {
44 font-style: normal;44 font-style: normal;
45 font-weight: $boldFontWeight;45 font-weight: var(--boldFontWeight);
46 }46 }
47 47
48 > ul { margin: 1em 0; }48 > ul { margin: 1em 0; }
@@ -93,7 +93,7 @@ · 44 unmodified lines
93 dt > strong > code, // HTML element attribute93 dt > strong > code, // HTML element attribute
94 dl > dt > code { // CSS property value, Javascript function argument94 dl > dt > code { // CSS property value, Javascript function argument
95 font-family: inherit;95 font-family: inherit;
96 font-weight: $boldFontWeight;96 font-weight: var(--boldFontWeight);
97 font-size: inherit;97 font-size: inherit;
98 }98 }
99 99
assets/stylesheets/pages/_meteor.scss+2−2
@@ -9,10 +9,10 @@ · 8 unmodified lines
9 dt > code { @extend %label; }9 dt > code { @extend %label; }
10 10
11 .api-heading { overflow: hidden; }11 .api-heading { overflow: hidden; }
12 .api-heading > code { font-weight: $boldFontWeight; }12 .api-heading > code { font-weight: var(--boldFontWeight); }
13 .locus, .src-code { float: right; }13 .locus, .src-code { float: right; }
14 .locus, .type, .src-code { margin-left: .5em; }14 .locus, .type, .src-code { margin-left: .5em; }
15 h2 .subtext-api { margin-top: .25rem; }15 h2 .subtext-api { margin-top: .25rem; }
16 .locus, .subtext-api, .subtext-api > code { font-size: .75rem; }16 .locus, .subtext-api, .subtext-api > code { font-size: .75rem; }
17 .locus, .type { color: $textColorLight; }17 .locus, .type { color: var(--textColorLight); }
18}18}
assets/stylesheets/pages/_npm.scss+1−1
@@ -8,7 +8,7 @@ · 7 unmodified lines
8 8
9 .faint.heading {9 .faint.heading {
10 font-size: .9em;10 font-size: .9em;
11 color: $textColorLight;11 color: var(--textColorLight);
12 }12 }
13 13
14 .youtube-video iframe { width: 420px; height: 315px; }14 .youtube-video iframe { width: 420px; height: 315px; }
assets/stylesheets/pages/_phalcon.scss+1−1
@@ -3,6 +3,6 @@ · 2 unmodified lines
3 3
4 h3 > small {4 h3 > small {
5 float: right;5 float: right;
6 color: $textColorLight;6 color: var(--textColorLight);
7 }7 }
8}8}
assets/stylesheets/pages/_php.scss+2−2
@@ -13,7 +13,7 @@ · 12 unmodified lines
13 13
14 .verinfo {14 .verinfo {
15 float: right;15 float: right;
16 font-weight: $boldFontWeight;16 font-weight: var(--boldFontWeight);
17 }17 }
18 18
19 .classsynopsis,19 .classsynopsis,
@@ -21,7 +21,7 @@ · 1 unmodified line
21 .description > .methodsynopsis,21 .description > .methodsynopsis,
22 .description > .fieldsynopsis { @extend %note, %note-blue; }22 .description > .fieldsynopsis { @extend %note, %note-blue; }
23 23
24 .classsynopsisinfo_comment { color: $textColorLight; }24 .classsynopsisinfo_comment { color: var(--textColorLight); }
25 25
26 .classsynopsisinfo_comment,26 .classsynopsisinfo_comment,
27 .classsynopsis > .constructorsynopsis,27 .classsynopsis > .constructorsynopsis,
assets/stylesheets/pages/_postgres.scss+1−1
@@ -16,7 +16,7 @@ · 15 unmodified lines
16 }16 }
17 17
18 p > code { @extend %label; }18 p > code { @extend %label; }
19 p.c2 { font-weight: $boldFontWeight; }19 p.c2 { font-weight: var(--boldFontWeight); }
20 20
21 .navfooter > table { width: 100%; }21 .navfooter > table { width: 100%; }
22 td[align=center] { text-align: center; }22 td[align=center] { text-align: center; }
assets/stylesheets/pages/_qt.scss+1−1
@@ -4,6 +4,6 @@ · 3 unmodified lines
4 // Function headers4 // Function headers
5 h3.fn > code {5 h3.fn > code {
6 float: right;6 float: right;
7 color: $textColorLight;7 color: var(--textColorLight);
8 }8 }
9}9}
assets/stylesheets/pages/_rdoc.scss+4−4
@@ -6,7 +6,7 @@ · 5 unmodified lines
6 .method-description > h2, h3, h4, h5, h6 { font-size: 1em; }6 .method-description > h2, h3, h4, h5, h6 { font-size: 1em; }
7 7
8 .method-heading {8 .method-heading {
9 font-weight: $boldFontWeight;9 font-weight: var(--boldFontWeight);
10 @extend %block-label, %label-blue;10 @extend %block-label, %label-blue;
11 11
12 + .method-heading { margin-top: -.5em; }12 + .method-heading { margin-top: -.5em; }
@@ -22,7 +22,7 @@ · 9 unmodified lines
22 a.method-click-advice {22 a.method-click-advice {
23 float: right;23 float: right;
24 font-size: .75rem;24 font-size: .75rem;
25 color: $linkColor;25 color: var(--linkColor);
26 cursor: pointer;26 cursor: pointer;
27 @extend %user-select-none;27 @extend %user-select-none;
28 28
@@ -42,8 +42,8 @@ · 13 unmodified lines
42 top: 0;42 top: 0;
43 left: -1em;43 left: -1em;
44 right: 0;44 right: 0;
45 background: rgba($contentBackground, .95);45 background: var(--contentBackground);
46 box-shadow: 0 1em 1em 1em $contentBackground;46 box-shadow: 0 1em 1em 1em var(--contentBackground);
47 47
48 > pre { margin: 0; }48 > pre { margin: 0; }
49 }49 }
assets/stylesheets/pages/_react_native.scss+1−1
@@ -2,7 +2,7 @@ · 1 unmodified line
2 @extend %simple;2 @extend %simple;
3 3
4 .deprecated { @extend %note, %note-orange; }4 .deprecated { @extend %note, %note-orange; }
5 .deprecatedTitle { font-weight: $boldFontWeight; }5 .deprecatedTitle { font-weight: var(--boldFontWeight); }
6 6
7 span.platform { float: right; }7 span.platform { float: right; }
8 span.propType, span.platform { font-weight: normal; }8 span.propType, span.platform { font-weight: normal; }
assets/stylesheets/pages/_redis.scss+2−2
@@ -14,7 +14,7 @@ · 13 unmodified lines
14 14
15 .args {15 .args {
16 font-size: .75rem;16 font-size: .75rem;
17 color: $textColorLight;17 color: var(--textColorLight);
18 }18 }
19 19
20 // Others20 // Others
@@ -35,7 +35,7 @@ · 14 unmodified lines
35 > .prompt {35 > .prompt {
36 float: left;36 float: left;
37 margin-right: .5em;37 margin-right: .5em;
38 color: $textColorLight;38 color: var(--textColorLight);
39 }39 }
40 40
41 > code {41 > code {
assets/stylesheets/pages/_rfc.scss+1−1
@@ -10,6 +10,6 @@ · 9 unmodified lines
10 10
11 > h1, > h2, > h3, > h4, > h5 {11 > h1, > h2, > h3, > h4, > h5 {
12 margin: 0;12 margin: 0;
13 font-family: $baseFont;13 font-family: var(--baseFont);
14 }14 }
15}15}
assets/stylesheets/pages/_rust.scss+10−1
@@ -3,9 +3,18 @@ · 2 unmodified lines
3 3
4 h4 { @extend %block-label; }4 h4 { @extend %block-label; }
5 .docblock { margin-left: 1em; }5 .docblock { margin-left: 1em; }
6 div.information, div.important-traits {
7 @extend %note;
8
9 > pre { margin: .5rem 0; }
10 }
6 11
7 div.stability { margin-bottom: 1em; }12 div.stability { margin-bottom: 1em; }
8 em.stab, span.stab { @extend %label; }13 em.stab, span.stab { @extend %label; }
9 em.stab.unstable, span.stab.unstable { @extend %label-orange; }14 em.stab.unstable, span.stab.unstable { @extend %label-orange; }
10 .since, .out-of-band { float: right; }15 .out-of-band { float: right; }
16 .since, .srclink {
17 float: right;
18 margin-left: .5rem;
19 }
11}20}
assets/stylesheets/pages/_simple.scss+1−31
@@ -17,34 +17,4 @@ · 16 unmodified lines
17 blockquote > h4, blockquote > h5 { margin-top: .25rem; }17 blockquote > h4, blockquote > h5 { margin-top: .25rem; }
18}18}
19 19
20._apache_pig,20._simple { @extend %simple; }
21._bower,
22._chai,
23._codeceptjs,
24._docker,
25._electron,
26._fish,
27._flow,
28._gnu,
29._grunt,
30._haxe,
31._immutable,
32._influxdata,
33._jasmine,
34._jest,
35._less,
36._lodash,
37._marionette,
38._markdown,
39._mocha,
40._mongoose,
41._nim,
42._redux,
43._requirejs,
44._simple,
45._typescript,
46._vagrant,
47._vulkan,
48._yarn {
49 @extend %simple;
50}
assets/stylesheets/pages/_sphinx.scss+2−2
@@ -14,7 +14,7 @@ · 13 unmodified lines
14 14
15 .versionmodified, span.title, .topic-title {15 .versionmodified, span.title, .topic-title {
16 display: block;16 display: block;
17 font-weight: $boldFontWeight;17 font-weight: var(--boldFontWeight);
18 }18 }
19 19
20 p > code, li > code, dd > code, .docutils > dt > code { @extend %label; }20 p > code, li > code, dd > code, .docutils > dt > code { @extend %label; }
@@ -26,7 +26,7 @@ · 5 unmodified lines
26 .admonition-title {26 .admonition-title {
27 float: left;27 float: left;
28 margin: 0 .5em 0 0;28 margin: 0 .5em 0 0;
29 font-weight: $boldFontWeight;29 font-weight: var(--boldFontWeight);
30 30
31 &:after { content: ':'; }31 &:after { content: ':'; }
32 }32 }
assets/stylesheets/pages/_sphinx_simple.scss+1−1
@@ -6,7 +6,7 @@ · 5 unmodified lines
6 .admonition.tip { @extend %note-green; }6 .admonition.tip { @extend %note-green; }
7 .admonition-title {7 .admonition-title {
8 margin: 0 0 .25rem;8 margin: 0 0 .25rem;
9 font-weight: $boldFontWeight;9 font-weight: var(--boldFontWeight);
10 }10 }
11 11
12 code { @extend %label; }12 code { @extend %label; }
assets/stylesheets/pages/_support_tables.scss+1−1
@@ -24,7 +24,7 @@ · 23 unmodified lines
24 }24 }
25 25
26 tr.current {26 tr.current {
27 font-weight: $boldFontWeight;27 font-weight: var(--boldFontWeight);
28 font-size: 1rem;28 font-size: 1rem;
29 }29 }
30 30
assets/stylesheets/pages/_yard.scss+1−1
@@ -1,5 +1,5 @@
1._yard {1._yard {
2 @extend %simple;2 @extend %simple;
3 3
4 .tag_title { font-weight: $boldFontWeight; }4 .tag_title { font-weight: var(--boldFontWeight); }
5}5}
assets/stylesheets/pages/_yii.scss+1−1
@@ -3,6 +3,6 @@ · 2 unmodified lines
3 3
4 .detail-header-tag, .detailHeaderTag {4 .detail-header-tag, .detailHeaderTag {
5 float: right;5 float: right;
6 color: $textColorLight;6 color: var(--textColorLight);
7 }7 }
8}8}
lib/app.rb+2−16
@@ -12,6 +12,8 @@ class App < Sinatra::Application · 11 unmodified lines
12 Rack::Mime::MIME_TYPES['.webapp'] = 'application/x-web-app-manifest+json'12 Rack::Mime::MIME_TYPES['.webapp'] = 'application/x-web-app-manifest+json'
13 13
14 configure do14 configure do
15 use Rack::SslEnforcer, only_environments: ['production', 'test'], hsts: false, force_secure_cookies: false
16
15 set :sentry_dsn, ENV['SENTRY_DSN']17 set :sentry_dsn, ENV['SENTRY_DSN']
16 set :protection, except: [:frame_options, :xss_header]18 set :protection, except: [:frame_options, :xss_header]
17 19
@@ -199,7 +201,6 @@ class App < Sinatra::Application · 181 unmodified lines
199 @@manifest_asset_urls ||= [201 @@manifest_asset_urls ||= [
200 javascript_path('application', asset_host: false),202 javascript_path('application', asset_host: false),
201 stylesheet_path('application'),203 stylesheet_path('application'),
202 stylesheet_path('application-dark'),
203 image_path('docs-1.png'),204 image_path('docs-1.png'),
204 image_path('docs-1@2x.png'),205 image_path('docs-1@2x.png'),
205 image_path('docs-2.png'),206 image_path('docs-2.png'),
@@ -208,21 +209,6 @@ class App < Sinatra::Application · 2 unmodified lines
208 ]209 ]
209 end210 end
210 211
211 def main_stylesheet_path
212 stylesheet_paths[dark_theme? ? :dark : :default]
213 end
214
215 def alternate_stylesheet_path
216 stylesheet_paths[dark_theme? ? :default : :dark]
217 end
218
219 def stylesheet_paths
220 @@stylesheet_paths ||= {
221 default: stylesheet_path('application'),
222 dark: stylesheet_path('application-dark')
223 }
224 end
225
226 def app_size212 def app_size
227 @app_size ||= memoized_cookies['size'].nil? ? '20rem' : "#{memoized_cookies['size']}px"213 @app_size ||= memoized_cookies['size'].nil? ? '20rem' : "#{memoized_cookies['size']}px"
228 end214 end
lib/docs/filters/elixir/clean_html.rb+1−0
@@ -59,6 +59,7 @@ module Docs · 58 unmodified lines
59 59
60 css('pre').each do |node|60 css('pre').each do |node|
61 node['data-language'] = 'elixir'61 node['data-language'] = 'elixir'
62 node.content = node.content
62 end63 end
63 end64 end
64 end65 end
lib/docs/filters/express/clean_html.rb+5−0
@@ -42,6 +42,11 @@ module Docs · 41 unmodified lines
42 node.parent.content = node.parent.content42 node.parent.content = node.parent.content
43 end43 end
44 44
45 # Fix links to the method reference
46 css('a').each do |node|
47 node['href'] = node['href'].sub('4x/api', 'index')
48 end
49
45 doc50 doc
46 end51 end
47 end52 end
lib/docs/filters/handlebars/clean_html.rb+44−0
@@ -0,0 +1,44 @@
1module Docs
2 class Handlebars
3 class CleanHtmlFilter < Filter
4 def call
5 # Remove the t-shirt shop advertisement
6 css('#callout').remove
7
8 # The title filter is used to add titles to pages without one, remove original headers
9 css('h1').remove
10
11 # Remove the link to the issue tracker
12 css('.issue-tracker').remove
13
14 css('pre').each do |node|
15 # Remove nested nodes inside pre tags
16 node.content = node.content
17
18 # Add syntax highlighting
19 node['data-language'] = 'html'
20 end
21
22 # Transform 'Learn More' links to headers in the "Getting Started" part of the homepage
23 # If this step is skipped, that section looks cluttered with 4 sub-sections without any dividers
24 css('#getting-started + .contents a.more-info').each do |node|
25 clone = node.clone
26
27 # Move it to the top of the sub-section
28 node.parent.prepend_child(clone)
29
30 # Turn it into a header
31 clone.name = 'h3'
32
33 # Remove the "Learn More: " part
34 clone.content = clone.content[12..-1]
35 end
36
37 # Remove class attributes from div elements to reduce file size
38 css('div').remove_attr('class')
39
40 doc
41 end
42 end
43 end
44end
lib/docs/filters/handlebars/entries.rb+19−0
@@ -0,0 +1,19 @@
1module Docs
2 class Handlebars
3 class EntriesFilter < Docs::EntriesFilter
4 def get_name
5 subpath[0..-6].titleize
6 end
7
8 def get_type
9 name
10 end
11
12 def additional_entries
13 css('h2, h3').to_a.map do |node|
14 [node.content.strip, node['id'], root_page? ? 'Manual' : nil]
15 end
16 end
17 end
18 end
19end
lib/docs/filters/puppeteer/clean_html.rb+24−0
@@ -0,0 +1,24 @@
1module Docs
2 class Puppeteer
3 class CleanHtmlFilter < Filter
4 def call
5 at_css('h1').content = 'Puppeteer Documentation'
6
7 # None of the elements to remove have classes, so the order of the remove calls is trivial
8
9 # Remove links to previous versions of the reference
10 at_css('h1 + ul').remove
11
12 # Remove table of contents
13 at_css('h1 + h5').remove
14 at_css('h1 + ul').remove
15
16 # Make headers bigger by transforming them into a bigger variant
17 css('h3').each { |node| node.name = 'h2' }
18 css('h4').each { |node| node.name = 'h3' }
19
20 doc
21 end
22 end
23 end
24end
lib/docs/filters/puppeteer/entries.rb+41−0
@@ -0,0 +1,41 @@
1module Docs
2 class Puppeteer
3 class EntriesFilter < Docs::EntriesFilter
4 # The entire reference is one big page, so get_name and get_type are not necessary
5
6 def additional_entries
7 entries = []
8
9 css('h3').each do |node|
10 name = node.content.split(': ').last
11
12 # Find all sub-items (all h4's between the current h3 and the next)
13 current = node.next
14 while !current.nil? && current.name != 'h3'
15 if current.name == 'h4'
16 current_name = current.content
17
18 # Prepend events with the class name
19 if current_name.start_with?('event: ')
20 current_name = "#{name} event: #{current_name[/'(.*)'/, 1]}"
21 end
22
23 # Remove arguments from functions
24 if current_name.include?('(')
25 current_name = current_name.split('(')[0] + '()'
26 end
27
28 entries << [current_name, current['id'], name]
29 end
30
31 current = current.next
32 end
33
34 entries << [name, node['id'], name]
35 end
36
37 entries
38 end
39 end
40 end
41end
lib/docs/filters/python/clean_html.rb+5−3
@@ -15,15 +15,17 @@ module Docs · 14 unmodified lines
15 15
16 def other16 def other
17 css('h1').each do |node|17 css('h1').each do |node|
18 node.content = node.content.sub!(/\A[\d\.]+/) do |str|18 node.content = node.content.sub(/\A[\d\.]+/) do |str|
19 rgx = /\A#{str}/19 rgx = /\A#{str}/
20 @levelRegexp = @levelRegexp ? Regexp.union(@levelRegexp, rgx) : rgx20 @levelRegexp = @levelRegexp ? Regexp.union(@levelRegexp, rgx) : rgx
21 ''21 ''
22 end22 end
23 end23 end
24 24
25 css('h2', 'h3', 'h4').each do |node|25 unless @levelRegexp.nil?
26 node.inner_html = node.inner_html.remove @levelRegexp26 css('h2', 'h3', 'h4').each do |node|
27 node.inner_html = node.inner_html.remove @levelRegexp
28 end
27 end29 end
28 end30 end
29 end31 end
lib/docs/filters/python/entries_v3.rb+12−10
@@ -2,16 +2,18 @@ module Docs · 1 unmodified line
2 class Python2 class Python
3 class EntriesV3Filter < Docs::EntriesFilter3 class EntriesV3Filter < Docs::EntriesFilter
4 REPLACE_TYPES = {4 REPLACE_TYPES = {
5 'Cryptographic' => 'Cryptography',5 'contextvars — Context Variables' => 'Context Variables',
6 'Custom Interpreters' => 'Interpreters',6 'Cryptographic' => 'Cryptography',
7 'Data Compression & Archiving' => 'Data Compression',7 'Custom Interpreters' => 'Interpreters',
8 'Generic Operating System' => 'Operating System',8 'Data Compression & Archiving' => 'Data Compression',
9 'Graphical User Interfaces with Tk' => 'Tk',9 'email — An email & MIME handling package' => 'Email',
10 'Internet Data Handling' => 'Internet Data',10 'Generic Operating System' => 'Operating System',
11 'Internet Protocols & Support' => 'Internet',11 'Graphical User Interfaces with Tk' => 'Tk',
12 'Interprocess Communication & Networking' => 'Networking',12 'Internet Data Handling' => 'Internet Data',
13 'Program Frameworks' => 'Frameworks',13 'Internet Protocols & Support' => 'Internet',
14 'Structured Markup Processing Tools' => 'Structured Markup' }14 'Interprocess Communication & Networking' => 'Networking',
15 'Program Frameworks' => 'Frameworks',
16 'Structured Markup Processing Tools' => 'Structured Markup' }
15 17
16 def get_name18 def get_name
17 name = at_css('h1').content19 name = at_css('h1').content
lib/docs/filters/rust/clean_html.rb+32−4
@@ -2,8 +2,6 @@ module Docs · 1 unmodified line
2 class Rust2 class Rust
3 class CleanHtmlFilter < Filter3 class CleanHtmlFilter < Filter
4 def call4 def call
5 puts subpath if at_css('#versioninfo')
6
7 if slug.start_with?('book') || slug.start_with?('reference')5 if slug.start_with?('book') || slug.start_with?('reference')
8 @doc = at_css('#content main')6 @doc = at_css('#content main')
9 elsif slug == 'error-index'7 elsif slug == 'error-index'
@@ -29,12 +27,16 @@ module Docs · 19 unmodified lines
29 27
30 css('.rusttest', '.test-arrow', 'hr').remove28 css('.rusttest', '.test-arrow', 'hr').remove
31 29
30 css('.docblock.attributes').each do |node|
31 node.remove if node.content.include?('#[must_use]')
32 end
33
32 css('a.header').each do |node|34 css('a.header').each do |node|
33 node.first_element_child['id'] = node['name'] || node['id']35 node.first_element_child['id'] = node['name'] || node['id']
34 node.before(node.children).remove36 node.before(node.children).remove
35 end37 end
36 38
37 css('.docblock > h1').each { |node| node.name = 'h4' }39 css('.docblock > h1:not(.section-header)').each { |node| node.name = 'h4' }
38 css('h2.section-header').each { |node| node.name = 'h3' }40 css('h2.section-header').each { |node| node.name = 'h3' }
39 css('h1.section-header').each { |node| node.name = 'h2' }41 css('h1.section-header').each { |node| node.name = 'h2' }
40 42
@@ -44,7 +46,7 @@ module Docs · 3 unmodified lines
44 end46 end
45 end47 end
46 48
47 css('> .impl-items', '> .docblock', 'pre > pre').each do |node|49 css('> .impl-items', '> .docblock', 'pre > pre', '.tooltiptext', '.tooltip').each do |node|
48 node.before(node.children).remove50 node.before(node.children).remove
49 end51 end
50 52
@@ -65,6 +67,32 @@ module Docs · 14 unmodified lines
65 doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2'67 doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2'
66 at_css('h1').content = 'Rust Documentation' if root_page?68 at_css('h1').content = 'Rust Documentation' if root_page?
67 69
70 css('.table-display').each do |node|
71 node.css('td').each do |td|
72 node.before(td.children)
73 end
74 node.remove
75 end
76
77 css('h2 .important-traits', 'h3 .important-traits', 'h4 .important-traits').each do |node|
78 content = node.at_css('.content.hidden .content')
79 node.at_css('.content.hidden').replace(content) if content
80 node.parent.after(node)
81 end
82
83 css('code.content').each do |node|
84 node.name = 'pre'
85 node.css('.fmt-newline').each do |line|
86 line.inner_html = line.inner_html + "\n"
87 end
88 node.inner_html = node.inner_html.gsub('<br>', "\n")
89 node.content = node.content
90 end
91
92 css('.since + .srclink').each do |node|
93 node.previous_element.before(node)
94 end
95
68 doc96 doc
69 end97 end
70 end98 end
lib/docs/filters/rust/entries.rb+8−5
@@ -42,11 +42,14 @@ module Docs · 41 unmodified lines
42 entries << [node.content, node['id']] unless node.content.include?('Note:')42 entries << [node.content, node['id']] unless node.content.include?('Note:')
43 end43 end
44 else44 else
45 css('#methods + * + div > .method', '#required-methods + div > .method', '#provided-methods + div > .method').map do |node|45 css('.method')
46 name = node.at_css('.fnname').content46 .select {|node| !node.at_css('.fnname').nil?}
47 name.prepend "#{self.name}::"47 .map {|node|
48 [name, node['id']]48 name = node.at_css('.fnname').content
49 end49 name.prepend "#{self.name}::"
50 [name, node['id']]
51 }
52 .uniq {|item| item[0]}
50 end53 end
51 end54 end
52 end55 end
lib/docs/scrapers/apache_pig.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class ApachePig < UrlScraper2 class ApachePig < UrlScraper
3 self.name = 'Apache Pig'3 self.name = 'Apache Pig'
4 self.slug = 'apache_pig'4 self.slug = 'apache_pig'
5 self.type = 'apache_pig'5 self.type = 'simple'
6 self.links = {6 self.links = {
7 home: 'https://pig.apache.org/'7 home: 'https://pig.apache.org/'
8 }8 }
lib/docs/scrapers/bower.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Bower < UrlScraper2 class Bower < UrlScraper
3 self.name = 'Bower'3 self.name = 'Bower'
4 self.type = 'bower'4 self.type = 'simple'
5 self.release = '1.8.4'5 self.release = '1.8.4'
6 self.base_url = 'https://bower.io/docs/'6 self.base_url = 'https://bower.io/docs/'
7 self.root_path = 'api'7 self.root_path = 'api'
lib/docs/scrapers/chai.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Chai < UrlScraper2 class Chai < UrlScraper
3 self.name = 'Chai'3 self.name = 'Chai'
4 self.type = 'chai'4 self.type = 'simple'
5 self.release = '4.1.0'5 self.release = '4.1.0'
6 self.base_url = 'http://chaijs.com'6 self.base_url = 'http://chaijs.com'
7 self.root_path = '/api/'7 self.root_path = '/api/'
lib/docs/scrapers/codeceptjs.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Codeceptjs < UrlScraper2 class Codeceptjs < UrlScraper
3 self.name = 'CodeceptJS'3 self.name = 'CodeceptJS'
4 self.type = 'codeceptjs'4 self.type = 'simple'
5 self.root_path = 'index.html'5 self.root_path = 'index.html'
6 self.release = '1.3.1'6 self.release = '1.3.1'
7 self.base_url = 'https://codecept.io/'7 self.base_url = 'https://codecept.io/'
lib/docs/scrapers/docker.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Docker < UrlScraper2 class Docker < UrlScraper
3 self.type = 'docker'3 self.type = 'simple'
4 self.links = {4 self.links = {
5 home: 'https://docker.com/',5 home: 'https://docker.com/',
6 code: 'https://github.com/docker/docker'6 code: 'https://github.com/docker/docker'
lib/docs/scrapers/electron.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Electron < UrlScraper2 class Electron < UrlScraper
3 self.type = 'electron'3 self.type = 'simple'
4 self.base_url = 'https://electronjs.org/docs'4 self.base_url = 'https://electronjs.org/docs'
5 self.release = '2.0.2'5 self.release = '2.0.2'
6 self.links = {6 self.links = {
lib/docs/scrapers/elixir.rb+1−1
@@ -34,7 +34,7 @@ module Docs · 33 unmodified lines
34 end34 end
35 35
36 version '1.7' do36 version '1.7' do
37 self.release = '1.7.2'37 self.release = '1.7.3'
38 self.base_urls = [38 self.base_urls = [
39 "https://hexdocs.pm/elixir/#{release}/",39 "https://hexdocs.pm/elixir/#{release}/",
40 "https://hexdocs.pm/eex/#{release}/",40 "https://hexdocs.pm/eex/#{release}/",
lib/docs/scrapers/express.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Express < UrlScraper2 class Express < UrlScraper
3 self.name = 'Express'3 self.name = 'Express'
4 self.type = 'express'4 self.type = 'express'
5 self.release = '4.16.1'5 self.release = '4.16.3'
6 self.base_url = 'http://expressjs.com/en/'6 self.base_url = 'http://expressjs.com/en/'
7 self.root_path = '4x/api.html'7 self.root_path = '4x/api.html'
8 self.initial_paths = %w(8 self.initial_paths = %w(
lib/docs/scrapers/fish.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Fish < UrlScraper2 class Fish < UrlScraper
3 self.name = 'Fish'3 self.name = 'Fish'
4 self.type = 'fish'4 self.type = 'simple'
5 self.root_path = 'index.html'5 self.root_path = 'index.html'
6 self.links = {6 self.links = {
7 home: 'https://fishshell.com/',7 home: 'https://fishshell.com/',
lib/docs/scrapers/flow.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Flow < UrlScraper2 class Flow < UrlScraper
3 self.type = 'flow'3 self.type = 'simple'
4 self.release = '0.79.1'4 self.release = '0.79.1'
5 self.base_url = 'https://flow.org/en/docs/'5 self.base_url = 'https://flow.org/en/docs/'
6 self.links = {6 self.links = {
lib/docs/scrapers/gnu.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Gnu < FileScraper2 class Gnu < FileScraper
3 self.type = 'gnu'3 self.type = 'simple'
4 self.root_path = 'index.html'4 self.root_path = 'index.html'
5 self.abstract = 'true'5 self.abstract = 'true'
6 6
lib/docs/scrapers/grunt.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Grunt < UrlScraper2 class Grunt < UrlScraper
3 self.name = 'Grunt'3 self.name = 'Grunt'
4 self.type = 'grunt'4 self.type = 'simple'
5 self.release = '1.0.1'5 self.release = '1.0.1'
6 self.base_url = 'https://gruntjs.com/'6 self.base_url = 'https://gruntjs.com/'
7 self.root_path = 'getting-started'7 self.root_path = 'getting-started'
lib/docs/scrapers/handlebars.rb+23−0
@@ -0,0 +1,23 @@
1module Docs
2 class Handlebars < UrlScraper
3 self.name = 'Handlebars.js'
4 self.slug = 'handlebars'
5 self.type = 'simple'
6 self.release = '4.0.12'
7 self.base_url = 'https://handlebarsjs.com/'
8 self.links = {
9 home: 'https://handlebarsjs.com/',
10 code: 'https://github.com/wycats/handlebars.js/'
11 }
12
13 html_filters.push 'handlebars/entries', 'handlebars/clean_html', 'title'
14
15 options[:container] = '#contents'
16 options[:root_title] = 'Handlebars.js'
17
18 options[:attribution] = <<-HTML
19 &copy; 2011&ndash;2017 by Yehuda Katz<br>
20 Licensed under the MIT License.
21 HTML
22 end
23end
lib/docs/scrapers/haxe.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Haxe < UrlScraper2 class Haxe < UrlScraper
3 self.name = 'Haxe'3 self.name = 'Haxe'
4 self.type = 'haxe'4 self.type = 'simple'
5 self.release = '3.4.7'5 self.release = '3.4.7'
6 self.base_url = 'https://api.haxe.org/'6 self.base_url = 'https://api.haxe.org/'
7 7
lib/docs/scrapers/immutable.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Immutable < UrlScraper2 class Immutable < UrlScraper
3 self.name = 'Immutable.js'3 self.name = 'Immutable.js'
4 self.slug = 'immutable'4 self.slug = 'immutable'
5 self.type = 'immutable'5 self.type = 'simple'
6 self.release = '3.8.1'6 self.release = '3.8.1'
7 self.base_url = 'https://facebook.github.io/immutable-js/docs/'7 self.base_url = 'https://facebook.github.io/immutable-js/docs/'
8 self.links = {8 self.links = {
lib/docs/scrapers/influxdata.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Influxdata < UrlScraper2 class Influxdata < UrlScraper
3 self.name = 'InfluxData'3 self.name = 'InfluxData'
4 self.type = 'influxdata'4 self.type = 'simple'
5 self.release = '1.3'5 self.release = '1.3'
6 self.base_url = 'https://docs.influxdata.com/'6 self.base_url = 'https://docs.influxdata.com/'
7 self.links = {7 self.links = {
lib/docs/scrapers/jasmine.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Jasmine < UrlScraper2 class Jasmine < UrlScraper
3 self.type = 'jasmine'3 self.type = 'simple'
4 self.release = '3.2.1'4 self.release = '3.2.1'
5 self.base_url = 'https://jasmine.github.io/api/3.2/'5 self.base_url = 'https://jasmine.github.io/api/3.2/'
6 self.root_path = 'index.html'6 self.root_path = 'index.html'
lib/docs/scrapers/jest.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Jest < UrlScraper2 class Jest < UrlScraper
3 self.type = 'jest'3 self.type = 'simple'
4 self.release = '23.5.0'4 self.release = '23.5.0'
5 self.base_url = 'https://jestjs.io/docs/en/'5 self.base_url = 'https://jestjs.io/docs/en/'
6 self.root_path = 'getting-started'6 self.root_path = 'getting-started'
lib/docs/scrapers/laravel.rb+13−0
@@ -29,6 +29,19 @@ module Docs · 28 unmodified lines
29 Laravel is a trademark of Taylor Otwell.29 Laravel is a trademark of Taylor Otwell.
30 HTML30 HTML
31 31
32 version '5.7' do
33 self.release = '5.7.7'
34 self.root_path = '/api/5.7/index.html'
35 self.initial_paths = %w(/docs/5.7/installation /api/5.7/classes.html)
36
37 options[:only_patterns] = [%r{\A/api/5\.7/}, %r{\A/docs/5\.7/}]
38
39 options[:fix_urls] = ->(url) do
40 url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/5.7/"
41 url
42 end
43 end
44
32 version '5.6' do45 version '5.6' do
33 self.release = '5.6.33'46 self.release = '5.6.33'
34 self.root_path = '/api/5.6/index.html'47 self.root_path = '/api/5.6/index.html'
lib/docs/scrapers/less.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Less < UrlScraper2 class Less < UrlScraper
3 self.type = 'less'3 self.type = 'simple'
4 self.release = '2.7.2'4 self.release = '2.7.2'
5 self.base_url = 'http://lesscss.org'5 self.base_url = 'http://lesscss.org'
6 self.root_path = '/features'6 self.root_path = '/features'
lib/docs/scrapers/lodash.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Lodash < UrlScraper2 class Lodash < UrlScraper
3 self.name = 'lodash'3 self.name = 'lodash'
4 self.slug = 'lodash'4 self.slug = 'lodash'
5 self.type = 'lodash'5 self.type = 'simple'
6 self.links = {6 self.links = {
7 home: 'https://lodash.com/',7 home: 'https://lodash.com/',
8 code: 'https://github.com/lodash/lodash/'8 code: 'https://github.com/lodash/lodash/'
lib/docs/scrapers/marionette.rb+1−1
@@ -2,7 +2,7 @@ module Docs · 1 unmodified line
2 class Marionette < UrlScraper2 class Marionette < UrlScraper
3 self.name = 'Marionette.js'3 self.name = 'Marionette.js'
4 self.slug = 'marionette'4 self.slug = 'marionette'
5 self.type = 'marionette'5 self.type = 'simple'
6 self.root_path = 'index'6 self.root_path = 'index'
7 self.links = {7 self.links = {
8 home: 'https://marionettejs.com/',8 home: 'https://marionettejs.com/',
lib/docs/scrapers/markdown.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Markdown < UrlScraper2 class Markdown < UrlScraper
3 self.name = 'Markdown'3 self.name = 'Markdown'
4 self.type = 'markdown'4 self.type = 'simple'
5 self.base_url = 'http://daringfireball.net/projects/markdown/syntax'5 self.base_url = 'http://daringfireball.net/projects/markdown/syntax'
6 6
7 html_filters.push 'markdown/clean_html', 'markdown/entries'7 html_filters.push 'markdown/clean_html', 'markdown/entries'
lib/docs/scrapers/mocha.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Mocha < UrlScraper2 class Mocha < UrlScraper
3 self.type = 'mocha'3 self.type = 'simple'
4 self.release = '5.0.1'4 self.release = '5.0.1'
5 self.base_url = 'https://mochajs.org/'5 self.base_url = 'https://mochajs.org/'
6 self.links = {6 self.links = {
lib/docs/scrapers/mongoose.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Mongoose < UrlScraper2 class Mongoose < UrlScraper
3 self.name = 'Mongoose'3 self.name = 'Mongoose'
4 self.type = 'mongoose'4 self.type = 'simple'
5 self.release = '4.13.1'5 self.release = '4.13.1'
6 self.base_url = 'http://mongoosejs.com/docs/'6 self.base_url = 'http://mongoosejs.com/docs/'
7 self.root_path = 'index.html'7 self.root_path = 'index.html'
lib/docs/scrapers/nim.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Nim < UrlScraper2 class Nim < UrlScraper
3 self.type = 'nim'3 self.type = 'simple'
4 self.release = '0.18.0'4 self.release = '0.18.0'
5 self.base_url = 'https://nim-lang.org/docs/'5 self.base_url = 'https://nim-lang.org/docs/'
6 self.root_path = 'overview.html'6 self.root_path = 'overview.html'
lib/docs/scrapers/puppeteer.rb+18−0
@@ -0,0 +1,18 @@
1module Docs
2 class Puppeteer < Github
3 self.release = '1.8.0'
4 self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.8.0/docs/api.md'
5 self.links = {
6 code: 'https://github.com/GoogleChrome/puppeteer'
7 }
8
9 html_filters.push 'puppeteer/entries', 'puppeteer/clean_html'
10
11 options[:container] = '.markdown-body'
12
13 options[:attribution] = <<-HTML
14 &copy; 2017 Google Inc<br>
15 Licensed under the Apache License 2.0.
16 HTML
17 end
18end
lib/docs/scrapers/redux.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Redux < UrlScraper2 class Redux < UrlScraper
3 self.type = 'redux'3 self.type = 'simple'
4 self.release = '3.7.2'4 self.release = '3.7.2'
5 self.base_url = 'http://redux.js.org/docs/'5 self.base_url = 'http://redux.js.org/docs/'
6 self.links = {6 self.links = {
lib/docs/scrapers/requirejs.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Requirejs < UrlScraper2 class Requirejs < UrlScraper
3 self.name = 'RequireJS'3 self.name = 'RequireJS'
4 self.type = 'requirejs'4 self.type = 'simple'
5 self.release = '2.3.5'5 self.release = '2.3.5'
6 self.base_url = 'http://requirejs.org/docs/'6 self.base_url = 'http://requirejs.org/docs/'
7 self.links = {7 self.links = {
lib/docs/scrapers/rust.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Rust < UrlScraper2 class Rust < UrlScraper
3 self.type = 'rust'3 self.type = 'rust'
4 self.release = '1.28.0'4 self.release = '1.29.1'
5 self.base_url = 'https://doc.rust-lang.org/'5 self.base_url = 'https://doc.rust-lang.org/'
6 self.root_path = 'book/second-edition/index.html'6 self.root_path = 'book/second-edition/index.html'
7 self.initial_paths = %w(7 self.initial_paths = %w(
lib/docs/scrapers/typescript.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Typescript < UrlScraper2 class Typescript < UrlScraper
3 self.name = 'TypeScript'3 self.name = 'TypeScript'
4 self.type = 'typescript'4 self.type = 'simple'
5 self.release = '3.0.1'5 self.release = '3.0.1'
6 self.base_url = 'https://www.typescriptlang.org/docs/'6 self.base_url = 'https://www.typescriptlang.org/docs/'
7 self.root_path = 'tutorial.html'7 self.root_path = 'tutorial.html'
lib/docs/scrapers/vagrant.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Vagrant < UrlScraper2 class Vagrant < UrlScraper
3 self.name = 'Vagrant'3 self.name = 'Vagrant'
4 self.type = 'vagrant'4 self.type = 'simple'
5 self.release = '2.1.1'5 self.release = '2.1.1'
6 self.base_url = 'https://www.vagrantup.com/docs/'6 self.base_url = 'https://www.vagrantup.com/docs/'
7 self.root_path = 'index.html'7 self.root_path = 'index.html'
lib/docs/scrapers/vulkan.rb+1−1
@@ -1,7 +1,7 @@
1module Docs1module Docs
2 class Vulkan < UrlScraper2 class Vulkan < UrlScraper
3 self.name = 'Vulkan'3 self.name = 'Vulkan'
4 self.type = 'vulkan'4 self.type = 'simple'
5 self.release = '1.0.59'5 self.release = '1.0.59'
6 self.base_url = 'https://www.khronos.org/registry/vulkan/specs/1.0/'6 self.base_url = 'https://www.khronos.org/registry/vulkan/specs/1.0/'
7 self.root_path = 'apispec.html'7 self.root_path = 'apispec.html'
lib/docs/scrapers/yarn.rb+1−1
@@ -1,6 +1,6 @@
1module Docs1module Docs
2 class Yarn < UrlScraper2 class Yarn < UrlScraper
3 self.type = 'yarn'3 self.type = 'simple'
4 self.release = '1.9.4'4 self.release = '1.9.4'
5 self.base_url = 'https://yarnpkg.com/en/docs/'5 self.base_url = 'https://yarnpkg.com/en/docs/'
6 self.links = {6 self.links = {
lib/tasks/docs.thor+6−2
@@ -175,9 +175,13 @@ class DocsCLI < Thor · 174 unmodified lines
175 private175 private
176 176
177 def find_docs(names)177 def find_docs(names)
178 names.map do |name|178 names.flat_map do |name|
179 name, version = name.split(/@|~/)179 name, version = name.split(/@|~/)
180 Docs.find(name, version)180 if version == 'all'
181 Docs.find(name, false).versions
182 else
183 Docs.find(name, version)
184 end
181 end185 end
182 end186 end
183 187
lib/tasks/sprites.thor+1−1
@@ -89,7 +89,7 @@ class SpritesCLI < Thor · 88 unmodified lines
89 # Unfortunately, it's not possible to get the value of a SCSS variable from a Thor task89 # Unfortunately, it's not possible to get the value of a SCSS variable from a Thor task
90 # Because hard-coding the value is even worse, we extract it using some regex90 # Because hard-coding the value is even worse, we extract it using some regex
91 path = 'assets/stylesheets/global/_variables-dark.scss'91 path = 'assets/stylesheets/global/_variables-dark.scss'
92 regex = /\$sidebarBackground:\s+([^;]+);/92 regex = /--sidebarBackground:\s+([^;]+);/
93 ChunkyPNG::Color.parse(File.read(path)[regex, 1])93 ChunkyPNG::Color.parse(File.read(path)[regex, 1])
94 end94 end
95 95
public/icons/docs/handlebars/16.png+0−0

Binary file not shown.

public/icons/docs/handlebars/16@2x.png+0−0

Binary file not shown.

public/icons/docs/handlebars/SOURCE+1−0
@@ -0,0 +1 @@
1https://github.com/yahoo/formatjs-site/tree/master/public/img
public/icons/docs/puppeteer/16.png+0−0

Binary file not shown.

public/icons/docs/puppeteer/16@2x.png+0−0

Binary file not shown.

public/icons/docs/puppeteer/SOURCE+1−0
@@ -0,0 +1 @@
1https://github.com/GoogleChromeLabs/pptr.dev/tree/master/src/favicons
public/images/webapp-icon-512.png+0−0

Binary file not shown.

public/manifest.json+5−0
@@ -29,6 +29,11 @@ · 28 unmodified lines
29 "src": "/images/webapp-icon-256.png",29 "src": "/images/webapp-icon-256.png",
30 "sizes": "256x256",30 "sizes": "256x256",
31 "type": "image/png"31 "type": "image/png"
32 },
33 {
34 "src": "/images/webapp-icon-512.png",
35 "sizes": "512x512",
36 "type": "image/png"
32 }37 }
33 ]38 ]
34}39}
test/app_test.rb+43−21
@@ -11,6 +11,16 @@ class AppTest < MiniTest::Spec · 10 unmodified lines
11 App11 App
12 end12 end
13 13
14 before do
15 current_session.env('HTTPS', 'on')
16 end
17
18 it 'redirects to HTTPS' do
19 get 'http://example.com/test?q=1', {}, 'HTTPS' => 'off'
20 assert last_response.redirect?
21 assert_equal 'https://example.com/test?q=1', last_response['Location']
22 end
23
14 describe "/" do24 describe "/" do
15 it "works" do25 it "works" do
16 get '/'26 get '/'
@@ -20,13 +30,13 @@ class AppTest < MiniTest::Spec · 3 unmodified lines
20 it "redirects to /#q= when there is a 'q' query param" do30 it "redirects to /#q= when there is a 'q' query param" do
21 get '/search', q: 'foo'31 get '/search', q: 'foo'
22 assert last_response.redirect?32 assert last_response.redirect?
23 assert_equal 'http://example.org/#q=foo', last_response['Location']33 assert_equal 'https://example.org/#q=foo', last_response['Location']
24 end34 end
25 35
26 it "redirects without the query string" do36 it "redirects without the query string" do
27 get '/', foo: 'bar'37 get '/', foo: 'bar'
28 assert last_response.redirect?38 assert last_response.redirect?
29 assert_equal 'http://example.org/', last_response['Location']39 assert_equal 'https://example.org/', last_response['Location']
30 end40 end
31 41
32 it "sets default size" do42 it "sets default size" do
@@ -45,6 +55,18 @@ class AppTest < MiniTest::Spec · 12 unmodified lines
45 get '/'55 get '/'
46 assert_includes last_response.body, '<body class="foo">'56 assert_includes last_response.body, '<body class="foo">'
47 end57 end
58
59 it "sets the <html> theme from cookie" do
60 get '/'
61 assert_match %r{<html [^>]*class="[^\"]*_theme-default}, last_response.body
62 refute_includes last_response.body, '_theme-dark'
63
64 set_cookie('dark=1')
65
66 get '/'
67 assert_match %r{<html [^>]*class="[^\"]*_theme-dark}, last_response.body
68 refute_includes last_response.body, '_theme-default'
69 end
48 end70 end
49 71
50 describe "/[static-page]" do72 describe "/[static-page]" do
@@ -52,7 +74,7 @@ class AppTest < MiniTest::Spec · 1 unmodified line
52 %w(offline about news help).each do |page|74 %w(offline about news help).each do |page|
53 get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER75 get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER
54 assert last_response.redirect?76 assert last_response.redirect?
55 assert_equal "http://example.org/#/#{page}", last_response['Location']77 assert_equal "https://example.org/#/#{page}", last_response['Location']
56 end78 end
57 end79 end
58 80
@@ -61,7 +83,7 @@ class AppTest < MiniTest::Spec · 2 unmodified lines
61 set_cookie('foo=bar')83 set_cookie('foo=bar')
62 get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER84 get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER
63 assert last_response.redirect?85 assert last_response.redirect?
64 assert_equal 'http://example.org/', last_response['Location']86 assert_equal 'https://example.org/', last_response['Location']
65 assert last_response['Set-Cookie'].start_with?("initial_path=%2F#{page}; path=/; expires=")87 assert last_response['Set-Cookie'].start_with?("initial_path=%2F#{page}; path=/; expires=")
66 end88 end
67 end89 end
@@ -71,11 +93,11 @@ class AppTest < MiniTest::Spec · 3 unmodified lines
71 it "redirects to /#q=" do93 it "redirects to /#q=" do
72 get '/search'94 get '/search'
73 assert last_response.redirect?95 assert last_response.redirect?
74 assert_equal 'http://example.org/#q=', last_response['Location']96 assert_equal 'https://example.org/#q=', last_response['Location']
75 97
76 get '/search', q: 'foo'98 get '/search', q: 'foo'
77 assert last_response.redirect?99 assert last_response.redirect?
78 assert_equal 'http://example.org/#q=foo', last_response['Location']100 assert_equal 'https://example.org/#q=foo', last_response['Location']
79 end101 end
80 end102 end
81 103
@@ -148,7 +170,7 @@ class AppTest < MiniTest::Spec · 66 unmodified lines
148 set_cookie('docs=html~5')170 set_cookie('docs=html~5')
149 get '/html~5/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER171 get '/html~5/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER
150 assert last_response.redirect?172 assert last_response.redirect?
151 assert_equal 'http://example.org/', last_response['Location']173 assert_equal 'https://example.org/', last_response['Location']
152 assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%7E5%2F; path=/; expires=")174 assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%7E5%2F; path=/; expires=")
153 end175 end
154 176
@@ -161,13 +183,13 @@ class AppTest < MiniTest::Spec · 6 unmodified lines
161 set_cookie('docs=html~5')183 set_cookie('docs=html~5')
162 get '/html/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER184 get '/html/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER
163 assert last_response.redirect?185 assert last_response.redirect?
164 assert_equal 'http://example.org/', last_response['Location']186 assert_equal 'https://example.org/', last_response['Location']
165 assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%2F; path=/; expires=")187 assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%2F; path=/; expires=")
166 end188 end
167 189
168 it "renders when the doc exists and is enabled, and the request is from Googlebot" do190 it "renders when the doc exists and is enabled, and the request is from Googlebot" do
169 set_cookie('docs=html')191 set_cookie('docs=html')
170 get '/html/', {}, 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)'192 get '/html/', {}, 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)'
171 assert last_response.ok?193 assert last_response.ok?
172 end194 end
173 195
@@ -187,17 +209,17 @@ class AppTest < MiniTest::Spec · 13 unmodified lines
187 it "redirects with trailing slash" do209 it "redirects with trailing slash" do
188 get '/html'210 get '/html'
189 assert last_response.redirect?211 assert last_response.redirect?
190 assert_equal 'http://example.org/html/', last_response['Location']212 assert_equal 'https://example.org/html/', last_response['Location']
191 213
192 get '/html', bar: 'baz'214 get '/html', bar: 'baz'
193 assert last_response.redirect?215 assert last_response.redirect?
194 assert_equal 'http://example.org/html/?bar=baz', last_response['Location']216 assert_equal 'https://example.org/html/?bar=baz', last_response['Location']
195 end217 end
196 218
197 it "redirects old docs" do219 it "redirects old docs" do
198 get '/iojs/'220 get '/iojs/'
199 assert last_response.redirect?221 assert last_response.redirect?
200 assert_equal 'http://example.org/node/', last_response['Location']222 assert_equal 'https://example.org/node/', last_response['Location']
201 end223 end
202 end224 end
203 225
@@ -232,17 +254,17 @@ class AppTest < MiniTest::Spec · 28 unmodified lines
232 it "redirects with trailing slash" do254 it "redirects with trailing slash" do
233 get '/css-foo'255 get '/css-foo'
234 assert last_response.redirect?256 assert last_response.redirect?
235 assert_equal 'http://example.org/css-foo/', last_response['Location']257 assert_equal 'https://example.org/css-foo/', last_response['Location']
236 258
237 get '/css-foo', bar: 'baz'259 get '/css-foo', bar: 'baz'
238 assert last_response.redirect?260 assert last_response.redirect?
239 assert_equal 'http://example.org/css-foo/?bar=baz', last_response['Location']261 assert_equal 'https://example.org/css-foo/?bar=baz', last_response['Location']
240 end262 end
241 263
242 it "redirects old docs" do264 it "redirects old docs" do
243 get '/yii1-foo/'265 get '/yii1-foo/'
244 assert last_response.redirect?266 assert last_response.redirect?
245 assert_equal 'http://example.org/yii~1.1-foo/', last_response['Location']267 assert_equal 'https://example.org/yii~1.1-foo/', last_response['Location']
246 end268 end
247 end269 end
248 270
@@ -263,17 +285,17 @@ class AppTest < MiniTest::Spec · 14 unmodified lines
263 it "redirects without trailing slash" do285 it "redirects without trailing slash" do
264 get '/css/foo/'286 get '/css/foo/'
265 assert last_response.redirect?287 assert last_response.redirect?
266 assert_equal 'http://example.org/css/foo', last_response['Location']288 assert_equal 'https://example.org/css/foo', last_response['Location']
267 289
268 get '/css/foo/', bar: 'baz'290 get '/css/foo/', bar: 'baz'
269 assert last_response.redirect?291 assert last_response.redirect?
270 assert_equal 'http://example.org/css/foo?bar=baz', last_response['Location']292 assert_equal 'https://example.org/css/foo?bar=baz', last_response['Location']
271 end293 end
272 294
273 it "redirects old docs" do295 it "redirects old docs" do
274 get '/python2/foo'296 get '/python2/foo'
275 assert last_response.redirect?297 assert last_response.redirect?
276 assert_equal 'http://example.org/python~2.7/foo', last_response['Location']298 assert_equal 'https://example.org/python~2.7/foo', last_response['Location']
277 end299 end
278 end300 end
279 301
@@ -281,7 +303,7 @@ class AppTest < MiniTest::Spec · 1 unmodified line
281 it "returns to the asset path" do303 it "returns to the asset path" do
282 get '/docs.json'304 get '/docs.json'
283 assert last_response.redirect?305 assert last_response.redirect?
284 assert_equal 'http://example.org/assets/docs.json', last_response['Location']306 assert_equal 'https://example.org/assets/docs.json', last_response['Location']
285 end307 end
286 end308 end
287 309
@@ -289,7 +311,7 @@ class AppTest < MiniTest::Spec · 1 unmodified line
289 it "returns to the asset path" do311 it "returns to the asset path" do
290 get '/application.js'312 get '/application.js'
291 assert last_response.redirect?313 assert last_response.redirect?
292 assert_equal 'http://example.org/assets/application.js', last_response['Location']314 assert_equal 'https://example.org/assets/application.js', last_response['Location']
293 end315 end
294 end316 end
295 317
@@ -297,7 +319,7 @@ class AppTest < MiniTest::Spec · 1 unmodified line
297 it "returns to the asset path" do319 it "returns to the asset path" do
298 get '/application.css'320 get '/application.css'
299 assert last_response.redirect?321 assert last_response.redirect?
300 assert_equal 'http://example.org/assets/application.css', last_response['Location']322 assert_equal 'https://example.org/assets/application.css', last_response['Location']
301 end323 end
302 end324 end
303 325
views/index.erb+2−2
@@ -1,5 +1,5 @@
1<!DOCTYPE html>1<!DOCTYPE html>
2<html<%= ' manifest="/manifest.appcache"' if App.production? %> prefix="og: http://ogp.me/ns#" lang="en" class="_booting">2<html<%= ' manifest="/manifest.appcache"' if App.production? %> prefix="og: http://ogp.me/ns#" lang="en" class="_booting _theme-<%= app_theme %>">
3<head>3<head>
4 <meta charset="utf-8">4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no">5 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no">
@@ -30,7 +30,7 @@ · 24 unmodified lines
30 <link rel="apple-touch-icon" sizes="152x152" href="<%= App.cdn_origin %>/images/apple-icon-152.png">30 <link rel="apple-touch-icon" sizes="152x152" href="<%= App.cdn_origin %>/images/apple-icon-152.png">
31 <link rel="apple-touch-icon" sizes="160x160" href="<%= App.cdn_origin %>/images/apple-icon-160.png">31 <link rel="apple-touch-icon" sizes="160x160" href="<%= App.cdn_origin %>/images/apple-icon-160.png">
32 <link rel="mask-icon" href="<%= App.cdn_origin %>/images/webkit-mask-icon.svg" color="#398df0">32 <link rel="mask-icon" href="<%= App.cdn_origin %>/images/webkit-mask-icon.svg" color="#398df0">
33 <link rel="stylesheet" href="<%= main_stylesheet_path %>" data-alt="<%= alternate_stylesheet_path %>">33 <%= stylesheet_tag 'application' %>
34</head>34</head>
35<body<%= %( class="#{app_layout}") if app_layout %>>35<body<%= %( class="#{app_layout}") if app_layout %>>
36<noscript class="_fail">DevDocs requires JavaScript to run.</noscript>36<noscript class="_fail">DevDocs requires JavaScript to run.</noscript>
views/other.erb+2−2
@@ -1,5 +1,5 @@
1<!DOCTYPE html>1<!DOCTYPE html>
2<html lang="en" class="_booting">2<html lang="en" class="_booting _theme-<%= app_theme %>">
3<head>3<head>
4 <meta charset="utf-8">4 <meta charset="utf-8">
5 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">5 <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
@@ -11,7 +11,7 @@ · 5 unmodified lines
11 <link rel="manifest" href="/manifest.json">11 <link rel="manifest" href="/manifest.json">
12 <link rel="icon" type="image/x-icon" href="<%= App.cdn_origin %>/favicon.ico">12 <link rel="icon" type="image/x-icon" href="<%= App.cdn_origin %>/favicon.ico">
13 <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Search DevDocs">13 <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Search DevDocs">
14 <link rel="stylesheet" href="<%= main_stylesheet_path %>" data-alt="<%= alternate_stylesheet_path %>">14 <%= stylesheet_tag 'application' %>
15</head>15</head>
16<body<%= %( class="#{app_layout}") if app_layout %> data-doc="<%= CGI::escape_html @doc.to_json %>">16<body<%= %( class="#{app_layout}") if app_layout %> data-doc="<%= CGI::escape_html @doc.to_json %>">
17<noscript class="_fail">DevDocs requires JavaScript to run.</noscript>17<noscript class="_fail">DevDocs requires JavaScript to run.</noscript>
views/unsupported.erb+4−7
@@ -10,13 +10,10 @@ · 9 unmodified lines
10 <h1 class="_fail-title">Your browser is unsupported, sorry.</h1>10 <h1 class="_fail-title">Your browser is unsupported, sorry.</h1>
11 <p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers:</p>11 <p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers:</p>
12 <ul class="_fail-list">12 <ul class="_fail-list">
13 <li>Recent versions of Chrome and Firefox</li>13 <li>Recent versions of Firefox, Chrome, or Opera</li>
14 <li>Safari 5.1+</li>14 <li>Safari 9.1+</li>
15 <li>Opera 12.1+</li>15 <li>Edge 16+</li>
16 <li>Internet Explorer 10+</li>16 <li>iOS 10+</li>
17 <li>iOS 6+</li>
18 <li>Android 4.1+</li>
19 <li>Windows Phone 8+</li>
20 </ul>17 </ul>
21 <p class="_fail-text">18 <p class="_fail-text">
22 If you're unable to upgrade, I apologize.19 If you're unable to upgrade, I apologize.