Fix merge conflict

pull/841/head
Jasper van Merle 6 years ago
commit 536fa35ff9

@ -0,0 +1,8 @@
root = true
[*]
charset = utf-8
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true

@ -1,4 +1,7 @@
language: ruby language: ruby
cache: bundler
before_script: before_script:
- gem update --system - gem update --system
- gem install bundler - gem install bundler

@ -1,5 +1,7 @@
FROM ruby:2.5.1 FROM ruby:2.5.1
ENV LANG=C.UTF-8
WORKDIR /devdocs WORKDIR /devdocs
RUN apt-get update && \ RUN apt-get update && \

@ -1,5 +1,7 @@
FROM ruby:2.5.1-alpine FROM ruby:2.5.1-alpine
ENV LANG=C.UTF-8
WORKDIR /devdocs WORKDIR /devdocs
COPY . /devdocs COPY . /devdocs

@ -11,6 +11,7 @@ group :app do
gem 'rack' gem 'rack'
gem 'sinatra' gem 'sinatra'
gem 'sinatra-contrib' gem 'sinatra-contrib'
gem 'rack-ssl-enforcer'
gem 'thin' gem 'thin'
gem 'sprockets' gem 'sprockets'
gem 'sprockets-helpers' gem 'sprockets-helpers'

@ -1,13 +1,13 @@
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
activesupport (5.2.0) activesupport (5.2.1)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
tzinfo (~> 1.1) tzinfo (~> 1.1)
backports (3.11.3) backports (3.11.4)
better_errors (2.4.0) better_errors (2.5.0)
coderay (>= 1.0.0) coderay (>= 1.0.0)
erubi (>= 1.0.0) erubi (>= 1.0.0)
rack (>= 0.9.0) rack (>= 0.9.0)
@ -27,75 +27,78 @@ GEM
exifr (1.3.4) exifr (1.3.4)
ffi (1.9.25) ffi (1.9.25)
fspath (3.1.0) fspath (3.1.0)
highline (1.7.10) highline (2.0.0)
html-pipeline (2.8.3) html-pipeline (2.8.4)
activesupport (>= 2) activesupport (>= 2)
nokogiri (>= 1.4) nokogiri (>= 1.4)
i18n (1.0.1) i18n (1.1.0)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
image_optim (0.26.1) image_optim (0.26.2)
exifr (~> 1.2, >= 1.2.2) exifr (~> 1.2, >= 1.2.2)
fspath (~> 3.0) fspath (~> 3.0)
image_size (~> 1.5) image_size (>= 1.5, < 3)
in_threads (~> 1.3) in_threads (~> 1.3)
progress (~> 3.0, >= 3.0.1) progress (~> 3.0, >= 3.0.1)
image_optim_pack (0.5.1) image_optim_pack (0.5.1)
fspath (>= 2.1, < 4) fspath (>= 2.1, < 4)
image_optim (~> 0.19) image_optim (~> 0.19)
image_size (1.5.0) image_size (2.0.0)
in_threads (1.5.0) in_threads (1.5.0)
method_source (0.9.0) method_source (0.9.0)
mini_portile2 (2.3.0) mini_portile2 (2.3.0)
minitest (5.11.3) minitest (5.11.3)
multi_json (1.13.1) multi_json (1.13.1)
mustermann (1.0.2) mustermann (1.0.3)
newrelic_rpm (5.2.0.345) newrelic_rpm (5.4.0.347)
nokogiri (1.8.4) nokogiri (1.8.4)
mini_portile2 (~> 2.3.0) mini_portile2 (~> 2.3.0)
options (2.3.2) options (2.3.2)
progress (3.4.0) progress (3.4.0)
progress_bar (1.2.0) progress_bar (1.3.0)
highline (~> 1.6) highline (>= 1.6, < 3)
options (~> 2.3.0) options (~> 2.3.0)
pry (0.11.3) pry (0.11.3)
coderay (~> 1.1.0) coderay (~> 1.1.0)
method_source (~> 0.9.0) method_source (~> 0.9.0)
rack (2.0.5) rack (2.0.5)
rack-protection (2.0.3) rack-protection (2.0.4)
rack rack
rack-test (1.0.0) rack-ssl-enforcer (0.2.9)
rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rake (12.3.1) rake (12.3.1)
rb-fsevent (0.10.3) rb-fsevent (0.10.3)
rb-inotify (0.9.10) rb-inotify (0.9.10)
ffi (>= 0.5.0, < 2) ffi (>= 0.5.0, < 2)
rr (1.2.1) rr (1.2.1)
sass (3.5.6) sass (3.6.0)
sass-listen (~> 4.0.0) sass-listen (~> 4.0.0)
sass-listen (4.0.0) sass-listen (4.0.0)
rb-fsevent (~> 0.9, >= 0.9.4) rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7) rb-inotify (~> 0.9, >= 0.9.7)
sinatra (2.0.3) sinatra (2.0.4)
mustermann (~> 1.0) mustermann (~> 1.0)
rack (~> 2.0) rack (~> 2.0)
rack-protection (= 2.0.3) rack-protection (= 2.0.4)
tilt (~> 2.0) tilt (~> 2.0)
sinatra-contrib (2.0.3) sinatra-contrib (2.0.4)
activesupport (>= 4.0.0) activesupport (>= 4.0.0)
backports (>= 2.8.2) backports (>= 2.8.2)
multi_json multi_json
mustermann (~> 1.0) mustermann (~> 1.0)
rack-protection (= 2.0.3) rack-protection (= 2.0.4)
sinatra (= 2.0.3) sinatra (= 2.0.4)
tilt (>= 1.3, < 3) tilt (>= 1.3, < 3)
sprockets (3.7.2) sprockets (3.7.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
rack (> 1, < 3) rack (> 1, < 3)
sprockets-helpers (1.2.1) sprockets-helpers (1.2.1)
sprockets (>= 2.2) sprockets (>= 2.2)
strings (0.1.1) strings (0.1.4)
unicode-display_width (~> 1.3.0) strings-ansi (~> 0.1.0)
unicode-display_width (~> 1.4.0)
unicode_utils (~> 1.4.0) unicode_utils (~> 1.4.0)
strings-ansi (0.1.0)
thin (1.7.2) thin (1.7.2)
daemons (~> 1.0, >= 1.0.9) daemons (~> 1.0, >= 1.0.9)
eventmachine (~> 1.0, >= 1.0.4) eventmachine (~> 1.0, >= 1.0.4)
@ -107,18 +110,18 @@ GEM
strings (~> 0.1.0) strings (~> 0.1.0)
tty-screen (~> 0.6.4) tty-screen (~> 0.6.4)
tty-which (~> 0.3.0) tty-which (~> 0.3.0)
tty-screen (0.6.4) tty-screen (0.6.5)
tty-which (0.3.0) tty-which (0.3.0)
typhoeus (1.3.0) typhoeus (1.3.0)
ethon (>= 0.9.0) ethon (>= 0.9.0)
tzinfo (1.2.5) tzinfo (1.2.5)
thread_safe (~> 0.1) thread_safe (~> 0.1)
uglifier (4.1.14) uglifier (4.1.19)
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
unicode-display_width (1.3.3) unicode-display_width (1.4.0)
unicode_utils (1.4.0) unicode_utils (1.4.0)
unix_utils (0.0.15) unix_utils (0.0.15)
yajl-ruby (1.4.0) yajl-ruby (1.4.1)
PLATFORMS PLATFORMS
ruby ruby
@ -138,6 +141,7 @@ DEPENDENCIES
progress_bar progress_bar
pry (~> 0.11.0) pry (~> 0.11.0)
rack rack
rack-ssl-enforcer
rack-test rack-test
rake rake
rr rr

@ -64,14 +64,10 @@ Another driving factor is performance and the fact that everything happens in th
DevDocs being a developer tool, the browser requirements are high: DevDocs being a developer tool, the browser requirements are high:
1. On the desktop: * Recent versions of Firefox, Chrome, or Opera
* Recent version of Chrome, Firefox, or Opera * Safari 9.1+
* Safari 8+ * Edge 16+
* IE / Edge 10+ * iOS 10+
2. On mobile:
* iOS 8+
* Android 4.1+
* Windows Phone 8+
This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun! This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun!

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

After

Width:  |  Height:  |  Size: 48 KiB

@ -245,7 +245,7 @@
matchMedia: !!window.matchMedia matchMedia: !!window.matchMedia
insertAdjacentHTML: !!document.body.insertAdjacentHTML insertAdjacentHTML: !!document.body.insertAdjacentHTML
defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false
cssGradients: supportsCssGradients() cssVariables: CSS.supports and CSS.supports('(--t: 0)')
for key, value of features when not value for key, value of features when not value
Raven.captureMessage "unsupported/#{key}", level: 'info' Raven.captureMessage "unsupported/#{key}", level: 'info'
@ -268,9 +268,4 @@
isInvalidLocation: -> isInvalidLocation: ->
@config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0 @config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0
supportsCssGradients = ->
el = document.createElement('div')
el.style.cssText = "background-image: -webkit-linear-gradient(top, #000, #fff); background-image: linear-gradient(to top, #000, #fff);"
el.style.backgroundImage.indexOf('gradient') >= 0
$.extend app, Events $.extend app, Events

@ -149,6 +149,9 @@ class app.Shortcuts
when 40 when 40
@trigger 'altDown' @trigger 'altDown'
false false
when 68
@trigger 'altD'
false
when 70 when 70
@trigger 'altF', event @trigger 'altF', event
when 71 when 71

@ -190,7 +190,7 @@ isSameOrigin = (url) ->
updateCanonicalLink = -> updateCanonicalLink = ->
@canonicalLink ||= document.head.querySelector('link[rel="canonical"]') @canonicalLink ||= document.head.querySelector('link[rel="canonical"]')
@canonicalLink.setAttribute('href', "http://#{location.host}#{location.pathname}") @canonicalLink.setAttribute('href', "https://#{location.host}#{location.pathname}")
trackers = [] trackers = []

@ -1,5 +1,14 @@
[ [
[ [
"2018-09-23",
"New documentations: <a href=\"/puppeteer/\">Puppeteer</a> and <a href=\"/handlebars/\">Handlebars.js</a>"
], [
"2018-08-12",
"New documentations: <a href=\"/dart/\">Dart</a> and <a href=\"/qt/\">Qt</a>"
], [
"2018-07-29",
"New documentations: <a href=\"/bash/\">Bash</a>, <a href=\"/graphite/\">Graphite</a> and <a href=\"/pygame/\">Pygame</a>"
], [
"2018-07-08", "2018-07-08",
"New documentations: <a href=\"/leaflet/\">Leaflet</a>, <a href=\"/terraform/\">Terraform</a> and <a href=\"/koa/\">Koa</a>" "New documentations: <a href=\"/leaflet/\">Leaflet</a>, <a href=\"/terraform/\">Terraform</a> and <a href=\"/koa/\">Koa</a>"
], [ ], [

@ -56,13 +56,10 @@ app.templates.unsupportedBrowser = """
<h1 class="_fail-title">Your browser is unsupported, sorry.</h1> <h1 class="_fail-title">Your browser is unsupported, sorry.</h1>
<p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers: <p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers:
<ul class="_fail-list"> <ul class="_fail-list">
<li>Recent versions of Chrome and Firefox <li>Recent versions of Firefox, Chrome, or Opera
<li>Safari 5.1+ <li>Safari 9.1+
<li>Opera 12.1+ <li>Edge 16+
<li>Internet Explorer 10+ <li>iOS 10+
<li>iOS 6+
<li>Android 4.1+
<li>Windows Phone 8+
</ul> </ul>
<p class="_fail-text"> <p class="_fail-text">
If you're unable to upgrade, I apologize. If you're unable to upgrade, I apologize.

@ -115,6 +115,11 @@ credits = [
'2010-2016 Jeremy Ashkenas, DocumentCloud', '2010-2016 Jeremy Ashkenas, DocumentCloud',
'MIT', 'MIT',
'https://raw.githubusercontent.com/jashkenas/backbone/master/LICENSE' 'https://raw.githubusercontent.com/jashkenas/backbone/master/LICENSE'
], [
'Bash',
'2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.',
'GFDL',
'https://www.gnu.org/licenses/fdl-1.3.en.html'
], [ ], [
'Bluebird', 'Bluebird',
'2013-2017 Petka Antonov', '2013-2017 Petka Antonov',
@ -162,7 +167,7 @@ credits = [
'https://github.com/clojure/clojure/blob/master/epl-v10.html' 'https://github.com/clojure/clojure/blob/master/epl-v10.html'
], [ ], [
'CMake', 'CMake',
'2000-2017 Kitware, Inc. and Contributors', '2000-2018 Kitware, Inc. and Contributors',
'BSD', 'BSD',
'https://cmake.org/licensing/' 'https://cmake.org/licensing/'
], [ ], [
@ -210,6 +215,11 @@ credits = [
'2010-2018 Michael Bostock', '2010-2018 Michael Bostock',
'BSD', 'BSD',
'https://raw.githubusercontent.com/d3/d3/master/LICENSE' 'https://raw.githubusercontent.com/d3/d3/master/LICENSE'
], [
'Dart',
'2012 the Dart project authors',
'CC BY-SA',
'https://creativecommons.org/licenses/by-sa/4.0/'
], [ ], [
'Django', 'Django',
'Django Software Foundation and individual contributors', 'Django Software Foundation and individual contributors',
@ -290,11 +300,21 @@ credits = [
'2014-2018 Juan Linietsky, Ariel Manzur, Godot Engine contributors', '2014-2018 Juan Linietsky, Ariel Manzur, Godot Engine contributors',
'MIT', 'MIT',
'https://raw.githubusercontent.com/godotengine/godot/master/LICENSE.txt' 'https://raw.githubusercontent.com/godotengine/godot/master/LICENSE.txt'
], [
'Graphite',
'2008-2012 Chris Davis<br>&copy; 2011-2016 The Graphite Project',
'Apache',
'https://raw.githubusercontent.com/graphite-project/graphite-web/master/LICENSE'
], [ ], [
'Grunt', 'Grunt',
'GruntJS Team', 'GruntJS Team',
'MIT', 'MIT',
'https://github.com/gruntjs/grunt-docs/blob/master/package.json#L10' 'https://github.com/gruntjs/grunt-docs/blob/master/package.json#L10'
], [
'Handlebars',
'2011-2017 Yehuda Katz',
'MIT',
'https://raw.githubusercontent.com/wycats/handlebars.js/master/LICENSE'
], [ ], [
'Haskell', 'Haskell',
'The University of Glasgow', 'The University of Glasgow',
@ -550,6 +570,16 @@ credits = [
'1996-2018 The PostgreSQL Global Development Group<br>&copy; 1994 The Regents of the University of California', '1996-2018 The PostgreSQL Global Development Group<br>&copy; 1994 The Regents of the University of California',
'PostgreSQL', 'PostgreSQL',
'https://www.postgresql.org/about/licence/' 'https://www.postgresql.org/about/licence/'
], [
'Puppeteer',
'2017 Google Inc',
'Apache',
'https://raw.githubusercontent.com/GoogleChrome/puppeteer/master/LICENSE'
], [
'Pygame',
'Pygame Developpers',
'LGPLv2.1',
'https://raw.githubusercontent.com/pygame/pygame/master/LICENSE'
], [ ], [
'Python', 'Python',
'2001-2018 Python Software Foundation<br>Python is a trademark of the Python Software Foundation.', '2001-2018 Python Software Foundation<br>Python is a trademark of the Python Software Foundation.',
@ -560,6 +590,11 @@ credits = [
'2009-2017 Kristopher Michael Kowal', '2009-2017 Kristopher Michael Kowal',
'MIT', 'MIT',
'https://raw.githubusercontent.com/kriskowal/q/master/LICENSE' 'https://raw.githubusercontent.com/kriskowal/q/master/LICENSE'
], [
'Qt',
'2012-2018 The Qt Company Ltd',
'GFDL',
'https://doc.qt.io/qt-5/licensing.html'
], [ ], [
'Ramda', 'Ramda',
'2013-2016 Scott Sauyet and Michael Hurley', '2013-2016 Scott Sauyet and Michael Hurley',

@ -131,6 +131,9 @@ app.templates.helpPage = ->
<dt class="_shortcuts-dt"> <dt class="_shortcuts-dt">
<code class="_shortcut-code">alt + s</code> <code class="_shortcut-code">alt + s</code>
<dd class="_shortcuts-dd">Search on Stack Overflow <dd class="_shortcuts-dd">Search on Stack Overflow
<dt class="_shortcuts-dt">
<code class="_shortcut-code">alt + d</code>
<dd class="_shortcuts-dd">Search on DuckDuckGo
</dl> </dl>
<p class="_note _note-green"> <p class="_note _note-green">
<strong>Tip:</strong> If the cursor is no longer in the search field, press <code class="_label">/</code> or <strong>Tip:</strong> If the cursor is no longer in the search field, press <code class="_label">/</code> or

@ -72,14 +72,3 @@ app.templates.androidWarning = """
<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. <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.
</div> </div>
""" """
app.templates.httpWarning = """
<div class="_intro"><div class="_intro-message">
<h2 class="_intro-title">Hi there!</h2>
<p>DevDocs is migrating to HTTPS.
<p>Please update your bookmarks to point to <a href="https://devdocs.io">https://devdocs.io</a>.
<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.
<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.
<p>Thanks for using DevDocs, and happy coding!
</div></div>
"""

File diff suppressed because one or more lines are too long

@ -19,10 +19,6 @@ class app.views.RootPage extends app.View
else else
'intro' 'intro'
# temporary
if location.host is 'devdocs.io' and location.protocol is 'http:'
tmpl = 'httpWarning'
@append @tmpl(tmpl) @append @tmpl(tmpl)
return return

@ -24,10 +24,9 @@ class app.views.SettingsPage extends app.View
'Preferences' 'Preferences'
toggleDark: (enable) -> toggleDark: (enable) ->
css = $('link[rel="stylesheet"][data-alt]') html = document.documentElement
alt = css.getAttribute('data-alt') html.classList.toggle('_theme-default')
css.setAttribute('data-alt', css.getAttribute('href')) html.classList.toggle('_theme-dark')
css.setAttribute('href', alt)
app.settings.set('dark', !!enable) app.settings.set('dark', !!enable)
app.appCache?.updateInBackground() app.appCache?.updateInBackground()
return return

@ -17,6 +17,7 @@ class app.views.Search extends app.View
typing: 'focus' typing: 'focus'
altG: 'google' altG: 'google'
altS: 'stackoverflow' altS: 'stackoverflow'
altD: 'duckduckgo'
@routes: @routes:
after: 'afterRoute' after: 'afterRoute'
@ -113,6 +114,10 @@ class app.views.Search extends app.View
@externalSearch "https://stackoverflow.com/search?q=" @externalSearch "https://stackoverflow.com/search?q="
return return
duckduckgo: =>
@externalSearch "https://duckduckgo.com/?t=devdocs&q="
return
onResults: (results) => onResults: (results) =>
@hasResults = true if results.length @hasResults = true if results.length
@trigger 'results', results, @flags @trigger 'results', results, @flags

@ -1,105 +0,0 @@
//= depend_on docs-1.png
//= depend_on docs-1@2x.png
//= depend_on docs-2.png
//= depend_on docs-2@2x.png
/*!
* Copyright 2013-2018 Thibaut Courouble and other contributors
*
* This source code is licensed under the terms of the Mozilla
* Public License, v. 2.0, a copy of which may be obtained at:
* http://mozilla.org/MPL/2.0/
*/
@import 'global/variables-dark',
'global/mixins',
'global/icons',
'global/classes',
'global/base';
@import 'components/app',
'components/header',
'components/notif',
'components/sidebar',
'components/settings',
'components/content',
'components/page',
'components/fail',
'components/path',
'components/notice',
'components/prism',
'components/mobile';
@import 'pages/simple',
'pages/angular',
'pages/angularjs',
'pages/apache',
'pages/async',
'pages/bootstrap',
'pages/c',
'pages/cakephp',
'pages/clojure',
'pages/codeception',
'pages/coffeescript',
'pages/cordova',
'pages/crystal',
'pages/d',
'pages/d3',
'pages/dojo',
'pages/drupal',
'pages/elixir',
'pages/ember',
'pages/erlang',
'pages/express',
'pages/git',
'pages/github',
'pages/go',
'pages/haskell',
'pages/jekyll',
'pages/jquery',
'pages/julia',
'pages/knockout',
'pages/kotlin',
'pages/laravel',
'pages/liquid',
'pages/love',
'pages/lua',
'pages/mariadb',
'pages/mdn',
'pages/meteor',
'pages/modernizr',
'pages/moment',
'pages/nginx',
'pages/node',
'pages/npm',
'pages/openjdk',
'pages/perl',
'pages/phalcon',
'pages/phaser',
'pages/php',
'pages/phpunit',
'pages/postgres',
'pages/pug',
'pages/python',
'pages/ramda',
'pages/rdoc',
'pages/react_native',
'pages/redis',
'pages/rethinkdb',
'pages/rfc',
'pages/rubydoc',
'pages/rust',
'pages/sinon',
'pages/socketio',
'pages/sphinx',
'pages/sphinx_simple',
'pages/sqlite',
'pages/support_tables',
'pages/tcl_tk',
'pages/tensorflow',
'pages/terraform',
'pages/underscore',
'pages/vue',
'pages/webpack',
'pages/yard',
'pages/yii';

@ -11,7 +11,9 @@
* http://mozilla.org/MPL/2.0/ * http://mozilla.org/MPL/2.0/
*/ */
@import 'global/variables', @import 'global/variables-light',
'global/variables-dark',
'global/variables',
'global/mixins', 'global/mixins',
'global/icons', 'global/icons',
'global/classes', 'global/classes',
@ -35,6 +37,7 @@
'pages/angularjs', 'pages/angularjs',
'pages/apache', 'pages/apache',
'pages/async', 'pages/async',
'pages/bash',
'pages/bootstrap', 'pages/bootstrap',
'pages/c', 'pages/c',
'pages/cakephp', 'pages/cakephp',
@ -45,6 +48,7 @@
'pages/crystal', 'pages/crystal',
'pages/d', 'pages/d',
'pages/d3', 'pages/d3',
'pages/dart',
'pages/dojo', 'pages/dojo',
'pages/drupal', 'pages/drupal',
'pages/elixir', 'pages/elixir',
@ -54,6 +58,7 @@
'pages/git', 'pages/git',
'pages/github', 'pages/github',
'pages/go', 'pages/go',
'pages/graphite',
'pages/haskell', 'pages/haskell',
'pages/jekyll', 'pages/jekyll',
'pages/jquery', 'pages/jquery',
@ -81,6 +86,7 @@
'pages/postgres', 'pages/postgres',
'pages/pug', 'pages/pug',
'pages/python', 'pages/python',
'pages/qt',
'pages/ramda', 'pages/ramda',
'pages/rdoc', 'pages/rdoc',
'pages/react_native', 'pages/react_native',

@ -1,6 +1,6 @@
html._booting { background: $contentBackground; } html._booting { background: var(--contentBackground); }
body._max-width { background: none; } body._max-width { background: none; }
html._booting body._max-width { background: $documentBackground; } html._booting body._max-width { background: var(--documentBackground); }
._app { ._app {
position: relative; position: relative;
@ -15,8 +15,8 @@ html._booting body._max-width { background: $documentBackground; }
._max-width & { ._max-width & {
margin: 0 auto; margin: 0 auto;
max-width: $maxWidth; max-width: var(--maxWidth);
background: $contentBackground; background: var(--contentBackground);
box-shadow: 1px 0 $headerBorder, -1px 0 $headerBorder; box-shadow: 1px 0 var(--headerBorder), -1px 0 var(--headerBorder);
} }
} }

@ -4,13 +4,13 @@
._container { ._container {
position: relative; position: relative;
z-index: $contentZ; z-index: var(--contentZ);
height: 100%; height: 100%;
margin-left: $sidebarWidth; margin-left: var(--sidebarWidth);
pointer-events: none; pointer-events: none;
@extend %border-box; @extend %border-box;
@media #{$mediumScreen} { margin-left: $sidebarMediumWidth; } @include mobile { margin-left: var(--sidebarMediumWidth); }
._sidebar-hidden & { margin-left: 0; } ._sidebar-hidden & { margin-left: 0; }
body:not(._native-scrollbars) & { -webkit-margin-end: -1px; } body:not(._native-scrollbars) & { -webkit-margin-end: -1px; }
@ -30,7 +30,7 @@
._sidebar-hidden &:before { ._sidebar-hidden &:before {
content: ''; content: '';
display: block; display: block;
margin-top: $headerHeight; margin-top: var(--headerHeight);
} }
._overlay-scrollbars & { padding-left: .625rem; } ._overlay-scrollbars & { padding-left: .625rem; }
@ -54,7 +54,7 @@
font-size: 4rem; font-size: 4rem;
font-weight: 300; font-weight: 300;
letter-spacing: -.125rem; letter-spacing: -.125rem;
color: $loadingText; color: var(--loadingText);
text-align: center; text-align: center;
cursor: default; cursor: default;
} }
@ -68,7 +68,7 @@
// //
._splash-title { ._splash-title {
color: $splashText; color: var(--splashText);
@extend %loading, %user-select-none; @extend %loading, %user-select-none;
} }
@ -88,7 +88,7 @@
min-height: calc(100vh - 2.375rem); min-height: calc(100vh - 2.375rem);
._sidebar-hidden & { ._sidebar-hidden & {
min-height: calc(100vh - 2.375rem - #{$headerHeight}); min-height: calc(100vh - 2.375rem - var(--headerHeight));
} }
} }
@ -140,12 +140,12 @@
._error-text { ._error-text {
margin: 0 0 1rem; margin: 0 0 1rem;
color: $textColorLight; color: var(--textColorLight);
} }
._error-links { ._error-links {
font-size: 1rem; font-size: 1rem;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
} }
._error-link { padding: 0 .5rem; } ._error-link { padding: 0 .5rem; }
@ -167,7 +167,7 @@
height: 1px; height: 1px;
margin-top: .25rem; margin-top: .25rem;
margin-left: 1rem; margin-left: 1rem;
background: $boxBorderLight; background: var(--boxBorderLight);
} }
} }
@ -197,7 +197,7 @@
._toc-title { ._toc-title {
margin: 0 0 .5rem; margin: 0 0 .5rem;
font-size: inherit; font-size: inherit;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
} }
._toc-list { ._toc-list {
@ -252,7 +252,7 @@
._docs-size { ._docs-size {
text-align: right; text-align: right;
> small { color: $textColorLight; } > small { color: var(--textColorLight); }
} }
._docs-tools { ._docs-tools {
@ -285,7 +285,7 @@
padding: 0 .75rem; padding: 0 .75rem;
} }
._btn-link:not(._show) { display: none; } ._btn-link:not(._show) { display: none; }
._btn-link._show ~ ._btn-link._show { border-left: 1px solid $boxBorder; } ._btn-link._show ~ ._btn-link._show { border-left: 1px solid var(--boxBorder); }
} }
// //
@ -297,7 +297,7 @@
position: relative; position: relative;
padding-left: 10em; padding-left: 10em;
font-size: .8125rem; font-size: .8125rem;
color: $textColorLight; color: var(--textColorLight);
+ ._news-row { margin-top: 1em; } + ._news-row { margin-top: 1em; }
} }
@ -305,7 +305,7 @@
._news-title { ._news-title {
display: block; display: block;
font-size: .875rem; font-size: .875rem;
color: $textColor; color: var(--textColor);
} }
._news-date { ._news-date {
@ -372,12 +372,12 @@
// Utilities // Utilities
// //
._bold { font-weight: $boldFontWeight; } ._bold { font-weight: var(--boldFontWeight); }
._note { @extend %note; } ._note { @extend %note; }
._note-green { @extend %note-green; } ._note-green { @extend %note-green; }
._label { @extend %label; } ._label { @extend %label; }
._code { @extend %code; } ._code { @extend %code; }
._highlight { background: $highlightBackground !important; } ._highlight { background: var(--highlightBackground) !important; }
._table { width: 100%; } ._table { width: 100%; }
._mobile ._table { overflow-x: auto; } ._mobile ._table { overflow-x: auto; }
@ -396,12 +396,9 @@
pre:hover > & { display: block; } pre:hover > & { display: block; }
&:hover { opacity: 1; } &:hover { opacity: 1; }
> svg { @extend %svg-icon; } > svg {
@extend %svg-icon;
@if $style == 'dark' { fill: var(--absolute);
> svg { fill: white; }
} @else {
> svg { fill: black; }
} }
&._pre-clip-success > svg, &._pre-clip-success > svg,
@ -419,15 +416,13 @@
line-height: normal; line-height: normal;
white-space: nowrap; white-space: nowrap;
padding: .375rem .675rem; padding: .375rem .675rem;
background-image: linear-gradient(lighten($boxBackground, 4%), darken($boxBackground, 2%)); background-color: var(--boxBackground);
border: 1px solid $boxBorder; border: 1px solid var(--boxBorder);
border-radius: 3px; border-radius: 3px;
box-shadow: 0 1px rgba($boxBorder, .08);
cursor: pointer; cursor: pointer;
&:active { &:active {
background-color: $boxBackground; box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px var(--boxBorder);
box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px $boxBorder;
} }
} }
@ -447,18 +442,18 @@
._btn-link { ._btn-link {
line-height: inherit; line-height: inherit;
color: $linkColor; color: var(--linkColor);
text-decoration: $linkTextDecoration; text-decoration: var(--linkTextDecoration);
&:hover { &:hover {
color: $linkColorHover; color: var(--linkColorHover);
text-decoration: underline; text-decoration: underline;
} }
} }
._reset-btn, ._reset-btn,
._reset-btn:hover { ._reset-btn:hover {
color: $textColorRed; color: var(--textColorRed);
} }
._github-btn { ._github-btn {

@ -1,4 +1,4 @@
._fail { ._fail { // Don't use CSS variables, in case the browser doesn't support them.
display: block; display: block;
position: relative; position: relative;
top: 1.5rem; top: 1.5rem;
@ -23,7 +23,7 @@
._fail-title { ._fail-title {
margin: 0 0 1rem; margin: 0 0 1rem;
font-size: 1rem; font-size: 1rem;
font-weight: $boldFontWeight; font-weight: bold;
} }
._fail-text, ._fail-list { ._fail-text, ._fail-list {

@ -4,20 +4,20 @@
._header { ._header {
position: absolute; position: absolute;
z-index: $headerZ; z-index: var(--headerZ);
top: 0; top: 0;
left: 0; left: 0;
display: -ms-flexbox; display: -ms-flexbox;
display: flex; display: flex;
width: $sidebarWidth; width: var(--sidebarWidth);
height: $headerHeight; height: var(--headerHeight);
background: $headerBackground; background: var(--headerBackground);
border-bottom: 1px solid $headerBorder; border-bottom: 1px solid var(--headerBorder);
border-right: 1px solid $headerBorder; border-right: 1px solid var(--headerBorder);
@extend %border-box; @extend %border-box;
@extend %user-select-none; @extend %user-select-none;
@media #{$mediumScreen} { width: $sidebarMediumWidth; } @include mobile { width: var(--sidebarMediumWidth); }
} }
._header-left { ._header-left {
@ -35,7 +35,7 @@
flex: 0 0 auto; flex: 0 0 auto;
width: 2.25rem; width: 2.25rem;
height: 100%; height: 100%;
color: $textColorLight; color: var(--textColorLight);
text-align: center; text-align: center;
&[hidden] { display: none; } &[hidden] { display: none; }
@ -67,8 +67,8 @@
word-wrap: normal; word-wrap: normal;
overflow-wrap: normal; overflow-wrap: normal;
font-size: .875rem; font-size: .875rem;
background: $contentBackground; background: var(--contentBackground);
border: 1px solid $headerBorder; border: 1px solid var(--headerBorder);
border-radius: 3px; border-radius: 3px;
box-shadow: -1px 1px 1px rgba(black, .05); box-shadow: -1px 1px 1px rgba(black, .05);
transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms; transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms;
@ -98,10 +98,10 @@
margin: 0; margin: 0;
line-height: 1.5rem; line-height: 1.5rem;
font-size: 1rem; font-size: 1rem;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
letter-spacing: -.5px; letter-spacing: -.5px;
background: $sidebarBackground; background: var(--sidebarBackground);
border-bottom: 1px solid $sidebarBorder; border-bottom: 1px solid var(--sidebarBorder);
border-radius: 2px 2px 0 0; border-radius: 2px 2px 0 0;
} }
@ -109,7 +109,7 @@
._menu-title-link:hover { ._menu-title-link:hover {
display: block; display: block;
padding: .5rem 1rem; padding: .5rem 1rem;
color: $focusText; color: var(--focusText);
text-decoration: none; text-decoration: none;
} }
@ -121,9 +121,9 @@
text-decoration: none; text-decoration: none;
&:hover { &:hover {
color: $focusText; color: var(--focusText);
text-decoration: none; text-decoration: none;
background: $sidebarBackground; background: var(--sidebarBackground);
} }
&:last-child { border-radius: 0 0 2px 2px; } &:last-child { border-radius: 0 0 2px 2px; }
@ -151,11 +151,7 @@
opacity: .42; opacity: .42;
@extend %svg-icon; @extend %svg-icon;
@if $style == 'dark' { fill: var(--absolute);
fill: white;
} @else {
fill: black;
}
} }
} }
@ -166,21 +162,19 @@
height: 100%; height: 100%;
padding: 0 .75rem 1px 1.75rem; padding: 0 .75rem 1px 1.75rem;
font-size: .875rem; font-size: .875rem;
background: $contentBackground; background: var(--contentBackground);
border: 1px solid; border: 1px solid;
border-color: darken($headerBorder, 2%); border-color: var(--searchBorder);
border-radius: 3px; border-radius: 3px;
&:focus { &:focus {
outline: 0; outline: 0;
@if $inputFocusBorder { border-color: var(--inputFocusBorder);
border-color: $inputFocusBorder; box-shadow: 0 0 1px var(--inputFocusBorder);
box-shadow: 0 0 1px $inputFocusBorder;
}
} }
&[disabled] { &[disabled] {
background: $sidebarBackground; background: var(--sidebarBackground);
cursor: not-allowed; cursor: not-allowed;
} }
} }
@ -202,13 +196,9 @@
top: .5rem; top: .5rem;
left: .375rem; left: .375rem;
@extend %svg-icon; @extend %svg-icon;
fill: var(--absolute);
} }
@if $style == 'dark' {
> svg { fill: white; }
} @else {
> svg { fill: black; }
}
._search-active > & { display: block; } ._search-active > & { display: block; }
} }
@ -222,8 +212,8 @@
line-height: 1.25rem; line-height: 1.25rem;
max-width: 50%; max-width: 50%;
font-size: .8125rem; font-size: .8125rem;
color: $textColorLight; color: var(--textColorLight);
background: darken($headerBackground, 5%); background: var(--searchTagBackground);
border-radius: 2px; border-radius: 2px;
@extend %truncate-text; @extend %truncate-text;
} }

@ -4,7 +4,7 @@
._mobile { ._mobile {
font-size: 100%; font-size: 100%;
background: $contentBackground; background: var(--contentBackground);
._hide-on-mobile { display: none; } ._hide-on-mobile { display: none; }
@ -18,7 +18,7 @@
._container { ._container {
margin: 0; margin: 0;
padding-top: $headerHeight; padding-top: var(--headerHeight);
} }
._content { ._content {

@ -1,15 +1,15 @@
._notice { ._notice {
position: absolute; position: absolute;
z-index: $noticeZ; z-index: var(--noticeZ);
bottom: 0; bottom: 0;
left: $sidebarWidth; left: var(--sidebarWidth);
right: 0; right: 0;
height: 2.5rem; height: 2.5rem;
padding: 0 1.25rem; padding: 0 1.25rem;
background: $noticeBackground; background: var(--noticeBackground);
box-shadow: inset 0 1px $noticeBorder; box-shadow: inset 0 1px var(--noticeBorder);
@media #{$mediumScreen} { left: $sidebarMediumWidth; } @include mobile { left: var(--sidebarMediumWidth); }
._sidebar-hidden & { left: 0; } ._sidebar-hidden & { left: 0; }

@ -7,9 +7,9 @@
max-width: 90%; max-width: 90%;
padding: .625rem 1rem; padding: .625rem 1rem;
font-size: .75rem; font-size: .75rem;
color: $notifColor; color: var(--notifColor);
background: $notifBackground; background: var(--notifBackground);
border: $notifBorder; border: var(--notifBorder);
border-radius: .25rem; border-radius: .25rem;
transition: opacity .2s; transition: opacity .2s;
opacity: 0; opacity: 0;
@ -30,7 +30,7 @@
._notif-info { ._notif-info {
float: right; float: right;
color: $notifColorLight; color: var(--notifColorLight);
} }
._notif-link, ._notif-link,
@ -69,13 +69,13 @@
&::-webkit-scrollbar { width: 10px !important; } &::-webkit-scrollbar { width: 10px !important; }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
background: $notifBackground !important; background: var(--notifBackground) !important;
border: 0 !important; border: 0 !important;
border-radius: 5px !important; border-radius: 5px !important;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
border: 3px solid $notifBackground !important; border: 3px solid var(--notifBackground) !important;
&:hover, &:active { border-width: 2px !important; } &:hover, &:active { border-width: 2px !important; }
} }
@ -90,7 +90,7 @@
> ._news-row { > ._news-row {
line-height: 1.125rem; line-height: 1.125rem;
font-size: .6875rem; font-size: .6875rem;
color: $notifColorLight; color: var(--notifColorLight);
margin-bottom: .25rem; margin-bottom: .25rem;
+ ._news-row { margin-top: .625rem; } + ._news-row { margin-top: .625rem; }
@ -107,7 +107,7 @@
._news-date { ._news-date {
float: right; float: right;
margin-left: 1rem; margin-left: 1rem;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
} }
code { code {
@ -128,9 +128,9 @@
} }
._notif-tip { ._notif-tip {
color: $textColor; color: var(--textColor);
background: $tipBackground; background: var(--tipBackground);
border: $tipBorder; border: var(--tipBorder);
._notif-info { color: $textColorLight; } ._notif-info { color: var(--textColorLight); }
} }

@ -23,7 +23,7 @@
max-width: 100%; max-width: 100%;
margin-bottom: 1em; margin-bottom: 1em;
padding: 1px; padding: 1px;
border: 1px dotted $boxBorder; border: 1px dotted var(--boxBorder);
border-radius: 3px; border-radius: 3px;
@extend %border-box; @extend %border-box;
} }
@ -50,7 +50,7 @@
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
padding: 0 .5rem; padding: 0 .5rem;
background: $contentBackground; background: var(--contentBackground);
@extend %internal-link; @extend %internal-link;
& + & { margin-left: .75rem; } & + & { margin-left: .75rem; }
@ -66,7 +66,7 @@
clear: both; clear: both;
margin: 2rem 0 1.5rem; margin: 2rem 0 1.5rem;
font-size: .75rem; font-size: .75rem;
color: $textColorLight; color: var(--textColorLight);
text-align: center; text-align: center;
-webkit-font-smoothing: subpixel-antialiased; -webkit-font-smoothing: subpixel-antialiased;
@ -78,7 +78,7 @@
display: inline-block; display: inline-block;
margin: 0; margin: 0;
padding: .25rem .75rem; padding: .25rem .75rem;
background: $labelBackground; background: var(--labelBackground);
border-radius: 3px; border-radius: 3px;
} }

@ -1,17 +1,17 @@
._path { ._path {
position: absolute; position: absolute;
z-index: $noticeZ - 1; z-index: var(--headerZ);
bottom: 0; bottom: 0;
left: $sidebarWidth; left: var(--sidebarWidth);
right: 0; right: 0;
height: 2rem; height: 2rem;
line-height: 2rem; line-height: 2rem;
padding: 0 .375rem; padding: 0 .375rem;
font-size: .875rem; font-size: .875rem;
background: $pathBackground; background: var(--pathBackground);
box-shadow: inset 0 1px $pathBorder; box-shadow: inset 0 1px var(--pathBorder);
@media #{$mediumScreen} { left: $sidebarMediumWidth; } @include mobile { left: var(--sidebarMediumWidth); }
._sidebar-hidden & { left: 0; } ._sidebar-hidden & { left: 0; }
@ -24,7 +24,7 @@
display: inline-block; display: inline-block;
vertical-align: top; vertical-align: top;
padding: 0 .375rem; padding: 0 .375rem;
color: $textColor; color: var(--textColor);
text-decoration: none; text-decoration: none;
&:first-child:before { &:first-child:before {

@ -1,9 +1,26 @@
html {
--prismValue: #905;
--prismText: #5e8e01;
--prismOperator: #a67f59;
--prismKeyword: #0070a3;
--prismFunction: #dd4a68;
--prismVariable: #e90;
}
html._theme-dark {
--prismValue: #eb8160;
--prismText: #ddcf88;
--prismOperator: #b1c676;
--prismKeyword: #91b3ed;
--prismFunction: #c79e6b;
--prismVariable: #e9c062;
}
.token.comment, .token.comment,
.token.prolog, .token.prolog,
.token.doctype, .token.doctype,
.token.cdata, .token.cdata,
.token.punctuation { .token.punctuation {
color: $textColorLight; color: var(--textColorLight);
} }
.namespace { .namespace {
@ -17,11 +34,7 @@
.token.constant, .token.constant,
.token.symbol, .token.symbol,
.token.deleted { .token.deleted {
@if $style == 'dark' { color: var(--prismValue);
color: #eb8160;
} @else {
color: #905;
}
} }
.token.selector, .token.selector,
@ -30,11 +43,7 @@
.token.char, .token.char,
.token.builtin, .token.builtin,
.token.inserted { .token.inserted {
@if $style == 'dark' { color: var(--prismText);
color: #ddcf88;
} @else {
color: #5e8e01;
}
} }
.token.operator, .token.operator,
@ -42,44 +51,28 @@
.token.url, .token.url,
.language-css .token.string, .language-css .token.string,
.style .token.string { .style .token.string {
@if $style == 'dark' { color: var(--prismOperator);
color: #b1c676;
} @else {
color: #a67f59;
}
} }
.token.atrule, .token.atrule,
.token.attr-value, .token.attr-value,
.token.keyword { .token.keyword {
@if $style == 'dark' { color: var(--prismKeyword);
color: #91b3ed;
} @else {
color: #0070a3;
}
} }
.token.function { .token.function {
@if $style == 'dark' { color: var(--prismFunction);
color: #c79e6b;
} @else {
color: #dd4a68;
}
} }
.token.regex, .token.regex,
.token.important, .token.important,
.token.variable { .token.variable {
@if $style == 'dark' { color: var(--prismVariable);
color: #e9c062;
} @else {
color: #e90;
}
} }
.token.important, .token.important,
.token.bold { .token.bold {
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
} }
.token.italic { .token.italic {

@ -7,15 +7,15 @@
position: absolute; position: absolute;
top: 0; top: 0;
bottom: 0; bottom: 0;
z-index: $headerZ; z-index: var(--headerZ);
&._in { display: block; } &._in { display: block; }
> ._header { justify-content: space-between; } > ._header { justify-content: space-between; }
&._dirty > ._header { &._dirty > ._header {
background: $noteGreenBackground; background: var(--noteGreenBackground);
border-color: $noteGreenBorder; border-color: var(--noteGreenBorder);
} }
} }
@ -37,7 +37,7 @@
padding-right: .5rem; padding-right: .5rem;
line-height: inherit; line-height: inherit;
font-size: inherit; font-size: inherit;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
text-align: right; text-align: right;
@extend %border-box; @extend %border-box;
} }
@ -52,7 +52,7 @@
> small { > small {
display: block; display: block;
color: $textColorLight; color: var(--textColorLight);
margin-left: 1.75rem; margin-left: 1.75rem;
} }
@ -62,7 +62,7 @@
} }
} }
@media (max-width: $maxWidth) { @media (max-width: 80rem) {
._setting-max-width { display: none; } ._setting-max-width { display: none; }
} }
@ -80,7 +80,7 @@
line-height: 1.5rem; line-height: 1.5rem;
padding: 0 .75rem; padding: 0 .75rem;
font-size: .875rem; font-size: .875rem;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
color: inherit; color: inherit;
text-align: left; text-align: left;
cursor: pointer; cursor: pointer;
@ -119,12 +119,12 @@
position: relative; position: relative;
vertical-align: top; vertical-align: top;
padding: 0 .75rem; padding: 0 .75rem;
line-height: $headerHeight; line-height: var(--headerHeight);
color: $textColorLight; color: var(--textColorLight);
&.active { &.active {
color: $textColor; color: var(--textColor);
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
box-shadow: inset 0 -2px $linkColor; box-shadow: inset 0 -2px var(--linkColor);
} }
} }

@ -4,14 +4,14 @@
._sidebar { ._sidebar {
position: absolute; position: absolute;
z-index: $sidebarZ; z-index: var(--sidebarZ);
top: 0; top: 0;
bottom: 0; bottom: 0;
left: 0; left: 0;
overflow-x: hidden; overflow-x: hidden;
overflow-y: scroll; overflow-y: scroll;
padding-top: $headerHeight; padding-top: var(--headerHeight);
background: $sidebarBackground; background: var(--sidebarBackground);
background-clip: content-box; background-clip: content-box;
-webkit-overflow-scrolling: touch; -webkit-overflow-scrolling: touch;
-ms-overflow-style: none; // IE 10 doesn't support pointer-events -ms-overflow-style: none; // IE 10 doesn't support pointer-events
@ -22,13 +22,13 @@
._overlay-scrollbars & { ._overlay-scrollbars & {
padding-top: 0; padding-top: 0;
top: $headerHeight; top: var(--headerHeight);
} }
body:not(._native-scrollbars) & { body:not(._native-scrollbars) & {
&::-webkit-scrollbar { width: 10px; } &::-webkit-scrollbar { width: 10px; }
&::-webkit-scrollbar-track { &::-webkit-scrollbar-track {
background: $contentBackground; background: var(--contentBackground);
border: 0; border: 0;
} }
&::-webkit-scrollbar-thumb { &::-webkit-scrollbar-thumb {
@ -52,10 +52,10 @@
._resizer { ._resizer {
position: absolute; position: absolute;
z-index: $sidebarZ + 1; z-index: var(--headerZ);
top: $headerHeight; top: var(--headerHeight);
bottom: $headerHeight; bottom: var(--headerHeight);
left: $sidebarWidth; left: var(--sidebarWidth);
margin-left: -2px; margin-left: -2px;
width: 3px; width: 3px;
cursor: col-resize; cursor: col-resize;
@ -72,11 +72,11 @@
margin: 0; margin: 0;
padding: 0; padding: 0;
list-style: none; list-style: none;
width: $sidebarWidth; width: var(--sidebarWidth);
box-shadow: inset -1px 0 $sidebarBorder; box-shadow: inset -1px 0 var(--sidebarBorder);
@extend %border-box; @extend %border-box;
@media #{$mediumScreen} { width: $sidebarMediumWidth; } @include mobile { width: var(--sidebarMediumWidth); }
._sidebar > & { min-height: 100%; } ._sidebar > & { min-height: 100%; }
@ -89,7 +89,7 @@
padding: 0 .75rem 0 2.125rem; padding: 0 .75rem 0 2.125rem;
line-height: 2rem; line-height: 2rem;
font-size: .75rem; font-size: .75rem;
color: $textColorLight; color: var(--textColorLight);
text-transform: uppercase; text-transform: uppercase;
cursor: default; cursor: default;
} }
@ -110,8 +110,8 @@
line-height: 1.5rem; line-height: 1.5rem;
font-size: .875rem; font-size: .875rem;
cursor: default; cursor: default;
background: $sidebarBackground; background: var(--sidebarBackground);
box-shadow: inset -1px 0 $sidebarBorder; box-shadow: inset -1px 0 var(--sidebarBorder);
@extend %truncate-text; @extend %truncate-text;
&, &:hover { &, &:hover {
@ -123,16 +123,16 @@
&.focus:hover, &.focus:hover,
&.active, &.active,
&.active:hover { &.active:hover {
color: $focusText; color: var(--focusText);
background: $focusBackground; background: var(--focusBackground);
box-shadow: inset -1px 0 $focusBorder; box-shadow: inset -1px 0 var(--focusBorder);
} }
&.active, &.active,
&.active:hover { &.active:hover {
color: $selectionText; color: var(--selectionText);
background: $selectionBackground; background: var(--selectionBackground);
box-shadow: inset -1px 0 $selectionBorder; box-shadow: inset -1px 0 var(--selectionBorder);
} }
&:before { &:before {
@ -160,7 +160,7 @@
} }
._list-count { ._list-count {
color: $textColorLighter; color: var(--textColorLighter);
pointer-events: none; pointer-events: none;
._list-disabled:hover > & { display: none; } ._list-disabled:hover > & { display: none; }
@ -168,7 +168,7 @@
._list-enable { ._list-enable {
display: none; display: none;
color: $linkColor; color: var(--linkColor);
cursor: pointer; cursor: pointer;
&:hover { text-decoration: underline; } &:hover { text-decoration: underline; }
@ -188,7 +188,7 @@
._list-disabled { ._list-disabled {
@extend %_list-dir; @extend %_list-dir;
&, &:hover { color: $textColorLight; } &, &:hover { color: var(--textColorLight); }
&:before { opacity: .7; } &:before { opacity: .7; }
} }
@ -200,11 +200,9 @@
width: 1rem; width: 1rem;
height: 1rem; height: 1rem;
cursor: pointer; cursor: pointer;
fill: black; fill: var(--absolute);
opacity: .4; opacity: .4;
@if $style == 'dark' { fill: white; }
&:hover { opacity: .65; } &:hover { opacity: .65; }
._list-rdir > & { ._list-rdir > & {
@ -239,11 +237,11 @@
// //
._list-pagelink { ._list-pagelink {
color: $linkColor; color: var(--linkColor);
cursor: pointer; cursor: pointer;
&:hover { &:hover {
color: $linkColorHover; color: var(--linkColorHover);
text-decoration: underline; text-decoration: underline;
} }
} }
@ -275,9 +273,9 @@
left: .75rem; left: .75rem;
width: .75rem; width: .75rem;
height: 1px; height: 1px;
background: rgba($selectionText, .9); background: var(--transparentSelectionText);
box-shadow: 0 -3px rgba($selectionText, .9), // top line box-shadow: 0 -3px var(--transparentSelectionText), // top line
0 3px rgba($selectionText, .9); // bottom line 0 3px var(--transparentSelectionText); // bottom line
} }
} }
@ -289,7 +287,7 @@
padding: .5rem .75rem; padding: .5rem .75rem;
line-height: 1.25rem; line-height: 1.25rem;
font-size: .8125rem; font-size: .8125rem;
color: $textColorLight; color: var(--textColorLight);
& + & { padding-top: 0; } & + & { padding-top: 0; }
} }
@ -303,9 +301,9 @@
._list-hover.clone { ._list-hover.clone {
position: fixed; position: fixed;
overflow: visible; overflow: visible;
z-index: $hoverZ; z-index: var(--hoverZ);
left: 0; left: 0;
min-width: $sidebarWidth; min-width: var(--sidebarWidth);
padding: .25rem .75rem; padding: .25rem .75rem;
pointer-events: none; pointer-events: none;
-webkit-font-smoothing: subpixel-antialiased; -webkit-font-smoothing: subpixel-antialiased;
@ -313,7 +311,7 @@
transform: translate3d(0, 0, 0); transform: translate3d(0, 0, 0);
@extend %border-box; @extend %border-box;
@media #{$mediumScreen} { min-width: $sidebarMediumWidth; } @include mobile { min-width: var(--sidebarMediumWidth); }
> ._list-text { display: inline; } > ._list-text { display: inline; }
@ -346,10 +344,10 @@
padding: .5rem .75rem .25rem .75rem; padding: .5rem .75rem .25rem .75rem;
line-height: 1.5rem; line-height: 1.5rem;
font-size: .75rem; font-size: .75rem;
font-weight: $bolderFontWeight; font-weight: var(--bolderFontWeight);
color: $textColorLight; color: var(--textColorLight);
text-transform: uppercase; text-transform: uppercase;
background: linear-gradient(to bottom, $sidebarBackground, $sidebarBackground 75%, rgba($sidebarBackground, 0)); background: linear-gradient(to bottom, var(--sidebarBackground), var(--sidebarBackground) 75%, var(--transparentSidebarBackground));
cursor: default; cursor: default;
} }

@ -1,9 +1,10 @@
html { html {
height: 100%; height: 100%;
font-size: 100%; font-size: 100%;
background: $documentBackground; background: #fff; // fallback to show the error message to browsers that don't support CSS variables.
background: var(--documentBackground);
@media #{$mediumScreen} { font-size: 93.75%; } @include mobile { font-size: 93.75%; }
@include print { background: none; } @include print { background: none; }
@import 'global/print'; @import 'global/print';
@ -17,10 +18,11 @@ body {
font-weight: normal; font-weight: normal;
font-family: $baseFont; font-family: $baseFont;
line-height: 1.7; line-height: 1.7;
color: $textColor; color: $textColor; // fallback to show the error message to browsers that don't support CSS variables.
color: var(--textColor);
word-wrap: break-word; word-wrap: break-word;
overflow-wrap: break-word; overflow-wrap: break-word;
background: $contentBackground; background: var(--contentBackground);
touch-action: manipulation; touch-action: manipulation;
-webkit-tap-highlight-color: rgba(black, 0); -webkit-tap-highlight-color: rgba(black, 0);
-webkit-touch-callout: none; -webkit-touch-callout: none;
@ -29,11 +31,11 @@ body {
} }
a { a {
color: $linkColor; color: var(--linkColor);
text-decoration: $linkTextDecoration; text-decoration: var(--linkTextDecoration);
&:hover { &:hover {
color: $linkColorHover; color: var(--linkColorHover);
text-decoration: underline; text-decoration: underline;
} }
} }
@ -47,7 +49,7 @@ img {
h1, h2, h3, h4, h5, h6 { h1, h2, h3, h4, h5, h6 {
margin: 1.5em 0 1em; margin: 1.5em 0 1em;
line-height: 1.3; line-height: 1.3;
font-weight: $bolderFontWeight; font-weight: var(--bolderFontWeight);
} }
h1 { font-size: 1.5em; } h1 { font-size: 1.5em; }
@ -59,7 +61,7 @@ h5, h6 { font-size: 1em; }
p { margin: 0 0 1em; } p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; } p:last-child { margin-bottom: 0; }
b, strong { font-weight: $boldFontWeight; } b, strong { font-weight: var(--boldFontWeight); }
small { font-size: .9em; } small { font-size: .9em; }
@ -79,7 +81,7 @@ li > ul, li > ol, dd > ul, dd > ol { margin: .5em 0; }
li > p { margin-bottom: .25em; } li > p { margin-bottom: .25em; }
dl { margin: 1.5em 0; } dl { margin: 1.5em 0; }
dt { font-weight: $boldFontWeight; } dt { font-weight: var(--boldFontWeight); }
dd { dd {
margin: .375em; margin: .375em;
padding-left: 1em; padding-left: 1em;
@ -91,15 +93,15 @@ dfn, var { font-style: normal; }
abbr, acronym, dfn { abbr, acronym, dfn {
cursor: help; cursor: help;
border-bottom: 1px dotted $textColor; border-bottom: 1px dotted var(--textColor);
} }
pre, code, samp, %pre, %code { pre, code, samp, %pre, %code {
font-family: $monoFont; font-family: var(--monoFont);
font-weight: normal; font-weight: normal;
font-style: normal; font-style: normal;
font-size: .9em; font-size: .9em;
color: $textColor; color: var(--textColor);
white-space: pre-wrap; white-space: pre-wrap;
direction: ltr; direction: ltr;
-moz-tab-size: 2; -moz-tab-size: 2;
@ -121,14 +123,14 @@ a > code { color: inherit; }
table { table {
margin: 1.5em 0; margin: 1.5em 0;
background: none; background: none;
border: 1px solid $boxBorder; border: 1px solid var(--boxBorder);
border-collapse: separate; border-collapse: separate;
border-spacing: 0; border-spacing: 0;
border-radius: 3px; border-radius: 3px;
} }
caption { caption {
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
padding: 0 .7em .3em; padding: 0 .7em .3em;
} }
@ -142,15 +144,15 @@ th, td {
} }
th { th {
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
border: 0; border: 0;
border-bottom: 1px solid $boxBorder; border-bottom: 1px solid var(--boxBorder);
border-radius: 0; border-radius: 0;
@extend %heading-box; @extend %heading-box;
&:empty { background: none; } &:empty { background: none; }
+ th, + td { border-left: 1px solid $boxBorder; } + th, + td { border-left: 1px solid var(--boxBorder); }
tr:first-child > &:first-child { border-top-left-radius: 3px; } tr:first-child > &:first-child { border-top-left-radius: 3px; }
tr:first-child > &:last-child { border-top-right-radius: 3px; } tr:first-child > &:last-child { border-top-right-radius: 3px; }
@ -161,10 +163,10 @@ th {
} }
td { td {
background: $contentBackground; background: var(--contentBackground);
border-bottom: 1px solid $boxBorderLight; border-bottom: 1px solid var(--boxBorderLight);
+ td { border-left: 1px solid $boxBorderLight; } + td { border-left: 1px solid var(--boxBorderLight); }
tr:last-child > & { border-bottom: 0; } tr:last-child > & { border-bottom: 0; }
> pre:only-child, > p:only-child, > ul:only-child, > ol:only-child { > pre:only-child, > p:only-child, > ul:only-child, > ol:only-child {
@ -190,7 +192,7 @@ input, button {
margin: 0; margin: 0;
font-family: inherit; font-family: inherit;
font-size: 100%; font-size: 100%;
color: $textColor; color: var(--textColor);
line-height: normal; line-height: normal;
@extend %border-box; @extend %border-box;
} }
@ -218,6 +220,10 @@ button:focus {
outline: -webkit-focus-ring-color auto 5px; outline: -webkit-focus-ring-color auto 5px;
} }
img, iframe {
background: var(--externalsBackground);
}
input[type="search"]::-webkit-search-cancel-button, input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration { input[type="search"]::-webkit-search-decoration {
-webkit-appearance: none; -webkit-appearance: none;
@ -230,9 +236,9 @@ input[type="search"]::-webkit-search-decoration {
border: 0 !important; border: 0 !important;
} }
::-webkit-input-placeholder { color: $textColorLighter; } ::-webkit-input-placeholder { color: var(--textColorLighter); }
::-moz-placeholder { color: $textColorLighter; opacity: 1; } ::-moz-placeholder { color: var(--textColorLighter); opacity: 1; }
:-ms-input-placeholder { color: $textColorLighter; } :-ms-input-placeholder { color: var(--textColorLighter); }
body:not(._native-scrollbars) { body:not(._native-scrollbars) {
*::-webkit-scrollbar { -webkit-appearance: none; } *::-webkit-scrollbar { -webkit-appearance: none; }
@ -243,12 +249,12 @@ body:not(._native-scrollbars) {
*::-webkit-scrollbar-corner { display: none; } *::-webkit-scrollbar-corner { display: none; }
*::-webkit-scrollbar-track { *::-webkit-scrollbar-track {
background: $contentBackground; background: var(--contentBackground);
border: 1px solid $contentBackground; border: 1px solid var(--contentBackground);
&:hover { &:hover {
background: $sidebarBackground; background: var(--sidebarBackground);
border-color: $sidebarBorder; border-color: var(--sidebarBorder);
} }
&:vertical { border-width: 0 0 0 1px; } &:vertical { border-width: 0 0 0 1px; }
@ -266,14 +272,14 @@ body:not(._native-scrollbars) {
*::-webkit-scrollbar-thumb { *::-webkit-scrollbar-thumb {
min-height: 2rem; min-height: 2rem;
background: $scrollbarColor; background: var(--scrollbarColor);
background-clip: padding-box; background-clip: padding-box;
border: 5px solid rgba(black, 0); border: 5px solid rgba(black, 0);
border-radius: 10px; border-radius: 10px;
&:hover, &:hover,
&:active { &:active {
background-color: $scrollbarColorHover; background-color: var(--scrollbarColorHover);
border-width: 4px; border-width: 4px;
} }
} }

@ -36,15 +36,15 @@
// //
%box { %box {
background: $boxBackground; background: var(--boxBackground);
border: 1px solid $boxBorder; border: 1px solid var(--boxBorder);
border-radius: 3px; border-radius: 3px;
} }
%heading-box { %heading-box {
color: $boxHeaderColor; color: var(--boxHeaderColor);
background: $boxHeaderBackground; background: var(--boxHeaderBackground);
border: 1px solid $boxBorder; border: 1px solid var(--boxBorder);
border-radius: 3px; border-radius: 3px;
} }
@ -82,15 +82,15 @@
%note { %note {
margin: 1.5rem 0; margin: 1.5rem 0;
padding: .5rem .875rem; padding: .5rem .875rem;
background: $noteBackground; background: var(--noteBackground);
border: 1px solid $noteBorder; border: 1px solid var(--noteBorder);
border-radius: 3px; border-radius: 3px;
} }
%label { %label {
margin: 0 1px; margin: 0 1px;
padding: 1px 4px 2px; padding: 1px 4px 2px;
background: $labelBackground; background: var(--labelBackground);
border-radius: 3px; border-radius: 3px;
} }
@ -102,35 +102,35 @@
padding-right: .5em; padding-right: .5em;
overflow: hidden; overflow: hidden;
font-size: inherit; font-size: inherit;
color: $boxHeaderColor; color: var(--boxHeaderColor);
border: 1px solid $boxBorder; border: 1px solid var(--boxBorder);
border-radius: 2px; border-radius: 2px;
@extend %label; @extend %label;
} }
%label-yellow { %label-yellow {
background: $noteBackground; background: var(--noteBackground);
border-color: $noteBorder; border-color: var(--noteBorder);
} }
%note-green, %label-green { %note-green, %label-green {
background: $noteGreenBackground; background: var(--noteGreenBackground);
border-color: $noteGreenBorder; border-color: var(--noteGreenBorder);
} }
%note-blue, %label-blue { %note-blue, %label-blue {
background: $noteBlueBackground; background: var(--noteBlueBackground);
border-color: $noteBlueBorder; border-color: var(--noteBlueBorder);
} }
%note-orange, %label-orange { %note-orange, %label-orange {
background: $noteOrangeBackground; background: var(--noteOrangeBackground);
border-color: $noteOrangeBorder; border-color: var(--noteOrangeBorder);
} }
%note-red, %label-red { %note-red, %label-red {
background: $noteRedBackground; background: var(--noteRedBackground);
border-color: $noteRedBorder; border-color: var(--noteRedBorder);
} }
// //
@ -149,12 +149,11 @@
pointer-events: none; pointer-events: none;
// <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> // <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>
@if $style == 'dark' { background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
} @else {
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
}
} }
} }
html._theme-dark %external-link:after {
background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+);
}
%internal-link:after { content: none !important; } %internal-link:after { content: none !important; }

@ -23,8 +23,8 @@
%doc-icon-2 { background-image: image-url('docs-2@2x.png') !important; } %doc-icon-2 { background-image: image-url('docs-2@2x.png') !important; }
} }
%darkIconFix { html._theme-dark {
@if $style == 'dark' { %darkIconFix {
filter: invert(100%) grayscale(100%); filter: invert(100%) grayscale(100%);
-webkit-filter: invert(100%) grayscale(100%); -webkit-filter: invert(100%) grayscale(100%);
} }
@ -94,6 +94,7 @@
._icon-marionette:before { background-position: -6rem -5rem; } ._icon-marionette:before { background-position: -6rem -5rem; }
._icon-jsdoc:before, ._icon-jsdoc:before,
._icon-koa:before, ._icon-koa:before,
._icon-graphite:before,
._icon-mongoose:before { background-position: -7rem -5rem; } ._icon-mongoose:before { background-position: -7rem -5rem; }
._icon-phpunit:before { background-position: -8rem -5rem; } ._icon-phpunit:before { background-position: -8rem -5rem; }
._icon-nokogiri:before { background-position: -9rem -5rem; @extend %darkIconFix !optional; } ._icon-nokogiri:before { background-position: -9rem -5rem; @extend %darkIconFix !optional; }
@ -173,3 +174,9 @@
._icon-babel:before { background-position: -2rem -3rem; @extend %doc-icon-2; } ._icon-babel:before { background-position: -2rem -3rem; @extend %doc-icon-2; }
._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; } ._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; }
._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; } ._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; }
._icon-pygame:before { background-position: -5rem -3rem; @extend %doc-icon-2; }
._icon-bash:before { background-position: -6rem -3rem; @extend %doc-icon-2; }
._icon-dart:before { background-position: -7rem -3rem; @extend %doc-icon-2; }
._icon-qt:before { background-position: -8rem -3rem; @extend %doc-icon-2; }
._icon-puppeteer:before { background-position: -9rem -3rem; @extend %doc-icon-2; }
._icon-handlebars:before { background-position: 0 -4rem; @extend %doc-icon-2; @extend %darkIconFix !optional; }

@ -7,3 +7,9 @@
@content; @content;
} }
} }
@mixin mobile {
@media (max-width: 800px) {
@content;
}
}

@ -25,14 +25,14 @@
._attribution-p { ._attribution-p {
background: none; background: none;
border: 2px solid $boxBorder; border: 2px solid var(--boxBorder);
} }
._attribution:last-child:after { ._attribution:last-child:after {
content: 'Exported from DevDocs \2014 https://devdocs.io'; content: 'Exported from DevDocs \2014 https://devdocs.io';
display: block; display: block;
margin-top: 1rem; margin-top: 1rem;
font-weight: $bolderFontWeight; font-weight: var(--bolderFontWeight);
} }
._attribution { ._attribution {

@ -1,92 +1,76 @@
$baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif; html._theme-dark {
$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; --absolute: white;
$boldFontWeight: 500;
$bolderFontWeight: 600;
$style: 'dark'; --documentBackground: #222;
--contentBackground: #33373a;
$maxWidth: 80rem; --textColor: #cbd0d0;
$headerHeight: 3rem; --textColorLight: #9da5ad;
$sidebarWidth: 20rem; --textColorLighter: #77787a;
$sidebarMediumWidth: 16rem;
$documentBackground: #222; --externalsBackground: #fff;
$contentBackground: #33373a;
$textColor: #cbd0d0; --inputFocusBorder: transparent;
$textColorLight: #9da5ad;
$textColorLighter: #77787a;
$textColorRed: #f44336;
$inputFocusBorder: false; --focusBackground: #3f4042;
--focusBorder: #000;
--focusText: #f7f2f2;
$focusBackground: #3f4042; --loadingText: #5d6164;
$focusBorder: #000;
$focusText: #f7f2f2;
$loadingText: #5d6164; --selectionBackground: #007acc;
$splashText: $loadingText; --selectionBorder: #000;
$selectionBackground: #007acc; --highlightBackground: #64675f;
$selectionBorder: #000;
$selectionText: #fff;
$highlightBackground: #64675f; --linkColor: var(--textColor);
--linkColorHover: white;
--linkTextDecoration: underline;
$linkColor: $textColor; --headerBackground: #1c1c1c;
$linkColorHover: white; --headerBorder: #000;
$linkTextDecoration: underline; --searchTagBackground: #{darken(#1c1c1c, 5%)};
--searchBorder: #{darken(#000, 2%)};
$headerBackground: #1c1c1c; --sidebarBackground: #24282a;
$headerBorder: #000; --transparentSidebarBackground: #{rgba(#24282a, 0)};
--sidebarBorder: #000;
$sidebarBackground: #24282a; --scrollbarColor: #6c6c6f;
$sidebarBorder: #000; --scrollbarColorHover: #949697;
$scrollbarColor: #6c6c6f; --pathBackground: var(--headerBackground);
$scrollbarColorHover: #949697; --pathBorder: var(--headerBorder);
$pathBackground: $headerBackground; --noticeBackground: var(--sidebarBackground);
$pathBorder: $headerBorder; --noticeBorder: var(--sidebarBorder);
$noticeBackground: $sidebarBackground; --boxBackground: var(--sidebarBackground);
$noticeBorder: $sidebarBorder; --boxBorder: var(--headerBorder);
--boxBorderLight: var(--headerBorder);
--boxHeaderColor: #dbe4e4;
--boxHeaderBackground: var(--sidebarBackground);
$boxBackground: $sidebarBackground; --noteBackground: #45474b;
$boxBorder: $headerBorder; --noteBorder: #000;
$boxBorderLight: $headerBorder;
$boxHeaderColor: #dbe4e4;
$boxHeaderBackground: $sidebarBackground;
$noteBackground: #45474b; --noteGreenBackground: #284a2a;
$noteBorder: #000; --noteGreenBorder: #000;
$noteGreenBackground: #284a2a; --noteBlueBackground: #2a4151;
$noteGreenBorder: #000; --noteBlueBorder: #000;
$noteBlueBackground: #2a4151; --noteOrangeBackground: #563322;
$noteBlueBorder: #000; --noteOrangeBorder: #000;
$noteOrangeBackground: #563322; --noteRedBackground: #603033;
$noteOrangeBorder: #000; --noteRedBorder: #000;
$noteRedBackground: #603033; --labelBackground: var(--boxBackground);
$noteRedBorder: #000;
$labelBackground: $boxBackground; --notifBackground: #{rgba(#555, .95)};
--notifBorder: 1px solid #000;
$notifBackground: rgba(#555, .95); --tipBackground: var(--notifBackground);
$notifBorder: 1px solid #000; --tipBorder: var(--notifBorder);
$notifColor: #fff; }
$notifColorLight: #ccc;
$tipBackground: $notifBackground;
$tipBorder: $notifBorder;
$mediumScreen: '(max-width: 800px)';
$contentZ: 1;
$sidebarZ: 2;
$headerZ: 3;
$noticeZ: 4;
$hoverZ: 5;

@ -0,0 +1,76 @@
html._theme-default {
--absolute: black;
--documentBackground: #f3f3f3;
--contentBackground: #fff;
--textColor: #333;
--textColorLight: #666;
--textColorLighter: #888;
--externalsBackground: #fff;
--inputFocusBorder: #35b5f4;
--focusBackground: #e5e5e5;
--focusBorder: #d4d4d4;
--focusText: #000;
--loadingText: #ccc;
--selectionBackground: #398df0;
--selectionBorder: #196fc2;
--highlightBackground: #fffdcd;
--linkColor: #3377c0;
--linkColorHover: #2f6cb6;
--linkTextDecoration: none;
--headerBackground: #eee;
--headerBorder: #d7d7d7;
--searchTagBackground: #{darken(#eee, 5%)};
--searchBorder: #{darken(#d7d7d7, 2%)};
--sidebarBackground: #f9f9f9;
--transparentSidebarBackground: #{rgba(#f9f9f9, 0)};
--sidebarBorder: #e1e1e1;
--scrollbarColor: #ccc;
--scrollbarColorHover: #999;
--pathBackground: var(--sidebarBackground);
--pathBorder: var(--sidebarBorder);
--noticeBackground: #faf9e2;
--noticeBorder: #e2e2c1;
--boxBackground: #fafafa;
--boxBorder: #d8d8d8;
--boxBorderLight: #e5e5e5;
--boxHeaderColor: var(--textColor);
--boxHeaderBackground: #f5f5f5;
--noteBackground: #f8f8dd;
--noteBorder: #d3d952;
--noteGreenBackground: #e7f8e1;
--noteGreenBorder: #89da70;
--noteBlueBackground: #d4f3fd;
--noteBlueBorder: #94bbeb;
--noteOrangeBackground: #fbe6d1;
--noteOrangeBorder: #ec8b01;
--noteRedBackground: #fed5d3;
--noteRedBorder: #dc7874;
--labelBackground: #f4f4f4;
--notifBackground: #{rgba(#333, .85)};
--notifBorder: none;
--tipBackground: #{rgba(#fffdcd, .95)};
--tipBorder: 1px solid #e7dca9;
}

@ -1,92 +1,35 @@
// Variables needed to style the error message for browsers that don't support CSS variables.
$baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif; $baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
$boldFontWeight: 500;
$bolderFontWeight: 600;
$style: 'light';
$maxWidth: 80rem;
$headerHeight: 3rem;
$sidebarWidth: 20rem;
$sidebarMediumWidth: 16rem;
$documentBackground: #f3f3f3;
$contentBackground: #fff;
$textColor: #333; $textColor: #333;
$textColorLight: #666;
$textColorLighter: #888;
$textColorRed: #f44336;
$inputFocusBorder: #35b5f4;
$focusBackground: #e5e5e5;
$focusBorder: #d4d4d4;
$focusText: #000;
$loadingText: #ccc;
$splashText: #ccc;
$selectionBackground: #398df0;
$selectionBorder: #196fc2;
$selectionText: #fff;
$highlightBackground: #fffdcd;
$linkColor: #3377c0;
$linkColorHover: #2f6cb6;
$linkTextDecoration: none;
$headerBackground: #eee;
$headerBorder: #d7d7d7;
$sidebarBackground: #f9f9f9;
$sidebarBorder: #e1e1e1;
$scrollbarColor: #ccc;
$scrollbarColorHover: #999;
$pathBackground: $sidebarBackground;
$pathBorder: $sidebarBorder;
$noticeBackground: #faf9e2;
$noticeBorder: #e2e2c1;
$boxBackground: #fafafa;
$boxBorder: #d8d8d8;
$boxBorderLight: #e5e5e5;
$boxHeaderColor: $textColor;
$boxHeaderBackground: #f5f5f5;
$noteBackground: #f8f8dd;
$noteBorder: #d3d952;
$noteGreenBackground: #e7f8e1;
$noteGreenBorder: #89da70;
$noteBlueBackground: #d4f3fd; html {
$noteBlueBorder: #94bbeb; --baseFont: #{$baseFont};
--monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace;
--boldFontWeight: 500;
--bolderFontWeight: 600;
$noteOrangeBackground: #fbe6d1; --textColorRed: #f44336;
$noteOrangeBorder: #ec8b01;
$noteRedBackground: #fed5d3; --splashText: var(--loadingText);
$noteRedBorder: #dc7874;
$labelBackground: #f4f4f4; --selectionText: #fff;
--transparentSelectionText: rgba(255, 255, 255, 0.9);
$notifBackground: rgba(#333, .85); --notifColor: #fff;
$notifBorder: none; --notifColorLight: #ccc;
$notifColor: #fff;
$notifColorLight: #ccc;
$tipBackground: rgba(#fffdcd, .95); --maxWidth: 80rem;
$tipBorder: 1px solid #e7dca9; --headerHeight: 3rem;
--sidebarWidth: 20rem;
--sidebarMediumWidth: 16rem;
$mediumScreen: '(max-width: 800px)'; --focusBackground: #e5e5e5;
--focusBorder: #d4d4d4;
--focusText: #000;
$contentZ: 1; --contentZ: 1;
$sidebarZ: 2; --sidebarZ: 2;
$headerZ: 3; --headerZ: 3;
$noticeZ: 4; --noticeZ: 4;
$hoverZ: 5; --hoverZ: 5;
}

@ -8,7 +8,7 @@
.nav-index-section { .nav-index-section {
margin: 1.5em 0 1em -2em; margin: 1.5em 0 1em -2em;
list-style: none; list-style: none;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
text-transform: capitalize; text-transform: capitalize;
} }

@ -3,13 +3,13 @@
h3 > .type-signature { h3 > .type-signature {
float: right; float: right;
color: $textColorLight; color: var(--textColorLight);
} }
h3 > .signature-attributes { h3 > .signature-attributes {
font-size: .75rem; font-size: .75rem;
font-weight: normal; font-weight: normal;
font-style: italic; font-style: italic;
color: $textColorLighter; color: var(--textColorLighter);
} }
} }

@ -0,0 +1,12 @@
._bash {
dl > dt > code,
dl > dt > kbd {
@extend %block-label, %label-blue;
}
th[align=left] {
border-left: 1px solid var(--boxBorder);
}
code { @extend %label; }
}

@ -4,7 +4,7 @@
h4 > code, h5 > code, strong > code { @extend %label; } h4 > code, h5 > code, strong > code { @extend %label; }
h2 > small { h2 > small {
color: $textColorLight; color: var(--textColorLight);
float: right; float: right;
} }

@ -23,7 +23,7 @@
.t-spar { // language/switch, language/for, etc. .t-spar { // language/switch, language/for, etc.
font-style: italic; font-style: italic;
color: $textColorLight; color: var(--textColorLight);
} }
.t-sdsc-nopad dl, .t-sdsc-nopad dd { margin: 0; } .t-sdsc-nopad dl, .t-sdsc-nopad dd { margin: 0; }
@ -57,7 +57,7 @@
margin: 1rem 0; margin: 1rem 0;
padding: .375rem; padding: .375rem;
font-size: .75rem; font-size: .75rem;
border: 1px solid $boxBorder; border: 1px solid var(--boxBorder);
border-radius: 2px; border-radius: 2px;
} }

@ -5,6 +5,6 @@
.type { .type {
float: right; float: right;
font-size: .9em; font-size: .9em;
color: $textColorLight; color: var(--textColorLight);
} }
} }

@ -2,10 +2,10 @@
h2 { @extend %block-heading; } h2 { @extend %block-heading; }
h3, .d_decl { @extend %block-label, %label-blue; } h3, .d_decl { @extend %block-label, %label-blue; }
.d_decl { @extend %code; } .d_decl { @extend %code; }
.d_decl > small { color: $textColorLight; } .d_decl > small { color: var(--textColorLight); }
.d_decl > strong { font-weight: $bolderFontWeight; } .d_decl > strong { font-weight: var(--bolderFontWeight); }
p > code, li > code, td > code, dd > code { @extend %label; } p > code, li > code, td > code, dd > code { @extend %label; }
span.red { color: $textColorRed; } span.red { color: var(--textColorRed); }
} }

@ -0,0 +1,12 @@
._dart {
@extend %simple;
dl:not(.dl-horizontal) dt, .multi-line-signature {
@extend %block-label;
.features {
float: right;
color: var(--textColorLight);
}
}
}

@ -1,5 +1,5 @@
._dojo { ._dojo {
@extend %simple; @extend %simple;
.jsdoc-inheritance { color: $textColorLight; } .jsdoc-inheritance { color: var(--textColorLight); }
} }

@ -5,7 +5,7 @@
h3 > .access { h3 > .access {
float: right; float: right;
color: $textColorLight; color: var(--textColorLight);
font-weight: normal; font-weight: normal;
} }
@ -15,6 +15,6 @@
} }
p.github-link { p.github-link {
color: $textColorLight; color: var(--textColorLight);
} }
} }

@ -5,5 +5,5 @@
code.code { @extend %label; } code.code { @extend %label; }
.note { @extend %note; } .note { @extend %note; }
.warning { @extend %note, %note-red; } .warning { @extend %note, %note-red; }
.note .label, .warning .label { font-weight: $boldFontWeight; } .note .label, .warning .label { font-weight: var(--boldFontWeight); }
} }

@ -0,0 +1,7 @@
._graphite {
@extend %simple;
dl > dt {
@extend %block-label, %label-blue;
}
}

@ -32,7 +32,7 @@
.toc-list { .toc-list {
margin-top: 0; margin-top: 0;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
> li + li { margin-top: 1em; } > li + li { margin-top: 1em; }
> li > ul { font-weight: normal; } > li > ul { font-weight: normal; }
@ -48,7 +48,7 @@
.returns, .returns,
.option-type { .option-type {
float: right; float: right;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
margin-left: 1em; margin-left: 1em;
} }

@ -12,6 +12,6 @@
.smwtable { width: 100%; } .smwtable { width: 100%; }
.smwtable td:nth-last-child(2), .smwtable td:last-child { width: 2.5em; } .smwtable td:nth-last-child(2), .smwtable td:last-child { width: 2.5em; }
.cell-green { background: $noteGreenBackground; } .cell-green { background: var(--noteGreenBackground); }
.cell-red { background: $noteRedBackground; } .cell-red { background: var(--noteRedBackground); }
} }

@ -7,7 +7,7 @@
> span { > span {
display: block; display: block;
font-size: 1rem; font-size: 1rem;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
} }
ul, ol { ul, ol {
@ -42,7 +42,7 @@
> .note { > .note {
em { em {
font-style: normal; font-style: normal;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
} }
> ul { margin: 1em 0; } > ul { margin: 1em 0; }
@ -93,7 +93,7 @@
dt > strong > code, // HTML element attribute dt > strong > code, // HTML element attribute
dl > dt > code { // CSS property value, Javascript function argument dl > dt > code { // CSS property value, Javascript function argument
font-family: inherit; font-family: inherit;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
font-size: inherit; font-size: inherit;
} }

@ -9,10 +9,10 @@
dt > code { @extend %label; } dt > code { @extend %label; }
.api-heading { overflow: hidden; } .api-heading { overflow: hidden; }
.api-heading > code { font-weight: $boldFontWeight; } .api-heading > code { font-weight: var(--boldFontWeight); }
.locus, .src-code { float: right; } .locus, .src-code { float: right; }
.locus, .type, .src-code { margin-left: .5em; } .locus, .type, .src-code { margin-left: .5em; }
h2 .subtext-api { margin-top: .25rem; } h2 .subtext-api { margin-top: .25rem; }
.locus, .subtext-api, .subtext-api > code { font-size: .75rem; } .locus, .subtext-api, .subtext-api > code { font-size: .75rem; }
.locus, .type { color: $textColorLight; } .locus, .type { color: var(--textColorLight); }
} }

@ -8,7 +8,7 @@
.faint.heading { .faint.heading {
font-size: .9em; font-size: .9em;
color: $textColorLight; color: var(--textColorLight);
} }
.youtube-video iframe { width: 420px; height: 315px; } .youtube-video iframe { width: 420px; height: 315px; }

@ -3,6 +3,6 @@
h3 > small { h3 > small {
float: right; float: right;
color: $textColorLight; color: var(--textColorLight);
} }
} }

@ -13,7 +13,7 @@
.verinfo { .verinfo {
float: right; float: right;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
} }
.classsynopsis, .classsynopsis,
@ -21,7 +21,7 @@
.description > .methodsynopsis, .description > .methodsynopsis,
.description > .fieldsynopsis { @extend %note, %note-blue; } .description > .fieldsynopsis { @extend %note, %note-blue; }
.classsynopsisinfo_comment { color: $textColorLight; } .classsynopsisinfo_comment { color: var(--textColorLight); }
.classsynopsisinfo_comment, .classsynopsisinfo_comment,
.classsynopsis > .constructorsynopsis, .classsynopsis > .constructorsynopsis,

@ -16,7 +16,7 @@
} }
p > code { @extend %label; } p > code { @extend %label; }
p.c2 { font-weight: $boldFontWeight; } p.c2 { font-weight: var(--boldFontWeight); }
.navfooter > table { width: 100%; } .navfooter > table { width: 100%; }
td[align=center] { text-align: center; } td[align=center] { text-align: center; }

@ -0,0 +1,9 @@
._qt {
@extend %simple;
// Function headers
h3.fn > code {
float: right;
color: var(--textColorLight);
}
}

@ -6,7 +6,7 @@
.method-description > h2, h3, h4, h5, h6 { font-size: 1em; } .method-description > h2, h3, h4, h5, h6 { font-size: 1em; }
.method-heading { .method-heading {
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
@extend %block-label, %label-blue; @extend %block-label, %label-blue;
+ .method-heading { margin-top: -.5em; } + .method-heading { margin-top: -.5em; }
@ -22,7 +22,7 @@
a.method-click-advice { a.method-click-advice {
float: right; float: right;
font-size: .75rem; font-size: .75rem;
color: $linkColor; color: var(--linkColor);
cursor: pointer; cursor: pointer;
@extend %user-select-none; @extend %user-select-none;
@ -42,8 +42,8 @@
top: 0; top: 0;
left: -1em; left: -1em;
right: 0; right: 0;
background: rgba($contentBackground, .95); background: var(--contentBackground);
box-shadow: 0 1em 1em 1em $contentBackground; box-shadow: 0 1em 1em 1em var(--contentBackground);
> pre { margin: 0; } > pre { margin: 0; }
} }

@ -2,7 +2,7 @@
@extend %simple; @extend %simple;
.deprecated { @extend %note, %note-orange; } .deprecated { @extend %note, %note-orange; }
.deprecatedTitle { font-weight: $boldFontWeight; } .deprecatedTitle { font-weight: var(--boldFontWeight); }
span.platform { float: right; } span.platform { float: right; }
span.propType, span.platform { font-weight: normal; } span.propType, span.platform { font-weight: normal; }

@ -14,7 +14,7 @@
.args { .args {
font-size: .75rem; font-size: .75rem;
color: $textColorLight; color: var(--textColorLight);
} }
// Others // Others
@ -35,7 +35,7 @@
> .prompt { > .prompt {
float: left; float: left;
margin-right: .5em; margin-right: .5em;
color: $textColorLight; color: var(--textColorLight);
} }
> code { > code {

@ -10,6 +10,6 @@
> h1, > h2, > h3, > h4, > h5 { > h1, > h2, > h3, > h4, > h5 {
margin: 0; margin: 0;
font-family: $baseFont; font-family: var(--baseFont);
} }
} }

@ -3,9 +3,18 @@
h4 { @extend %block-label; } h4 { @extend %block-label; }
.docblock { margin-left: 1em; } .docblock { margin-left: 1em; }
div.information, div.important-traits {
@extend %note;
> pre { margin: .5rem 0; }
}
div.stability { margin-bottom: 1em; } div.stability { margin-bottom: 1em; }
em.stab, span.stab { @extend %label; } em.stab, span.stab { @extend %label; }
em.stab.unstable, span.stab.unstable { @extend %label-orange; } em.stab.unstable, span.stab.unstable { @extend %label-orange; }
.since, .out-of-band { float: right; } .out-of-band { float: right; }
.since, .srclink {
float: right;
margin-left: .5rem;
}
} }

@ -17,34 +17,4 @@
blockquote > h4, blockquote > h5 { margin-top: .25rem; } blockquote > h4, blockquote > h5 { margin-top: .25rem; }
} }
._apache_pig, ._simple { @extend %simple; }
._bower,
._chai,
._codeceptjs,
._docker,
._electron,
._fish,
._flow,
._gnu,
._grunt,
._haxe,
._immutable,
._influxdata,
._jasmine,
._jest,
._less,
._lodash,
._marionette,
._markdown,
._mocha,
._mongoose,
._nim,
._redux,
._requirejs,
._simple,
._typescript,
._vagrant,
._vulkan,
._yarn {
@extend %simple;
}

@ -14,7 +14,7 @@
.versionmodified, span.title, .topic-title { .versionmodified, span.title, .topic-title {
display: block; display: block;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
} }
p > code, li > code, dd > code, .docutils > dt > code { @extend %label; } p > code, li > code, dd > code, .docutils > dt > code { @extend %label; }
@ -26,7 +26,7 @@
.admonition-title { .admonition-title {
float: left; float: left;
margin: 0 .5em 0 0; margin: 0 .5em 0 0;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
&:after { content: ':'; } &:after { content: ':'; }
} }

@ -6,7 +6,7 @@
.admonition.tip { @extend %note-green; } .admonition.tip { @extend %note-green; }
.admonition-title { .admonition-title {
margin: 0 0 .25rem; margin: 0 0 .25rem;
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
} }
code { @extend %label; } code { @extend %label; }

@ -24,7 +24,7 @@
} }
tr.current { tr.current {
font-weight: $boldFontWeight; font-weight: var(--boldFontWeight);
font-size: 1rem; font-size: 1rem;
} }

@ -1,5 +1,5 @@
._yard { ._yard {
@extend %simple; @extend %simple;
.tag_title { font-weight: $boldFontWeight; } .tag_title { font-weight: var(--boldFontWeight); }
} }

@ -3,6 +3,6 @@
.detail-header-tag, .detailHeaderTag { .detail-header-tag, .detailHeaderTag {
float: right; float: right;
color: $textColorLight; color: var(--textColorLight);
} }
} }

@ -12,6 +12,8 @@ class App < Sinatra::Application
Rack::Mime::MIME_TYPES['.webapp'] = 'application/x-web-app-manifest+json' Rack::Mime::MIME_TYPES['.webapp'] = 'application/x-web-app-manifest+json'
configure do configure do
use Rack::SslEnforcer, only_environments: ['production', 'test'], hsts: false, force_secure_cookies: false
set :sentry_dsn, ENV['SENTRY_DSN'] set :sentry_dsn, ENV['SENTRY_DSN']
set :protection, except: [:frame_options, :xss_header] set :protection, except: [:frame_options, :xss_header]
@ -194,7 +196,6 @@ class App < Sinatra::Application
@@manifest_asset_urls ||= [ @@manifest_asset_urls ||= [
javascript_path('application', asset_host: false), javascript_path('application', asset_host: false),
stylesheet_path('application'), stylesheet_path('application'),
stylesheet_path('application-dark'),
image_path('docs-1.png'), image_path('docs-1.png'),
image_path('docs-1@2x.png'), image_path('docs-1@2x.png'),
image_path('docs-2.png'), image_path('docs-2.png'),
@ -203,21 +204,6 @@ class App < Sinatra::Application
] ]
end end
def main_stylesheet_path
stylesheet_paths[dark_theme? ? :dark : :default]
end
def alternate_stylesheet_path
stylesheet_paths[dark_theme? ? :default : :dark]
end
def stylesheet_paths
@@stylesheet_paths ||= {
default: stylesheet_path('application'),
dark: stylesheet_path('application-dark')
}
end
def app_size def app_size
@app_size ||= memoized_cookies['size'].nil? ? '20rem' : "#{memoized_cookies['size']}px" @app_size ||= memoized_cookies['size'].nil? ? '20rem' : "#{memoized_cookies['size']}px"
end end

@ -0,0 +1,74 @@
module Docs
class Bash
class CleanHtmlFilter < Filter
def call
# Remove the navigation header and footer and the lines underneath and above it
at_css('.header + hr').remove
line_above = at_xpath('//div[@class="header"]/preceding::hr[1]')
line_above.remove unless line_above.nil?
css('.header').remove
# Remove chapter and section numbers from title
title_node = at_css('h1, h2, h3, h4, h5, h6')
title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').strip
title_node.name = 'h1'
# Remove the "D. " from names like "D. Concept Index" and "D. Function Index"
title_node.content = title_node.content[3..-1] if title_node.content.start_with?("D. ")
# Remove columns containing a single space from tables
# In the original reference they are used to add width between two columns
xpath('//td[text()=" " and not(descendant::*)]').remove
# Add id's to additional entry nodes
css('dl > dt > code').each do |node|
# Only take the direct text (i.e. "<div>Hello <span>World</span></div>" becomes "Hello")
node['id'] = node.xpath('text()').to_s.strip
end
# Fix hashes of index entries so they link to the correct hash on the linked page
css('table[class^=index-] td[valign=top] > a').each do |node|
path = node['href'].split('#')[0]
hash = node.content
# Fix the index entries linking to the Special Parameters page
# There are multiple index entries that should link to the same paragraph on that page
# Example: the documentation for "$!" is equal to the documentation for "!"
if path.downcase.include?('special-parameters')
if hash.size > 1 && hash[0] == '$'
hash = hash[1..-1]
end
end
node['href'] = path + '#' + hash
end
# Fix index table letter hashes (the "Jump to" hashes)
css('table[class^=index-] th > a').each do |node|
node['id'] = node['name']
end
# Remove the rows with a horizontal line in them from the index tables
css('td[colspan="4"]').remove
# Remove additional text from menu entry and index entry cells
css('td[valign=top]').each do |node|
link = node.at_css('a')
node.children = link unless link.nil?
end
css('tt', 'code', 'table').remove_attr('class')
css('tt').each do |node|
node.name = 'code'
end
css('pre').each do |node|
node.content = node.content
end
doc
end
end
end
end

@ -0,0 +1,56 @@
module Docs
class Bash
class EntriesFilter < Docs::EntriesFilter
def get_name
name = at_css('hr + a + *').content.gsub(/(\d+\.?)+/, '')
# Remove the "D. " from names like "D. Concept Index" and "D. Function Index"
name = name[3..-1] if name.start_with?('D. ')
name
end
def get_type
return 'Manual: Appendices' if name.start_with?('Appendix')
return 'Manual: Indexes' if at_css('a[rel=up]').content.include?("Index")
"Manual"
end
def additional_entries
entry_type = {
"Function Index" => "Functions",
"Index of Shell Builtin Commands" => "Builtin Commands",
"Index of Shell Reserved Words" => "Reserved Words",
"Parameter and Variable Index" => "Parameters and Variables"
}[name]
# Only extract additional entries from certain index pages
return [] if entry_type.nil?
entries = []
css('table[class^=index-] td[valign=top] > a').each_slice(2) do |entry_node, section_node|
entry_name = entry_node.content
page = section_node['href'].split('#')[0]
hash = entry_name
# The Special Parameters page has multiple additional entries which should link to the same paragraph
# Example: the documentation for "$!" is equal to the documentation for "!"
if page == 'special-parameters'
if hash.size > 1 && hash[0] == '$'
hash = hash[1..-1]
end
end
# Construct path to the page which the index links to
entry_path = '/html_node/' + page + '#' + hash
entries << [entry_name, entry_path, entry_type]
end
entries
end
end
end
end

@ -0,0 +1,66 @@
module Docs
class Dart
class CleanHtmlFilter < Filter
def call
# Move the title into the main content node in the v1 docs
title = at_css('h1.title')
if title
name = title.children.last.content.strip
kind = title.at_css('.kind').content
at_css('.main-content').prepend_child("<h1>#{name} #{kind}</h1>")
end
# Add a title to the homepage of the v2 docs
if subpath == 'index.html' && at_css('.main-content > h1').nil?
at_css('.main-content').prepend_child('<h1>Dart SDK</h1>')
end
# Add the library to the main content (it is not always visible in the menu entry)
breadcrumbs = at_css('.breadcrumbs').css('li:not(.self-crumb) > a')
if breadcrumbs.length > 1
library = breadcrumbs[1].content
# Generate the link to the homepage of the library
with_hypens = library.gsub(/:/, '-')
location = "#{'../' * subpath.count('/')}#{with_hypens}/#{with_hypens}-library"
link = "<a href=\"#{location}\" class=\"_links-link\">#{library}</span>"
# Add the link to the main title, just like how the "Homepage" and "Source code" links appear
at_css('.main-content').prepend_child("<p class=\"_links\">#{link}</p>")
end
# Extract the actual content
# We can't use options[:container] here because the entries filter uses the breadcrumbs node
@doc = at_css('.main-content')
# Move the features (i.e. "read-only, inherited") into the blue header
css('.features').each do |node|
header = node.xpath('parent::dd/preceding::dt').last
header.add_child node unless header.nil?
end
css('section').each do |node|
if node['id'] && node.first_element_child
node.first_element_child['id'] ||= node['id']
end
node.before(node.children).remove
end
css('span').each do |node|
node.before(node.children).remove
end
# Make code blocks detectable by Prism
css('pre').each do |node|
node['data-language'] = 'dart'
node.content = node.content
end
css('.properties', '.property', '.callables', '.callable').remove_attr('class')
doc
end
end
end
end

@ -0,0 +1,42 @@
module Docs
class Dart
class EntriesFilter < Docs::EntriesFilter
def get_name
title = at_css('h1.title')
if title # v1
name = title.element_children.last.content.strip
kind = title.at_css('.kind').content
else # v2
title = at_css('.main-content > h1')
name = title.content[/(.*)( )/, 1].split(' top-level')[0]
kind = title.content[/(.*)( )(.+)/, 3]
end
breadcrumbs = at_css('.breadcrumbs').css('li:not(.self-crumb) > a')
first_part = ''
if breadcrumbs.length == 2 && !kind.include?('class')
first_part = breadcrumbs[1].content
elsif breadcrumbs.length == 3
first_part = breadcrumbs[2].content
end
separator = ''
unless first_part.empty?
if kind.include?('class')
separator = ':'
else
separator = '.'
end
end
"#{first_part}#{separator}#{name}"
end
def get_type
at_css('.breadcrumbs > li:nth-child(2)').content.split(' ')[0]
end
end
end
end

@ -26,6 +26,7 @@ module Docs
'Geometry' => 'Geometry', 'Geometry' => 'Geometry',
'High Resolution Time' => 'Performance', 'High Resolution Time' => 'Performance',
'Intersection' => 'Intersection Observer', 'Intersection' => 'Intersection Observer',
'Media Capabilities' => 'Media',
'Media Capture' => 'Media', 'Media Capture' => 'Media',
'Media Session' => 'Media', 'Media Session' => 'Media',
'Media Source' => 'Media', 'Media Source' => 'Media',
@ -99,6 +100,7 @@ module Docs
'MediaSession' => 'Media Session', 'MediaSession' => 'Media Session',
'MediaTrack' => 'Media Streams', 'MediaTrack' => 'Media Streams',
'Message' => 'Channel Messaging', 'Message' => 'Channel Messaging',
'Mutation' => 'DOM',
'NamedNode' => 'Nodes', 'NamedNode' => 'Nodes',
'Node' => 'Nodes', 'Node' => 'Nodes',
'Notification' => 'Notification', 'Notification' => 'Notification',
@ -116,6 +118,7 @@ module Docs
'Shadow' => 'Shadow DOM', 'Shadow' => 'Shadow DOM',
'StaticRange' => 'Range', 'StaticRange' => 'Range',
'Streams' => 'Media Streams', 'Streams' => 'Media Streams',
'StyleProperty' => 'CSS',
'StyleSheet' => 'CSS', 'StyleSheet' => 'CSS',
'Stylesheet' => 'CSS', 'Stylesheet' => 'CSS',
'SVG' => 'SVG', 'SVG' => 'SVG',

@ -59,6 +59,7 @@ module Docs
css('pre').each do |node| css('pre').each do |node|
node['data-language'] = 'elixir' node['data-language'] = 'elixir'
node.content = node.content
end end
end end
end end

@ -42,6 +42,11 @@ module Docs
node.parent.content = node.parent.content node.parent.content = node.parent.content
end end
# Fix links to the method reference
css('a').each do |node|
node['href'] = node['href'].sub('4x/api', 'index')
end
doc doc
end end
end end

@ -0,0 +1,27 @@
module Docs
class Graphite
class CleanHtmlFilter < Filter
def call
# Remove the paragraph icon after all headers
css('.headerlink').remove
css('dl.function > dt').each do |node|
node.content = node.content
end
css('.section').each do |node|
node.before(node.children).remove
end
css('div[class*="highlight-"]').each do |node|
node.content = node.content.strip
node.name = 'pre'
node['data-language'] = node['class'][/highlight\-(\w+)/, 1]
node.remove_attribute('class')
end
doc
end
end
end
end

@ -0,0 +1,46 @@
module Docs
class Graphite
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('h1').children[0].to_s
end
def get_type
get_name
end
def additional_entries
entries = []
# Sections
css('.section > .section').each do |node|
title = node.at_css('h2, h3')
next if title.nil?
# Move the id attribute to the title
# If this is excluded, the complete section will be highlighted in yellow when someone navigates to it
title['id'] = node['id']
node.remove_attribute('id')
parent_title_selector = "parent::div[@class='section']/preceding::#{title.name == 'h2' ? 'h1' : 'h2'}"
entries << [
title.children[0].to_s,
title['id'],
title.xpath(parent_title_selector).last.children[0].to_s
]
end
# Functions
css('dl.function > dt').each do |node|
name = node.at_css('.descname').content
name << '()'
entries << [name, node['id'], 'Functions']
end
entries
end
end
end
end

@ -0,0 +1,44 @@
module Docs
class Handlebars
class CleanHtmlFilter < Filter
def call
# Remove the t-shirt shop advertisement
css('#callout').remove
# The title filter is used to add titles to pages without one, remove original headers
css('h1').remove
# Remove the link to the issue tracker
css('.issue-tracker').remove
css('pre').each do |node|
# Remove nested nodes inside pre tags
node.content = node.content
# Add syntax highlighting
node['data-language'] = 'html'
end
# Transform 'Learn More' links to headers in the "Getting Started" part of the homepage
# If this step is skipped, that section looks cluttered with 4 sub-sections without any dividers
css('#getting-started + .contents a.more-info').each do |node|
clone = node.clone
# Move it to the top of the sub-section
node.parent.prepend_child(clone)
# Turn it into a header
clone.name = 'h3'
# Remove the "Learn More: " part
clone.content = clone.content[12..-1]
end
# Remove class attributes from div elements to reduce file size
css('div').remove_attr('class')
doc
end
end
end
end

@ -0,0 +1,19 @@
module Docs
class Handlebars
class EntriesFilter < Docs::EntriesFilter
def get_name
subpath[0..-6].titleize
end
def get_type
name
end
def additional_entries
css('h2, h3').to_a.map do |node|
[node.content.strip, node['id'], root_page? ? 'Manual' : nil]
end
end
end
end
end

@ -0,0 +1,24 @@
module Docs
class Puppeteer
class CleanHtmlFilter < Filter
def call
at_css('h1').content = 'Puppeteer Documentation'
# None of the elements to remove have classes, so the order of the remove calls is trivial
# Remove links to previous versions of the reference
at_css('h1 + ul').remove
# Remove table of contents
at_css('h1 + h5').remove
at_css('h1 + ul').remove
# Make headers bigger by transforming them into a bigger variant
css('h3').each { |node| node.name = 'h2' }
css('h4').each { |node| node.name = 'h3' }
doc
end
end
end
end

@ -0,0 +1,41 @@
module Docs
class Puppeteer
class EntriesFilter < Docs::EntriesFilter
# The entire reference is one big page, so get_name and get_type are not necessary
def additional_entries
entries = []
css('h3').each do |node|
name = node.content.split(': ').last
# Find all sub-items (all h4's between the current h3 and the next)
current = node.next
while !current.nil? && current.name != 'h3'
if current.name == 'h4'
current_name = current.content
# Prepend events with the class name
if current_name.start_with?('event: ')
current_name = "#{name} event: #{current_name[/'(.*)'/, 1]}"
end
# Remove arguments from functions
if current_name.include?('(')
current_name = current_name.split('(')[0] + '()'
end
entries << [current_name, current['id'], name]
end
current = current.next
end
entries << [name, node['id'], name]
end
entries
end
end
end
end

@ -0,0 +1,102 @@
module Docs
class Pygame
class CleanHtmlFilter < Filter
def call
@doc = at_css '.body'
if root_page?
# remove unneeded stuff
at_css('.modindex-jumpbox').remove
css('[role="navigation"],.pcap, .cap, .footer').remove
# table -> list
list = at_css('table')
list.replace(list.children)
list.name = 'ul'
css('tr').each do |row|
row.name = 'li'
row.remove_attribute('class')
end
at_css('h1').content = 'Pygame'
return doc
end
# remove unwanted stuff
# .headerlink => ¶ after links
# .toc => table of content
# .tooltip-content => tooltips after links to functions
css('table.toc.docutils, .headerlink, .tooltip-content').remove
# Remove wrapper .section
section = at_css('.section')
definition = at_css('.definition')
definition['id'] = section['id']
section.replace(section.children)
# Format code for it be highlighted
css('.highlight-default.notranslate').each do |node|
pre = node.at_css('pre')
node.replace(pre)
# gets rid of the already existing syntax highlighting
pre.content = pre.content
pre['class'] = 'language-python'
pre['data-language'] = "python"
end
# change descriptions of functions/attributes to blockquote
css('.line-block').each do |node|
node.name = 'blockquote'
end
# change functions
css('.definition').each do |d|
# the header is the function/attribute name. It might look something like
# this:
# pygame.image.load()
# It'll end up being something like this:
# pygame.image.load(filename) -> Surface
# pygame.image.load(fileobj, namehint="") -> Surface
header = d.at_css('dt.title')
if d['class'].include?('class') or d['class'].include?('module')
header.name = 'h1'
@section = header.content.strip
else
header.name = 'h3'
end
# save the original header
initial_header = header.content.strip
# save the real name for the entries
header['data-name'] = initial_header
# empty the header
if header.name == 'h3'
header.inner_html = ''
end
# to replace it with the signatures
next_el = header.next_element
signatures = next_el.css('.signature')
signatures.each do |sig|
sig.name = 'code'
if header.name == 'h3'
sig.parent = header
# the signature don't contain pygame.module. I think it's better
# to display them, as it avoids confusion with methods (have a
# look at the pygame.Rect page)
if initial_header.start_with?(@section)
sig.content = @section + '.' + sig.text
end
# seperate the signatures on different lines.
header.add_child "<br>"
end
end
end
css('> dl', '> dl > dd', 'h1 code').each do |node|
node.before(node.children).remove
end
doc
end
end
end
end

@ -0,0 +1,29 @@
module Docs
class Pygame
class EntriesFilter < Docs::EntriesFilter
def get_name
at_css('h1').content.remove('pygame.')
end
def get_type
at_css('h1').content
end
def additional_entries
return [] if root_page?
css('h1, h2, h3').each_with_object [] do |node, entries|
name = node['id'] || node['data-name']
if node.parent['class'].include?('function') or node.parent['class'].include?('method')
name << '()'
end
name.remove!('pygame.')
entries << [name, node['id']] unless name == self.name
end
end
end
end
end

@ -15,15 +15,17 @@ module Docs
def other def other
css('h1').each do |node| css('h1').each do |node|
node.content = node.content.sub!(/\A[\d\.]+/) do |str| node.content = node.content.sub(/\A[\d\.]+/) do |str|
rgx = /\A#{str}/ rgx = /\A#{str}/
@levelRegexp = @levelRegexp ? Regexp.union(@levelRegexp, rgx) : rgx @levelRegexp = @levelRegexp ? Regexp.union(@levelRegexp, rgx) : rgx
'' ''
end end
end end
css('h2', 'h3', 'h4').each do |node| unless @levelRegexp.nil?
node.inner_html = node.inner_html.remove @levelRegexp css('h2', 'h3', 'h4').each do |node|
node.inner_html = node.inner_html.remove @levelRegexp
end
end end
end end
end end

@ -2,16 +2,18 @@ module Docs
class Python class Python
class EntriesV3Filter < Docs::EntriesFilter class EntriesV3Filter < Docs::EntriesFilter
REPLACE_TYPES = { REPLACE_TYPES = {
'Cryptographic' => 'Cryptography', 'contextvars — Context Variables' => 'Context Variables',
'Custom Interpreters' => 'Interpreters', 'Cryptographic' => 'Cryptography',
'Data Compression & Archiving' => 'Data Compression', 'Custom Interpreters' => 'Interpreters',
'Generic Operating System' => 'Operating System', 'Data Compression & Archiving' => 'Data Compression',
'Graphical User Interfaces with Tk' => 'Tk', 'email — An email & MIME handling package' => 'Email',
'Internet Data Handling' => 'Internet Data', 'Generic Operating System' => 'Operating System',
'Internet Protocols & Support' => 'Internet', 'Graphical User Interfaces with Tk' => 'Tk',
'Interprocess Communication & Networking' => 'Networking', 'Internet Data Handling' => 'Internet Data',
'Program Frameworks' => 'Frameworks', 'Internet Protocols & Support' => 'Internet',
'Structured Markup Processing Tools' => 'Structured Markup' } 'Interprocess Communication & Networking' => 'Networking',
'Program Frameworks' => 'Frameworks',
'Structured Markup Processing Tools' => 'Structured Markup' }
def get_name def get_name
name = at_css('h1').content name = at_css('h1').content

@ -0,0 +1,31 @@
module Docs
class Qt
class CleanHtmlFilter < Filter
def call
# Remove unneeded elements
css('.copy-notice, .navigationbar, .headerNavi, .footerNavi, .sidebar, .toc, #ec_toggle', '.landingicons img', 'br').remove
# QML property/method header
css('.qmlproto').each do |node|
id = node.at_css('tr')['id']
node.inner_html = node.at_css('td').inner_html
node.name = 'h3'
node['id'] = id
end
css('.main-rounded', '.content', '.line', '.context', '.descr', '.types', '.func', '.table', 'div:not([class])', '.landing', '.col-1', '.heading', '.qmlitem', '.qmldoc', 'div.pre').each do |node|
node.before(node.children).remove
end
css('pre').each do |node|
node.content = node.content
node['data-language'] = 'cpp' if node['class'].include?('cpp')
node['data-language'] = 'qml' if node['class'].include?('qml')
node.remove_attribute('class')
end
doc
end
end
end
end

@ -0,0 +1,141 @@
# frozen_string_literal: true
module Docs
class Qt
class EntriesFilter < Docs::EntriesFilter
def get_name
header = at_css('h1.title + .small-subtitle a') || at_css('h1.title') || at_css('.context h2')
name = header.content
name.sub! %r{ Class$}, ' (class)'
name.sub! %r{ QML Type$}, ' (QML type)'
name.sub! %r{ QML Basic Type$}, ' (QML basic type)'
# Add '(class)' to the class pages where the subtitle name is used (e.g. qset-const-iterator.html)
if at_css('h1.title').content.strip.end_with?(' Class') && !name.include?('(class)')
name = "#{name} (class) "
end
name
end
def get_type
breadcrumb = css('#main_title_bar + ul li')
category = if breadcrumb.length < 3
then 'Qt'.dup
else breadcrumb.at(1).content
end
if category == 'Qt'
return 'Qt Platforms' if name.include?(' for ') || name == 'Qt Platform Abstraction'
return 'Qt Quick' if name == 'Qt Quick Test' || name == 'Qt Quick Test Reference Documentation'
alwaysInQt = ['Qt Configure Options', 'Qt Image Formats']
category = name if name.start_with?('Qt ') && !alwaysInQt.include?(name)
end
qtPlatformsTypes = ['Qt Platform Headers', 'Qt Android Extras', 'Qt Mac Extras', 'Qt Windows Extras', 'Qt X11 Extras']
return 'Qt Platforms' if qtPlatformsTypes.include?(category)
category.remove!(' Manual')
category
end
def include_default_entry?
name != 'All Classes' && name != 'All QML Types'
end
def additional_entries
entries = []
titles = []
className = at_css('h1.title').content.strip.remove(' Class')
displayedClassName = className
alternativeClassName = at_css('h1.title + .small-subtitle a')
displayedClassName = alternativeClassName.content if alternativeClassName
# Functions signatures
css('h3.fn').each do |node|
header = node.clone
# Skip typenames
next if header.content.strip.start_with?('typename ')
# Remove leading <a name="">
header.children.css('a[name]').remove
# Remove leading <code> tag (virtual/static/… attributes)
code = header.children.first
code.remove if code.name == 'code'
# Remove leading const
header.children.first.remove if header.content.strip.start_with?('const ')
# Remove return type
returnType = header.children.first
returnType.remove if returnType['class'] == 'type'
title = header.content.strip
# Remove leading '&'/'*'
title[0] = '' if title[0] == '&' || title[0] == '*'
# Ignore operator overloads
next if title.start_with?('operator')
# Remove function parameters
title.sub! %r{\(.*\)}, '()'
# Remove template generics
title.remove!(%r{^<.*> })
# Remove const at the end
title.remove!(%r{ const$})
# Enum/typedef formatting
title.sub! %r{(enum|typedef) (.*)}, '\2 (\1)'
# Remove property type
title = "#{displayedClassName}::#{title}" if title.sub!(%r{ : .*$}, '')
# Replace the class name by the alternative class name if available
title = title.sub(className, displayedClassName) if alternativeClassName
unless titles.include?(title) # Remove duplicates (function overloading)
entries << [title, header['id']]
titles.push title
end
end
# QML properties/functions
qmlTypeName = at_css('h1.title').content.remove(' QML Type', '')
css('.qmlproto').each do |node|
title = node.content.strip
id = node.at_css('tr')['id']
# Remove options
title.remove!(%r{^\[.*\] })
# Remove function parameters
title.sub! %r{\(.*\)}, '()'
# Remove property type
title.remove!(%r{ : .*$})
# Remove return type
title.remove!(%r{.* })
# Remove return type
title.remove!(%r{.* })
title = "#{qmlTypeName}.#{title.strip}"
unless titles.include?(title) # Remove duplicates (function overloading)
entries << [title, id]
titles.push(title)
end
end
entries
end
end
end
end

@ -12,7 +12,7 @@ module Docs
when 'HDEL' then 'Hashes' when 'HDEL' then 'Hashes'
when 'BLPOP' then 'Lists' when 'BLPOP' then 'Lists'
when 'SADD' then 'Sets' when 'SADD' then 'Sets'
when 'ZADD' then 'Sorted Sets' when 'BZPOPMAX' then 'Sorted Sets'
when 'PSUBSCRIBE' then 'Pub/Sub' when 'PSUBSCRIBE' then 'Pub/Sub'
when 'DISCARD' then 'Transactions' when 'DISCARD' then 'Transactions'
when 'EVAL' then 'Scripting' when 'EVAL' then 'Scripting'
@ -21,6 +21,7 @@ module Docs
when 'PFADD' then 'HyperLogLog' when 'PFADD' then 'HyperLogLog'
when 'CLUSTER ADDSLOTS' then 'Cluster' when 'CLUSTER ADDSLOTS' then 'Cluster'
when 'GEOADD' then 'Geo' when 'GEOADD' then 'Geo'
when 'XADD' then 'Stream'
else 'Miscellaneous' else 'Miscellaneous'
end end
end end

@ -2,10 +2,8 @@ module Docs
class Rust class Rust
class CleanHtmlFilter < Filter class CleanHtmlFilter < Filter
def call def call
puts subpath if at_css('#versioninfo')
if slug.start_with?('book') || slug.start_with?('reference') if slug.start_with?('book') || slug.start_with?('reference')
@doc = at_css('#content') @doc = at_css('#content main')
elsif slug == 'error-index' elsif slug == 'error-index'
css('.error-undescribed').remove css('.error-undescribed').remove
@ -29,12 +27,16 @@ module Docs
css('.rusttest', '.test-arrow', 'hr').remove css('.rusttest', '.test-arrow', 'hr').remove
css('.docblock.attributes').each do |node|
node.remove if node.content.include?('#[must_use]')
end
css('a.header').each do |node| css('a.header').each do |node|
node.first_element_child['id'] = node['name'] node.first_element_child['id'] = node['name'] || node['id']
node.before(node.children).remove node.before(node.children).remove
end end
css('.docblock > h1').each { |node| node.name = 'h4' } css('.docblock > h1:not(.section-header)').each { |node| node.name = 'h4' }
css('h2.section-header').each { |node| node.name = 'h3' } css('h2.section-header').each { |node| node.name = 'h3' }
css('h1.section-header').each { |node| node.name = 'h2' } css('h1.section-header').each { |node| node.name = 'h2' }
@ -44,7 +46,7 @@ module Docs
end end
end end
css('> .impl-items', '> .docblock', 'pre > pre').each do |node| css('> .impl-items', '> .docblock', 'pre > pre', '.tooltiptext', '.tooltip').each do |node|
node.before(node.children).remove node.before(node.children).remove
end end
@ -62,6 +64,35 @@ module Docs
node['data-language'] = 'rust' if node['class'] && node['class'].include?('rust') node['data-language'] = 'rust' if node['class'] && node['class'].include?('rust')
end end
doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2'
at_css('h1').content = 'Rust Documentation' if root_page?
css('.table-display').each do |node|
node.css('td').each do |td|
node.before(td.children)
end
node.remove
end
css('h2 .important-traits', 'h3 .important-traits', 'h4 .important-traits').each do |node|
content = node.at_css('.content.hidden .content')
node.at_css('.content.hidden').replace(content) if content
node.parent.after(node)
end
css('code.content').each do |node|
node.name = 'pre'
node.css('.fmt-newline').each do |line|
line.inner_html = line.inner_html + "\n"
end
node.inner_html = node.inner_html.gsub('<br>', "\n")
node.content = node.content
end
css('.since + .srclink').each do |node|
node.previous_element.before(node)
end
doc doc
end end
end end

@ -42,11 +42,14 @@ module Docs
entries << [node.content, node['id']] unless node.content.include?('Note:') entries << [node.content, node['id']] unless node.content.include?('Note:')
end end
else else
css('#methods + * + div > .method', '#required-methods + div > .method', '#provided-methods + div > .method').map do |node| css('.method')
name = node.at_css('.fnname').content .select {|node| !node.at_css('.fnname').nil?}
name.prepend "#{self.name}::" .map {|node|
[name, node['id']] name = node.at_css('.fnname').content
end name.prepend "#{self.name}::"
[name, node['id']]
}
.uniq {|item| item[0]}
end end
end end
end end

@ -9,6 +9,7 @@ module Docs
def get_type def get_type
return 'Declaration Files' if subpath.include?('declaration-files') return 'Declaration Files' if subpath.include?('declaration-files')
return 'Project Configuration' if slug == 'handbook/configuring-watch'
type = at_css('#main-nav a.active').ancestors('.panel').first.at_css('> a').content type = at_css('#main-nav a.active').ancestors('.panel').first.at_css('> a').content
type = name if type == 'Handbook' type = name if type == 'Handbook'
type type

@ -3,7 +3,7 @@ module Docs
self.name = 'Apache HTTP Server' self.name = 'Apache HTTP Server'
self.slug = 'apache_http_server' self.slug = 'apache_http_server'
self.type = 'apache' self.type = 'apache'
self.release = '2.4.33' self.release = '2.4.34'
self.base_url = 'https://httpd.apache.org/docs/2.4/en/' self.base_url = 'https://httpd.apache.org/docs/2.4/en/'
self.links = { self.links = {
home: 'https://httpd.apache.org/' home: 'https://httpd.apache.org/'

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save