Unified · Split
| @@ -0,0 +1,8 @@ | ||
| 1 | +root = true | |
| 2 | + | |
| 3 | +[*] | |
| 4 | +charset = utf-8 | |
| 5 | +indent_style = space | |
| 6 | +indent_size = 2 | |
| 7 | +insert_final_newline = true | |
| 8 | +trim_trailing_whitespace = true | |
| @@ -1,4 +1,7 @@ | ||
| 1 | 1 | language: ruby |
| 2 | + | |
| 3 | +cache: bundler | |
| 4 | + | |
| 2 | 5 | before_script: |
| 3 | 6 | - gem update --system |
| 4 | 7 | - gem install bundler |
| @@ -1,5 +1,7 @@ | ||
| 1 | 1 | FROM ruby:2.5.1 |
| 2 | 2 | |
| 3 | +ENV LANG=C.UTF-8 | |
| 4 | + | |
| 3 | 5 | WORKDIR /devdocs |
| 4 | 6 | |
| 5 | 7 | RUN apt-get update && \ |
| @@ -1,5 +1,7 @@ | ||
| 1 | 1 | FROM ruby:2.5.1-alpine |
| 2 | 2 | |
| 3 | +ENV LANG=C.UTF-8 | |
| 4 | + | |
| 3 | 5 | WORKDIR /devdocs |
| 4 | 6 | |
| 5 | 7 | COPY . /devdocs |
| @@ -11,6 +11,7 @@ group :app do · 10 unmodified lines | ||
| 11 | 11 | gem 'rack' |
| 12 | 12 | gem 'sinatra' |
| 13 | 13 | gem 'sinatra-contrib' |
| 14 | + gem 'rack-ssl-enforcer' | |
| 14 | 15 | gem 'thin' |
| 15 | 16 | gem 'sprockets' |
| 16 | 17 | gem 'sprockets-helpers' |
| @@ -1,13 +1,13 @@ | ||
| 1 | 1 | GEM |
| 2 | 2 | remote: https://rubygems.org/ |
| 3 | 3 | specs: |
| 4 | − activesupport (5.2.0) | |
| 4 | + activesupport (5.2.1) | |
| 5 | 5 | concurrent-ruby (~> 1.0, >= 1.0.2) |
| 6 | 6 | i18n (>= 0.7, < 2) |
| 7 | 7 | minitest (~> 5.1) |
| 8 | 8 | tzinfo (~> 1.1) |
| 9 | − backports (3.11.3) | |
| 10 | − better_errors (2.4.0) | |
| 9 | + backports (3.11.4) | |
| 10 | + better_errors (2.5.0) | |
| 11 | 11 | coderay (>= 1.0.0) |
| 12 | 12 | erubi (>= 1.0.0) |
| 13 | 13 | rack (>= 0.9.0) |
| @@ -27,75 +27,78 @@ GEM · 13 unmodified lines | ||
| 27 | 27 | exifr (1.3.4) |
| 28 | 28 | ffi (1.9.25) |
| 29 | 29 | fspath (3.1.0) |
| 30 | − highline (1.7.10) | |
| 31 | − html-pipeline (2.8.3) | |
| 30 | + highline (2.0.0) | |
| 31 | + html-pipeline (2.8.4) | |
| 32 | 32 | activesupport (>= 2) |
| 33 | 33 | nokogiri (>= 1.4) |
| 34 | − i18n (1.0.1) | |
| 34 | + i18n (1.1.0) | |
| 35 | 35 | concurrent-ruby (~> 1.0) |
| 36 | − image_optim (0.26.1) | |
| 36 | + image_optim (0.26.2) | |
| 37 | 37 | exifr (~> 1.2, >= 1.2.2) |
| 38 | 38 | fspath (~> 3.0) |
| 39 | − image_size (~> 1.5) | |
| 39 | + image_size (>= 1.5, < 3) | |
| 40 | 40 | in_threads (~> 1.3) |
| 41 | 41 | progress (~> 3.0, >= 3.0.1) |
| 42 | 42 | image_optim_pack (0.5.1) |
| 43 | 43 | fspath (>= 2.1, < 4) |
| 44 | 44 | image_optim (~> 0.19) |
| 45 | − image_size (1.5.0) | |
| 45 | + image_size (2.0.0) | |
| 46 | 46 | in_threads (1.5.0) |
| 47 | 47 | method_source (0.9.0) |
| 48 | 48 | mini_portile2 (2.3.0) |
| 49 | 49 | minitest (5.11.3) |
| 50 | 50 | multi_json (1.13.1) |
| 51 | − mustermann (1.0.2) | |
| 52 | − newrelic_rpm (5.2.0.345) | |
| 51 | + mustermann (1.0.3) | |
| 52 | + newrelic_rpm (5.4.0.347) | |
| 53 | 53 | nokogiri (1.8.4) |
| 54 | 54 | mini_portile2 (~> 2.3.0) |
| 55 | 55 | options (2.3.2) |
| 56 | 56 | progress (3.4.0) |
| 57 | − progress_bar (1.2.0) | |
| 58 | − highline (~> 1.6) | |
| 57 | + progress_bar (1.3.0) | |
| 58 | + highline (>= 1.6, < 3) | |
| 59 | 59 | options (~> 2.3.0) |
| 60 | 60 | pry (0.11.3) |
| 61 | 61 | coderay (~> 1.1.0) |
| 62 | 62 | method_source (~> 0.9.0) |
| 63 | 63 | rack (2.0.5) |
| 64 | − rack-protection (2.0.3) | |
| 64 | + rack-protection (2.0.4) | |
| 65 | 65 | rack |
| 66 | − rack-test (1.0.0) | |
| 66 | + rack-ssl-enforcer (0.2.9) | |
| 67 | + rack-test (1.1.0) | |
| 67 | 68 | rack (>= 1.0, < 3) |
| 68 | 69 | rake (12.3.1) |
| 69 | 70 | rb-fsevent (0.10.3) |
| 70 | 71 | rb-inotify (0.9.10) |
| 71 | 72 | ffi (>= 0.5.0, < 2) |
| 72 | 73 | rr (1.2.1) |
| 73 | − sass (3.5.6) | |
| 74 | + sass (3.6.0) | |
| 74 | 75 | sass-listen (~> 4.0.0) |
| 75 | 76 | sass-listen (4.0.0) |
| 76 | 77 | rb-fsevent (~> 0.9, >= 0.9.4) |
| 77 | 78 | rb-inotify (~> 0.9, >= 0.9.7) |
| 78 | − sinatra (2.0.3) | |
| 79 | + sinatra (2.0.4) | |
| 79 | 80 | mustermann (~> 1.0) |
| 80 | 81 | rack (~> 2.0) |
| 81 | − rack-protection (= 2.0.3) | |
| 82 | + rack-protection (= 2.0.4) | |
| 82 | 83 | tilt (~> 2.0) |
| 83 | − sinatra-contrib (2.0.3) | |
| 84 | + sinatra-contrib (2.0.4) | |
| 84 | 85 | activesupport (>= 4.0.0) |
| 85 | 86 | backports (>= 2.8.2) |
| 86 | 87 | multi_json |
| 87 | 88 | mustermann (~> 1.0) |
| 88 | − rack-protection (= 2.0.3) | |
| 89 | − sinatra (= 2.0.3) | |
| 89 | + rack-protection (= 2.0.4) | |
| 90 | + sinatra (= 2.0.4) | |
| 90 | 91 | tilt (>= 1.3, < 3) |
| 91 | 92 | sprockets (3.7.2) |
| 92 | 93 | concurrent-ruby (~> 1.0) |
| 93 | 94 | rack (> 1, < 3) |
| 94 | 95 | sprockets-helpers (1.2.1) |
| 95 | 96 | sprockets (>= 2.2) |
| 96 | − strings (0.1.1) | |
| 97 | − unicode-display_width (~> 1.3.0) | |
| 97 | + strings (0.1.4) | |
| 98 | + strings-ansi (~> 0.1.0) | |
| 99 | + unicode-display_width (~> 1.4.0) | |
| 98 | 100 | unicode_utils (~> 1.4.0) |
| 101 | + strings-ansi (0.1.0) | |
| 99 | 102 | thin (1.7.2) |
| 100 | 103 | daemons (~> 1.0, >= 1.0.9) |
| 101 | 104 | eventmachine (~> 1.0, >= 1.0.4) |
| @@ -107,18 +110,18 @@ GEM · 5 unmodified lines | ||
| 107 | 110 | strings (~> 0.1.0) |
| 108 | 111 | tty-screen (~> 0.6.4) |
| 109 | 112 | tty-which (~> 0.3.0) |
| 110 | − tty-screen (0.6.4) | |
| 113 | + tty-screen (0.6.5) | |
| 111 | 114 | tty-which (0.3.0) |
| 112 | 115 | typhoeus (1.3.0) |
| 113 | 116 | ethon (>= 0.9.0) |
| 114 | 117 | tzinfo (1.2.5) |
| 115 | 118 | thread_safe (~> 0.1) |
| 116 | − uglifier (4.1.14) | |
| 119 | + uglifier (4.1.19) | |
| 117 | 120 | execjs (>= 0.3.0, < 3) |
| 118 | − unicode-display_width (1.3.3) | |
| 121 | + unicode-display_width (1.4.0) | |
| 119 | 122 | unicode_utils (1.4.0) |
| 120 | 123 | unix_utils (0.0.15) |
| 121 | − yajl-ruby (1.4.0) | |
| 124 | + yajl-ruby (1.4.1) | |
| 122 | 125 | |
| 123 | 126 | PLATFORMS |
| 124 | 127 | ruby |
| @@ -138,6 +141,7 @@ DEPENDENCIES · 13 unmodified lines | ||
| 138 | 141 | progress_bar |
| 139 | 142 | pry (~> 0.11.0) |
| 140 | 143 | rack |
| 144 | + rack-ssl-enforcer | |
| 141 | 145 | rack-test |
| 142 | 146 | rake |
| 143 | 147 | rr |
| @@ -64,14 +64,10 @@ Another driving factor is performance and the fact that everything happens in th · 63 unmodified lines | ||
| 64 | 64 | |
| 65 | 65 | DevDocs being a developer tool, the browser requirements are high: |
| 66 | 66 | |
| 67 | −1. On the desktop: | |
| 68 | − * Recent version of Chrome, Firefox, or Opera | |
| 69 | − * Safari 8+ | |
| 70 | − * IE / Edge 10+ | |
| 71 | −2. On mobile: | |
| 72 | − * iOS 8+ | |
| 73 | − * Android 4.1+ | |
| 74 | − * Windows Phone 8+ | |
| 67 | +* Recent versions of Firefox, Chrome, or Opera | |
| 68 | +* Safari 9.1+ | |
| 69 | +* Edge 16+ | |
| 70 | +* iOS 10+ | |
| 75 | 71 | |
| 76 | 72 | This allows the code to take advantage of the latest DOM and HTML5 APIs and make developing DevDocs a lot more fun! |
| 77 | 73 | |
Binary file not shown.
Binary file not shown.
| @@ -245,7 +245,7 @@ · 244 unmodified lines | ||
| 245 | 245 | matchMedia: !!window.matchMedia |
| 246 | 246 | insertAdjacentHTML: !!document.body.insertAdjacentHTML |
| 247 | 247 | defaultPrevented: document.createEvent('CustomEvent').defaultPrevented is false |
| 248 | − cssGradients: supportsCssGradients() | |
| 248 | + cssVariables: CSS.supports and CSS.supports('(--t: 0)') | |
| 249 | 249 | |
| 250 | 250 | for key, value of features when not value |
| 251 | 251 | Raven.captureMessage "unsupported/#{key}", level: 'info' |
| @@ -268,9 +268,4 @@ · 16 unmodified lines | ||
| 268 | 268 | isInvalidLocation: -> |
| 269 | 269 | @config.env is 'production' and location.host.indexOf(app.config.production_host) isnt 0 |
| 270 | 270 | |
| 271 | −supportsCssGradients = -> | |
| 272 | − el = document.createElement('div') | |
| 273 | − el.style.cssText = "background-image: -webkit-linear-gradient(top, #000, #fff); background-image: linear-gradient(to top, #000, #fff);" | |
| 274 | − el.style.backgroundImage.indexOf('gradient') >= 0 | |
| 275 | − | |
| 276 | 271 | $.extend app, Events |
| @@ -149,6 +149,9 @@ class app.Shortcuts · 148 unmodified lines | ||
| 149 | 149 | when 40 |
| 150 | 150 | @trigger 'altDown' |
| 151 | 151 | false |
| 152 | + when 68 | |
| 153 | + @trigger 'altD' | |
| 154 | + false | |
| 152 | 155 | when 70 |
| 153 | 156 | @trigger 'altF', event |
| 154 | 157 | when 71 |
| @@ -190,7 +190,7 @@ isSameOrigin = (url) -> · 189 unmodified lines | ||
| 190 | 190 | |
| 191 | 191 | updateCanonicalLink = -> |
| 192 | 192 | @canonicalLink ||= document.head.querySelector('link[rel="canonical"]') |
| 193 | − @canonicalLink.setAttribute('href', "http://#{location.host}#{location.pathname}") | |
| 193 | + @canonicalLink.setAttribute('href', "https://#{location.host}#{location.pathname}") | |
| 194 | 194 | |
| 195 | 195 | trackers = [] |
| 196 | 196 | |
| @@ -1,5 +1,14 @@ | ||
| 1 | 1 | [ |
| 2 | 2 | [ |
| 3 | + "2018-09-23", | |
| 4 | + "New documentations: <a href=\"/puppeteer/\">Puppeteer</a> and <a href=\"/handlebars/\">Handlebars.js</a>" | |
| 5 | + ], [ | |
| 6 | + "2018-08-12", | |
| 7 | + "New documentations: <a href=\"/dart/\">Dart</a> and <a href=\"/qt/\">Qt</a>" | |
| 8 | + ], [ | |
| 9 | + "2018-07-29", | |
| 10 | + "New documentations: <a href=\"/bash/\">Bash</a>, <a href=\"/graphite/\">Graphite</a> and <a href=\"/pygame/\">Pygame</a>" | |
| 11 | + ], [ | |
| 3 | 12 | "2018-07-08", |
| 4 | 13 | "New documentations: <a href=\"/leaflet/\">Leaflet</a>, <a href=\"/terraform/\">Terraform</a> and <a href=\"/koa/\">Koa</a>" |
| 5 | 14 | ], [ |
| @@ -56,13 +56,10 @@ app.templates.unsupportedBrowser = """ · 55 unmodified lines | ||
| 56 | 56 | <h1 class="_fail-title">Your browser is unsupported, sorry.</h1> |
| 57 | 57 | <p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers: |
| 58 | 58 | <ul class="_fail-list"> |
| 59 | − <li>Recent versions of Chrome and Firefox | |
| 60 | − <li>Safari 5.1+ | |
| 61 | − <li>Opera 12.1+ | |
| 62 | − <li>Internet Explorer 10+ | |
| 63 | − <li>iOS 6+ | |
| 64 | − <li>Android 4.1+ | |
| 65 | − <li>Windows Phone 8+ | |
| 59 | + <li>Recent versions of Firefox, Chrome, or Opera | |
| 60 | + <li>Safari 9.1+ | |
| 61 | + <li>Edge 16+ | |
| 62 | + <li>iOS 10+ | |
| 66 | 63 | </ul> |
| 67 | 64 | <p class="_fail-text"> |
| 68 | 65 | If you're unable to upgrade, I apologize. |
| @@ -115,6 +115,11 @@ credits = [ · 114 unmodified lines | ||
| 115 | 115 | '2010-2016 Jeremy Ashkenas, DocumentCloud', |
| 116 | 116 | 'MIT', |
| 117 | 117 | 'https://raw.githubusercontent.com/jashkenas/backbone/master/LICENSE' |
| 118 | + ], [ | |
| 119 | + 'Bash', | |
| 120 | + '2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.', | |
| 121 | + 'GFDL', | |
| 122 | + 'https://www.gnu.org/licenses/fdl-1.3.en.html' | |
| 118 | 123 | ], [ |
| 119 | 124 | 'Bluebird', |
| 120 | 125 | '2013-2017 Petka Antonov', |
| @@ -162,7 +167,7 @@ credits = [ · 41 unmodified lines | ||
| 162 | 167 | 'https://github.com/clojure/clojure/blob/master/epl-v10.html' |
| 163 | 168 | ], [ |
| 164 | 169 | 'CMake', |
| 165 | − '2000-2017 Kitware, Inc. and Contributors', | |
| 170 | + '2000-2018 Kitware, Inc. and Contributors', | |
| 166 | 171 | 'BSD', |
| 167 | 172 | 'https://cmake.org/licensing/' |
| 168 | 173 | ], [ |
| @@ -210,6 +215,11 @@ credits = [ · 41 unmodified lines | ||
| 210 | 215 | '2010-2018 Michael Bostock', |
| 211 | 216 | 'BSD', |
| 212 | 217 | 'https://raw.githubusercontent.com/d3/d3/master/LICENSE' |
| 218 | + ], [ | |
| 219 | + 'Dart', | |
| 220 | + '2012 the Dart project authors', | |
| 221 | + 'CC BY-SA', | |
| 222 | + 'https://creativecommons.org/licenses/by-sa/4.0/' | |
| 213 | 223 | ], [ |
| 214 | 224 | 'Django', |
| 215 | 225 | 'Django Software Foundation and individual contributors', |
| @@ -290,11 +300,21 @@ credits = [ · 74 unmodified lines | ||
| 290 | 300 | '2014-2018 Juan Linietsky, Ariel Manzur, Godot Engine contributors', |
| 291 | 301 | 'MIT', |
| 292 | 302 | 'https://raw.githubusercontent.com/godotengine/godot/master/LICENSE.txt' |
| 303 | + ], [ | |
| 304 | + 'Graphite', | |
| 305 | + '2008-2012 Chris Davis<br>© 2011-2016 The Graphite Project', | |
| 306 | + 'Apache', | |
| 307 | + 'https://raw.githubusercontent.com/graphite-project/graphite-web/master/LICENSE' | |
| 293 | 308 | ], [ |
| 294 | 309 | 'Grunt', |
| 295 | 310 | 'GruntJS Team', |
| 296 | 311 | 'MIT', |
| 297 | 312 | 'https://github.com/gruntjs/grunt-docs/blob/master/package.json#L10' |
| 313 | + ], [ | |
| 314 | + 'Handlebars', | |
| 315 | + '2011-2017 Yehuda Katz', | |
| 316 | + 'MIT', | |
| 317 | + 'https://raw.githubusercontent.com/wycats/handlebars.js/master/LICENSE' | |
| 298 | 318 | ], [ |
| 299 | 319 | 'Haskell', |
| 300 | 320 | 'The University of Glasgow', |
| @@ -550,6 +570,16 @@ credits = [ · 249 unmodified lines | ||
| 550 | 570 | '1996-2018 The PostgreSQL Global Development Group<br>© 1994 The Regents of the University of California', |
| 551 | 571 | 'PostgreSQL', |
| 552 | 572 | 'https://www.postgresql.org/about/licence/' |
| 573 | + ], [ | |
| 574 | + 'Puppeteer', | |
| 575 | + '2017 Google Inc', | |
| 576 | + 'Apache', | |
| 577 | + 'https://raw.githubusercontent.com/GoogleChrome/puppeteer/master/LICENSE' | |
| 578 | + ], [ | |
| 579 | + 'Pygame', | |
| 580 | + 'Pygame Developpers', | |
| 581 | + 'LGPLv2.1', | |
| 582 | + 'https://raw.githubusercontent.com/pygame/pygame/master/LICENSE' | |
| 553 | 583 | ], [ |
| 554 | 584 | 'Python', |
| 555 | 585 | '2001-2018 Python Software Foundation<br>Python is a trademark of the Python Software Foundation.', |
| @@ -560,6 +590,11 @@ credits = [ · 4 unmodified lines | ||
| 560 | 590 | '2009-2017 Kristopher Michael Kowal', |
| 561 | 591 | 'MIT', |
| 562 | 592 | 'https://raw.githubusercontent.com/kriskowal/q/master/LICENSE' |
| 593 | + ], [ | |
| 594 | + 'Qt', | |
| 595 | + '2012-2018 The Qt Company Ltd', | |
| 596 | + 'GFDL', | |
| 597 | + 'https://doc.qt.io/qt-5/licensing.html' | |
| 563 | 598 | ], [ |
| 564 | 599 | 'Ramda', |
| 565 | 600 | '2013-2016 Scott Sauyet and Michael Hurley', |
| @@ -131,6 +131,9 @@ app.templates.helpPage = -> · 130 unmodified lines | ||
| 131 | 131 | <dt class="_shortcuts-dt"> |
| 132 | 132 | <code class="_shortcut-code">alt + s</code> |
| 133 | 133 | <dd class="_shortcuts-dd">Search on Stack Overflow |
| 134 | + <dt class="_shortcuts-dt"> | |
| 135 | + <code class="_shortcut-code">alt + d</code> | |
| 136 | + <dd class="_shortcuts-dd">Search on DuckDuckGo | |
| 134 | 137 | </dl> |
| 135 | 138 | <p class="_note _note-green"> |
| 136 | 139 | <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 = """ · 71 unmodified lines | ||
| 72 | 72 | <p>To install DevDocs on your phone, visit <a href="https://devdocs.io" target="_blank" rel="noopener">devdocs.io</a> in Chrome and select "Add to home screen" in the menu. |
| 73 | 73 | </div> |
| 74 | 74 | """ |
| 75 | − | |
| 76 | −app.templates.httpWarning = """ | |
| 77 | − <div class="_intro"><div class="_intro-message"> | |
| 78 | − <h2 class="_intro-title">Hi there!</h2> | |
| 79 | − <p>DevDocs is migrating to HTTPS. | |
| 80 | − <p>Please update your bookmarks to point to <a href="https://devdocs.io">https://devdocs.io</a>. | |
| 81 | − <p>When using the HTTPS version, your preferences will carry over automatically, but your offline data will be reset. Simply re-download documentation in the <a href="https://devdocs.io/offline">Offline area</a>, and you'll be all set to use DevDocs securely offline. | |
| 82 | − <p>Sorry for the inconvenience. This migration is needed because browsers are removing support for certain DOM APIs that power DevDocs's offline mode over non-secure origins. | |
| 83 | − <p>Thanks for using DevDocs, and happy coding! | |
| 84 | − </div></div> | |
| 85 | −""" | |
| @@ -1,4 +1,5 @@ | ||
| 1 | −/* http://prismjs.com/download.html?themes=prism&languages=markup+css+clike+javascript+c+bash+cpp+coffeescript+ruby+d+django+elixir+erlang+go+java+json+kotlin+lua+nginx+nim+perl+php+python+jsx+crystal+rust+scss+sql+typescript+yaml */ | |
| 1 | +/* PrismJS 1.15.0 | |
| 2 | +https://prismjs.com/download.html#themes=prism&languages=markup+css+clike+javascript+c+bash+cpp+coffeescript+ruby+d+dart+django+elixir+markup-templating+erlang+go+java+json+kotlin+lua+crystal+nginx+nim+perl+php+sql+scss+python+jsx+typescript+rust+yaml */ | |
| 2 | 3 | var _self = (typeof window !== 'undefined') |
| 3 | 4 | ? window // if in browser |
| 4 | 5 | : ( |
| @@ -16,11 +17,12 @@ var _self = (typeof window !== 'undefined') · 11 unmodified lines | ||
| 16 | 17 | var Prism = (function(){ |
| 17 | 18 | |
| 18 | 19 | // Private helper vars |
| 19 | −var lang = /\blang(?:uage)?-(\w+)\b/i; | |
| 20 | +var lang = /\blang(?:uage)?-([\w-]+)\b/i; | |
| 20 | 21 | var uniqueId = 0; |
| 21 | 22 | |
| 22 | 23 | var _ = _self.Prism = { |
| 23 | 24 | manual: _self.Prism && _self.Prism.manual, |
| 25 | + disableWorkerMessageHandler: _self.Prism && _self.Prism.disableWorkerMessageHandler, | |
| 24 | 26 | util: { |
| 25 | 27 | encode: function (tokens) { |
| 26 | 28 | if (tokens instanceof Token) { |
| @@ -44,23 +46,38 @@ var _ = _self.Prism = { · 17 unmodified lines | ||
| 44 | 46 | }, |
| 45 | 47 | |
| 46 | 48 | // Deep clone a language definition (e.g. to extend it) |
| 47 | − clone: function (o) { | |
| 49 | + clone: function (o, visited) { | |
| 48 | 50 | var type = _.util.type(o); |
| 51 | + visited = visited || {}; | |
| 49 | 52 | |
| 50 | 53 | switch (type) { |
| 51 | 54 | case 'Object': |
| 55 | + if (visited[_.util.objId(o)]) { | |
| 56 | + return visited[_.util.objId(o)]; | |
| 57 | + } | |
| 52 | 58 | var clone = {}; |
| 59 | + visited[_.util.objId(o)] = clone; | |
| 53 | 60 | |
| 54 | 61 | for (var key in o) { |
| 55 | 62 | if (o.hasOwnProperty(key)) { |
| 56 | − clone[key] = _.util.clone(o[key]); | |
| 63 | + clone[key] = _.util.clone(o[key], visited); | |
| 57 | 64 | } |
| 58 | 65 | } |
| 59 | 66 | |
| 60 | 67 | return clone; |
| 61 | 68 | |
| 62 | 69 | case 'Array': |
| 63 | − return o.map(function(v) { return _.util.clone(v); }); | |
| 70 | + if (visited[_.util.objId(o)]) { | |
| 71 | + return visited[_.util.objId(o)]; | |
| 72 | + } | |
| 73 | + var clone = []; | |
| 74 | + visited[_.util.objId(o)] = clone; | |
| 75 | + | |
| 76 | + o.forEach(function (v, i) { | |
| 77 | + clone[i] = _.util.clone(v, visited); | |
| 78 | + }); | |
| 79 | + | |
| 80 | + return clone; | |
| 64 | 81 | } |
| 65 | 82 | |
| 66 | 83 | return o; |
| @@ -155,6 +172,10 @@ var _ = _self.Prism = { · 88 unmodified lines | ||
| 155 | 172 | plugins: {}, |
| 156 | 173 | |
| 157 | 174 | highlightAll: function(async, callback) { |
| 175 | + _.highlightAllUnder(document, async, callback); | |
| 176 | + }, | |
| 177 | + | |
| 178 | + highlightAllUnder: function(container, async, callback) { | |
| 158 | 179 | var env = { |
| 159 | 180 | callback: callback, |
| 160 | 181 | selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code' |
| @@ -162,7 +183,7 @@ var _ = _self.Prism = { · 1 unmodified line | ||
| 162 | 183 | |
| 163 | 184 | _.hooks.run("before-highlightall", env); |
| 164 | 185 | |
| 165 | − var elements = env.elements || document.querySelectorAll(env.selector); | |
| 186 | + var elements = env.elements || container.querySelectorAll(env.selector); | |
| 166 | 187 | |
| 167 | 188 | for (var i=0, element; element = elements[i++];) { |
| 168 | 189 | _.highlightElement(element, async === true, env.callback); |
| @@ -185,11 +206,13 @@ var _ = _self.Prism = { · 16 unmodified lines | ||
| 185 | 206 | // Set language on the element, if not present |
| 186 | 207 | element.className = element.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; |
| 187 | 208 | |
| 188 | − // Set language on the parent, for styling | |
| 189 | − parent = element.parentNode; | |
| 209 | + if (element.parentNode) { | |
| 210 | + // Set language on the parent, for styling | |
| 211 | + parent = element.parentNode; | |
| 190 | 212 | |
| 191 | − if (/pre/i.test(parent.nodeName)) { | |
| 192 | − parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; | |
| 213 | + if (/pre/i.test(parent.nodeName)) { | |
| 214 | + parent.className = parent.className.replace(lang, '').replace(/\s+/g, ' ') + ' language-' + language; | |
| 215 | + } | |
| 193 | 216 | } |
| 194 | 217 | |
| 195 | 218 | var code = element.textContent; |
| @@ -251,8 +274,15 @@ var _ = _self.Prism = { · 55 unmodified lines | ||
| 251 | 274 | }, |
| 252 | 275 | |
| 253 | 276 | highlight: function (text, grammar, language) { |
| 254 | − var tokens = _.tokenize(text, grammar); | |
| 255 | − return Token.stringify(_.util.encode(tokens), language); | |
| 277 | + var env = { | |
| 278 | + code: text, | |
| 279 | + grammar: grammar, | |
| 280 | + language: language | |
| 281 | + }; | |
| 282 | + _.hooks.run('before-tokenize', env); | |
| 283 | + env.tokens = _.tokenize(env.code, env.grammar); | |
| 284 | + _.hooks.run('after-tokenize', env); | |
| 285 | + return Token.stringify(_.util.encode(env.tokens), env.language); | |
| 256 | 286 | }, |
| 257 | 287 | |
| 258 | 288 | matchGrammar: function (text, strarr, grammar, index, startPos, oneshot, target) { |
| @@ -300,15 +330,9 @@ var _ = _self.Prism = { · 41 unmodified lines | ||
| 300 | 330 | continue; |
| 301 | 331 | } |
| 302 | 332 | |
| 303 | − pattern.lastIndex = 0; | |
| 304 | − | |
| 305 | − var match = pattern.exec(str), | |
| 306 | − delNum = 1; | |
| 307 | − | |
| 308 | − // Greedy patterns can override/remove up to two previously matched tokens | |
| 309 | − if (!match && greedy && i != strarr.length - 1) { | |
| 333 | + if (greedy && i != strarr.length - 1) { | |
| 310 | 334 | pattern.lastIndex = pos; |
| 311 | − match = pattern.exec(text); | |
| 335 | + var match = pattern.exec(text); | |
| 312 | 336 | if (!match) { |
| 313 | 337 | break; |
| 314 | 338 | } |
| @@ -327,11 +351,8 @@ var _ = _self.Prism = { · 12 unmodified lines | ||
| 327 | 351 | } |
| 328 | 352 | } |
| 329 | 353 | |
| 330 | − /* | |
| 331 | − * If strarr[i] is a Token, then the match starts inside another Token, which is invalid | |
| 332 | − * If strarr[k - 1] is greedy we are in conflict with another greedy pattern | |
| 333 | − */ | |
| 334 | − if (strarr[i] instanceof Token || strarr[k - 1].greedy) { | |
| 354 | + // If strarr[i] is a Token, then the match starts inside another Token, which is invalid | |
| 355 | + if (strarr[i] instanceof Token) { | |
| 335 | 356 | continue; |
| 336 | 357 | } |
| 337 | 358 | |
| @@ -339,6 +360,11 @@ var _ = _self.Prism = { · 1 unmodified line | ||
| 339 | 360 | delNum = k - i; |
| 340 | 361 | str = text.slice(pos, p); |
| 341 | 362 | match.index -= pos; |
| 363 | + } else { | |
| 364 | + pattern.lastIndex = 0; | |
| 365 | + | |
| 366 | + var match = pattern.exec(str), | |
| 367 | + delNum = 1; | |
| 342 | 368 | } |
| 343 | 369 | |
| 344 | 370 | if (!match) { |
| @@ -350,7 +376,7 @@ var _ = _self.Prism = { · 5 unmodified lines | ||
| 350 | 376 | } |
| 351 | 377 | |
| 352 | 378 | if(lookbehind) { |
| 353 | − lookbehindLength = match[1].length; | |
| 379 | + lookbehindLength = match[1] ? match[1].length : 0; | |
| 354 | 380 | } |
| 355 | 381 | |
| 356 | 382 | var from = match.index + lookbehindLength, |
| @@ -480,18 +506,21 @@ Token.stringify = function(o, language, parent) { · 123 unmodified lines | ||
| 480 | 506 | // // in Node.js |
| 481 | 507 | // return _self.Prism; |
| 482 | 508 | // } |
| 483 | −// // In worker | |
| 484 | −// _self.addEventListener('message', function(evt) { | |
| 485 | −// var message = JSON.parse(evt.data), | |
| 486 | −// lang = message.language, | |
| 487 | −// code = message.code, | |
| 488 | −// immediateClose = message.immediateClose; | |
| 489 | − | |
| 490 | −// _self.postMessage(_.highlight(code, _.languages[lang], lang)); | |
| 491 | −// if (immediateClose) { | |
| 492 | −// _self.close(); | |
| 493 | −// } | |
| 494 | −// }, false); | |
| 509 | + | |
| 510 | +// if (!_.disableWorkerMessageHandler) { | |
| 511 | +// // In worker | |
| 512 | +// _self.addEventListener('message', function (evt) { | |
| 513 | +// var message = JSON.parse(evt.data), | |
| 514 | +// lang = message.language, | |
| 515 | +// code = message.code, | |
| 516 | +// immediateClose = message.immediateClose; | |
| 517 | + | |
| 518 | +// _self.postMessage(_.highlight(code, _.languages[lang], lang)); | |
| 519 | +// if (immediateClose) { | |
| 520 | +// _self.close(); | |
| 521 | +// } | |
| 522 | +// }, false); | |
| 523 | +// } | |
| 495 | 524 | |
| 496 | 525 | // return _self.Prism; |
| 497 | 526 | // } |
| @@ -535,7 +564,8 @@ Prism.languages.markup = { · 37 unmodified lines | ||
| 535 | 564 | 'doctype': /<!DOCTYPE[\s\S]+?>/i, |
| 536 | 565 | 'cdata': /<!\[CDATA\[[\s\S]*?]]>/i, |
| 537 | 566 | 'tag': { |
| 538 | − pattern: /<\/?(?!\d)[^\s>\/=$<]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i, | |
| 567 | + pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s+[^\s>\/=]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+))?)*\s*\/?>/i, | |
| 568 | + greedy: true, | |
| 539 | 569 | inside: { |
| 540 | 570 | 'tag': { |
| 541 | 571 | pattern: /^<\/?[^\s>\/]+/i, |
| @@ -600,13 +630,13 @@ Prism.languages.css = { · 58 unmodified lines | ||
| 600 | 630 | pattern: /("|')(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/, |
| 601 | 631 | greedy: true |
| 602 | 632 | }, |
| 603 | − 'property': /[\w-]+(?=\s*:)/i, | |
| 633 | + 'property': /[-_a-z\xA0-\uFFFF][-\w\xA0-\uFFFF]*(?=\s*:)/i, | |
| 604 | 634 | 'important': /\B!important\b/i, |
| 605 | 635 | 'function': /[-a-z0-9]+(?=\()/i, |
| 606 | 636 | 'punctuation': /[(){};:]/ |
| 607 | 637 | }; |
| 608 | 638 | |
| 609 | −Prism.languages.css['atrule'].inside.rest = Prism.util.clone(Prism.languages.css); | |
| 639 | +Prism.languages.css['atrule'].inside.rest = Prism.languages.css; | |
| 610 | 640 | |
| 611 | 641 | if (Prism.languages.markup) { |
| 612 | 642 | Prism.languages.insertBefore('markup', 'tag', { |
| @@ -614,10 +644,11 @@ if (Prism.languages.markup) { · 1 unmodified line | ||
| 614 | 644 | pattern: /(<style[\s\S]*?>)[\s\S]*?(?=<\/style>)/i, |
| 615 | 645 | lookbehind: true, |
| 616 | 646 | inside: Prism.languages.css, |
| 617 | − alias: 'language-css' | |
| 647 | + alias: 'language-css', | |
| 648 | + greedy: true | |
| 618 | 649 | } |
| 619 | 650 | }); |
| 620 | − | |
| 651 | + | |
| 621 | 652 | Prism.languages.insertBefore('inside', 'attr-value', { |
| 622 | 653 | 'style-attr': { |
| 623 | 654 | pattern: /\s*style=("|')(?:\\[\s\S]|(?!\1)[^\\])*\1/i, |
| @@ -644,7 +675,8 @@ Prism.languages.clike = { · 20 unmodified lines | ||
| 644 | 675 | }, |
| 645 | 676 | { |
| 646 | 677 | pattern: /(^|[^\\:])\/\/.*/, |
| 647 | − lookbehind: true | |
| 678 | + lookbehind: true, | |
| 679 | + greedy: true | |
| 648 | 680 | } |
| 649 | 681 | ], |
| 650 | 682 | 'string': { |
| @@ -661,51 +693,53 @@ Prism.languages.clike = { · 10 unmodified lines | ||
| 661 | 693 | 'keyword': /\b(?:if|else|while|do|for|return|in|instanceof|function|new|try|throw|catch|finally|null|break|continue)\b/, |
| 662 | 694 | 'boolean': /\b(?:true|false)\b/, |
| 663 | 695 | 'function': /[a-z0-9_]+(?=\()/i, |
| 664 | − 'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)\b/i, | |
| 696 | + 'number': /\b0x[\da-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i, | |
| 665 | 697 | 'operator': /--?|\+\+?|!=?=?|<=?|>=?|==?=?|&&?|\|\|?|\?|\*|\/|~|\^|%/, |
| 666 | 698 | 'punctuation': /[{}[\];(),.:]/ |
| 667 | 699 | }; |
| 668 | 700 | |
| 669 | 701 | Prism.languages.javascript = Prism.languages.extend('clike', { |
| 670 | 702 | 'keyword': /\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield)\b/, |
| 671 | − 'number': /\b-?(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|\d*\.?\d+(?:[Ee][+-]?\d+)?|NaN|Infinity)\b/, | |
| 703 | + 'number': /\b(?:0[xX][\dA-Fa-f]+|0[bB][01]+|0[oO][0-7]+|NaN|Infinity)\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee][+-]?\d+)?/, | |
| 672 | 704 | // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444) |
| 673 | − 'function': /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\s*\()/i, | |
| 705 | + 'function': /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*\()/i, | |
| 674 | 706 | 'operator': /-[-=]?|\+[+=]?|!=?=?|<<?=?|>>?>?=?|=(?:==?|>)?|&[&=]?|\|[|=]?|\*\*?=?|\/=?|~|\^=?|%=?|\?|\.{3}/ |
| 675 | 707 | }); |
| 676 | 708 | |
| 677 | 709 | Prism.languages.insertBefore('javascript', 'keyword', { |
| 678 | 710 | 'regex': { |
| 679 | − pattern: /(^|[^/])\/(?!\/)(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})]))/, | |
| 711 | + pattern: /((?:^|[^$\w\xA0-\uFFFF."'\])\s])\s*)\/(\[[^\]\r\n]+]|\\.|[^/\\\[\r\n])+\/[gimyu]{0,5}(?=\s*($|[\r\n,.;})\]]))/, | |
| 680 | 712 | lookbehind: true, |
| 681 | 713 | greedy: true |
| 682 | 714 | }, |
| 683 | 715 | // This must be declared before keyword because we use "function" inside the look-forward |
| 684 | 716 | 'function-variable': { |
| 685 | − pattern: /[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)\s*=>))/i, | |
| 717 | + pattern: /[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*(?=\s*=\s*(?:function\b|(?:\([^()]*\)|[_$a-z\xA0-\uFFFF][$\w\xA0-\uFFFF]*)\s*=>))/i, | |
| 686 | 718 | alias: 'function' |
| 687 | − } | |
| 719 | + }, | |
| 720 | + 'constant': /\b[A-Z][A-Z\d_]*\b/ | |
| 688 | 721 | }); |
| 689 | 722 | |
| 690 | 723 | Prism.languages.insertBefore('javascript', 'string', { |
| 691 | 724 | 'template-string': { |
| 692 | − pattern: /`(?:\\[\s\S]|[^\\`])*`/, | |
| 725 | + pattern: /`(?:\\[\s\S]|\${[^}]+}|[^\\`])*`/, | |
| 693 | 726 | greedy: true, |
| 694 | 727 | inside: { |
| 695 | 728 | 'interpolation': { |
| 696 | − pattern: /\$\{[^}]+\}/, | |
| 729 | + pattern: /\${[^}]+}/, | |
| 697 | 730 | inside: { |
| 698 | 731 | 'interpolation-punctuation': { |
| 699 | − pattern: /^\$\{|\}$/, | |
| 732 | + pattern: /^\${|}$/, | |
| 700 | 733 | alias: 'punctuation' |
| 701 | 734 | }, |
| 702 | − rest: Prism.languages.javascript | |
| 735 | + rest: null // See below | |
| 703 | 736 | } |
| 704 | 737 | }, |
| 705 | 738 | 'string': /[\s\S]+/ |
| 706 | 739 | } |
| 707 | 740 | } |
| 708 | 741 | }); |
| 742 | +Prism.languages.javascript['template-string'].inside['interpolation'].inside.rest = Prism.languages.javascript; | |
| 709 | 743 | |
| 710 | 744 | if (Prism.languages.markup) { |
| 711 | 745 | Prism.languages.insertBefore('markup', 'tag', { |
| @@ -713,7 +747,8 @@ if (Prism.languages.markup) { · 1 unmodified line | ||
| 713 | 747 | pattern: /(<script[\s\S]*?>)[\s\S]*?(?=<\/script>)/i, |
| 714 | 748 | lookbehind: true, |
| 715 | 749 | inside: Prism.languages.javascript, |
| 716 | − alias: 'language-javascript' | |
| 750 | + alias: 'language-javascript', | |
| 751 | + greedy: true | |
| 717 | 752 | } |
| 718 | 753 | }); |
| 719 | 754 | } |
| @@ -723,7 +758,7 @@ Prism.languages.js = Prism.languages.javascript; · 3 unmodified lines | ||
| 723 | 758 | Prism.languages.c = Prism.languages.extend('clike', { |
| 724 | 759 | 'keyword': /\b(?:_Alignas|_Alignof|_Atomic|_Bool|_Complex|_Generic|_Imaginary|_Noreturn|_Static_assert|_Thread_local|asm|typeof|inline|auto|break|case|char|const|continue|default|do|double|else|enum|extern|float|for|goto|if|int|long|register|return|short|signed|sizeof|static|struct|switch|typedef|union|unsigned|void|volatile|while)\b/, |
| 725 | 760 | 'operator': /-[>-]?|\+\+?|!=?|<<?=?|>>?=?|==?|&&?|\|\|?|[~^%?*\/]/, |
| 726 | − 'number': /\b-?(?:0x[\da-f]+|\d*\.?\d+(?:e[+-]?\d+)?)[ful]*\b/i | |
| 761 | + 'number': /(?:\b0x[\da-f]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?)[ful]*/i | |
| 727 | 762 | }); |
| 728 | 763 | |
| 729 | 764 | Prism.languages.insertBefore('c', 'string', { |
| @@ -768,7 +803,7 @@ delete Prism.languages.c['boolean']; · 38 unmodified lines | ||
| 768 | 803 | }, |
| 769 | 804 | /^\$\(\(/ |
| 770 | 805 | ], |
| 771 | − number: /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee]-?\d+)?)\b/, | |
| 806 | + number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:[Ee]-?\d+)?/, | |
| 772 | 807 | // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic |
| 773 | 808 | operator: /--?|-=|\+\+?|\+=|!=?|~|\*\*?|\*=|\/=?|%=?|<<=?|>>=?|<=?|>=?|==?|&&?|&=|\^=?|\|\|?|\|=|\?|:/, |
| 774 | 809 | // If there is no $ sign at the beginning highlight (( and )) as punctuation |
| @@ -778,6 +813,7 @@ delete Prism.languages.c['boolean']; · 3 unmodified lines | ||
| 778 | 813 | // Command Substitution |
| 779 | 814 | { |
| 780 | 815 | pattern: /\$\([^)]+\)|`[^`]+`/, |
| 816 | + greedy: true, | |
| 781 | 817 | inside: { |
| 782 | 818 | variable: /^\$\(|^`|\)$|`$/ |
| 783 | 819 | } |
| @@ -804,7 +840,7 @@ delete Prism.languages.c['boolean']; · 20 unmodified lines | ||
| 804 | 840 | inside: insideString |
| 805 | 841 | }, |
| 806 | 842 | { |
| 807 | − pattern: /(["'])(?:\\[\s\S]|(?!\1)[^\\])*\1/, | |
| 843 | + pattern: /(["'])(?:\\[\s\S]|\$\([^)]+\)|`[^`]+`|(?!\1)[^\\])*\1/, | |
| 808 | 844 | greedy: true, |
| 809 | 845 | inside: insideString |
| 810 | 846 | } |
| @@ -812,7 +848,7 @@ delete Prism.languages.c['boolean']; · 1 unmodified line | ||
| 812 | 848 | 'variable': insideString.variable, |
| 813 | 849 | // Originally based on http://ss64.com/bash/ |
| 814 | 850 | 'function': { |
| 815 | − pattern: /(^|[\s;|&])(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|npm|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|[\s;|&])/, | |
| 851 | + pattern: /(^|[\s;|&])(?:alias|apropos|apt-get|aptitude|aspell|awk|basename|bash|bc|bg|builtin|bzip2|cal|cat|cd|cfdisk|chgrp|chmod|chown|chroot|chkconfig|cksum|clear|cmp|comm|command|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|du|egrep|eject|enable|env|ethtool|eval|exec|expand|expect|export|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|getopts|git|grep|groupadd|groupdel|groupmod|groups|gzip|hash|head|help|hg|history|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|jobs|join|kill|killall|less|link|ln|locate|logname|logout|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|make|man|mkdir|mkfifo|mkisofs|mknod|more|most|mount|mtools|mtr|mv|mmv|nano|netstat|nice|nl|nohup|notify-send|npm|nslookup|open|op|passwd|paste|pathchk|ping|pkill|popd|pr|printcap|printenv|printf|ps|pushd|pv|pwd|quota|quotacheck|quotactl|ram|rar|rcp|read|readarray|readonly|reboot|rename|renice|remsync|rev|rm|rmdir|rsync|screen|scp|sdiff|sed|seq|service|sftp|shift|shopt|shutdown|sleep|slocate|sort|source|split|ssh|stat|strace|su|sudo|sum|suspend|sync|tail|tar|tee|test|time|timeout|times|touch|top|traceroute|trap|tr|tsort|tty|type|ulimit|umask|umount|unalias|uname|unexpand|uniq|units|unrar|unshar|uptime|useradd|userdel|usermod|users|uuencode|uudecode|v|vdir|vi|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yes|zip)(?=$|[\s;|&])/, | |
| 816 | 852 | lookbehind: true |
| 817 | 853 | }, |
| 818 | 854 | 'keyword': { |
| @@ -828,15 +864,18 @@ delete Prism.languages.c['boolean']; · 9 unmodified lines | ||
| 828 | 864 | }; |
| 829 | 865 | |
| 830 | 866 | var inside = insideString.variable[1].inside; |
| 867 | + inside.string = Prism.languages.bash.string; | |
| 831 | 868 | inside['function'] = Prism.languages.bash['function']; |
| 832 | 869 | inside.keyword = Prism.languages.bash.keyword; |
| 833 | − inside.boolean = Prism.languages.bash.boolean; | |
| 870 | + inside['boolean'] = Prism.languages.bash['boolean']; | |
| 834 | 871 | inside.operator = Prism.languages.bash.operator; |
| 835 | 872 | inside.punctuation = Prism.languages.bash.punctuation; |
| 873 | + | |
| 874 | + Prism.languages.shell = Prism.languages.bash; | |
| 836 | 875 | })(Prism); |
| 837 | 876 | |
| 838 | 877 | Prism.languages.cpp = Prism.languages.extend('c', { |
| 839 | − 'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, | |
| 878 | + 'keyword': /\b(?:alignas|alignof|asm|auto|bool|break|case|catch|char|char16_t|char32_t|class|compl|const|constexpr|const_cast|continue|decltype|default|delete|do|double|dynamic_cast|else|enum|explicit|export|extern|float|for|friend|goto|if|inline|int|int8_t|int16_t|int32_t|int64_t|uint8_t|uint16_t|uint32_t|uint64_t|long|mutable|namespace|new|noexcept|nullptr|operator|private|protected|public|register|reinterpret_cast|return|short|signed|sizeof|static|static_assert|static_cast|struct|switch|template|this|thread_local|throw|try|typedef|typeid|typename|union|unsigned|using|virtual|void|volatile|wchar_t|while)\b/, | |
| 840 | 879 | 'boolean': /\b(?:true|false)\b/, |
| 841 | 880 | 'operator': /--?|\+\+?|!=?|<{1,2}=?|>{1,2}=?|->|:{1,2}|={1,2}|\^|~|%|&{1,2}|\|\|?|\?|\*|\/|\b(?:and|and_eq|bitand|bitor|not|not_eq|or|or_eq|xor|xor_eq)\b/ |
| 842 | 881 | }); |
| @@ -847,6 +886,15 @@ Prism.languages.insertBefore('cpp', 'keyword', { · 4 unmodified lines | ||
| 847 | 886 | lookbehind: true |
| 848 | 887 | } |
| 849 | 888 | }); |
| 889 | + | |
| 890 | +Prism.languages.insertBefore('cpp', 'string', { | |
| 891 | + 'raw-string': { | |
| 892 | + pattern: /R"([^()\\ ]{0,16})\([\s\S]*?\)\1"/, | |
| 893 | + alias: 'string', | |
| 894 | + greedy: true | |
| 895 | + } | |
| 896 | +}); | |
| 897 | + | |
| 850 | 898 | (function(Prism) { |
| 851 | 899 | |
| 852 | 900 | // Ignore comments starting with { to privilege string interpolation highlighting |
| @@ -947,10 +995,13 @@ delete Prism.languages.coffeescript['template-string']; · 94 unmodified lines | ||
| 947 | 995 | (function(Prism) { |
| 948 | 996 | Prism.languages.ruby = Prism.languages.extend('clike', { |
| 949 | 997 | 'comment': [ |
| 950 | − /#(?!\{[^\r\n]*?\}).*/, | |
| 951 | − /^=begin(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?=end/m | |
| 998 | + /#.*/, | |
| 999 | + { | |
| 1000 | + pattern: /^=begin(?:\r?\n|\r)(?:.*(?:\r?\n|\r))*?=end/m, | |
| 1001 | + greedy: true | |
| 1002 | + } | |
| 952 | 1003 | ], |
| 953 | − 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/ | |
| 1004 | + 'keyword': /\b(?:alias|and|BEGIN|begin|break|case|class|def|define_method|defined|do|each|else|elsif|END|end|ensure|false|for|if|in|module|new|next|nil|not|or|protected|private|public|raise|redo|require|rescue|retry|return|self|super|then|throw|true|undef|unless|until|when|while|yield)\b/ | |
| 954 | 1005 | }); |
| 955 | 1006 | |
| 956 | 1007 | var interpolation = { |
| @@ -960,7 +1011,7 @@ delete Prism.languages.coffeescript['template-string']; · 3 unmodified lines | ||
| 960 | 1011 | pattern: /^#\{|\}$/, |
| 961 | 1012 | alias: 'tag' |
| 962 | 1013 | }, |
| 963 | − rest: Prism.util.clone(Prism.languages.ruby) | |
| 1014 | + rest: Prism.languages.ruby | |
| 964 | 1015 | } |
| 965 | 1016 | }; |
| 966 | 1017 | |
| @@ -1009,7 +1060,10 @@ delete Prism.languages.coffeescript['template-string']; · 42 unmodified lines | ||
| 1009 | 1060 | } |
| 1010 | 1061 | ], |
| 1011 | 1062 | 'variable': /[@$]+[a-zA-Z_]\w*(?:[?!]|\b)/, |
| 1012 | − 'symbol': /:[a-zA-Z_]\w*(?:[?!]|\b)/ | |
| 1063 | + 'symbol': { | |
| 1064 | + pattern: /(^|[^:]):[a-zA-Z_]\w*(?:[?!]|\b)/, | |
| 1065 | + lookbehind: true | |
| 1066 | + } | |
| 1013 | 1067 | }); |
| 1014 | 1068 | |
| 1015 | 1069 | Prism.languages.insertBefore('ruby', 'number', { |
| @@ -1127,6 +1181,30 @@ Prism.languages.insertBefore('d', 'function', { · 111 unmodified lines | ||
| 1127 | 1181 | alias: 'variable' |
| 1128 | 1182 | } |
| 1129 | 1183 | }); |
| 1184 | +Prism.languages.dart = Prism.languages.extend('clike', { | |
| 1185 | + 'string': [ | |
| 1186 | + { | |
| 1187 | + pattern: /r?("""|''')[\s\S]*?\1/, | |
| 1188 | + greedy: true | |
| 1189 | + }, | |
| 1190 | + { | |
| 1191 | + pattern: /r?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, | |
| 1192 | + greedy: true | |
| 1193 | + } | |
| 1194 | + ], | |
| 1195 | + 'keyword': [ | |
| 1196 | + /\b(?:async|sync|yield)\*/, | |
| 1197 | + /\b(?:abstract|assert|async|await|break|case|catch|class|const|continue|default|deferred|do|dynamic|else|enum|export|external|extends|factory|final|finally|for|get|if|implements|import|in|library|new|null|operator|part|rethrow|return|set|static|super|switch|this|throw|try|typedef|var|void|while|with|yield)\b/ | |
| 1198 | + ], | |
| 1199 | + 'operator': /\bis!|\b(?:as|is)\b|\+\+|--|&&|\|\||<<=?|>>=?|~(?:\/=?)?|[+\-*\/%&^|=!<>]=?|\?/ | |
| 1200 | +}); | |
| 1201 | + | |
| 1202 | +Prism.languages.insertBefore('dart','function',{ | |
| 1203 | + 'metadata': { | |
| 1204 | + pattern: /@\w+/, | |
| 1205 | + alias: 'symbol' | |
| 1206 | + } | |
| 1207 | +}); | |
| 1130 | 1208 | // Django/Jinja2 syntax definition for Prism.js <http://prismjs.com> syntax highlighter. |
| 1131 | 1209 | // Mostly it works OK but can paint code incorrectly on complex html/template tag combinations. |
| 1132 | 1210 | |
| @@ -1170,15 +1248,15 @@ if (Prism.languages.css) { · 37 unmodified lines | ||
| 1170 | 1248 | Prism.languages.jinja2 = Prism.languages.django; |
| 1171 | 1249 | |
| 1172 | 1250 | Prism.languages.elixir = { |
| 1173 | − // Negative look-ahead is needed for string interpolation | |
| 1174 | − // Negative look-behind is needed to avoid highlighting markdown headers in | |
| 1175 | − // multi-line doc strings | |
| 1176 | 1251 | 'comment': { |
| 1177 | − pattern: /(^|[^#])#(?![{#]).*/m, | |
| 1252 | + pattern: /#.*/m, | |
| 1178 | 1253 | lookbehind: true |
| 1179 | 1254 | }, |
| 1180 | 1255 | // ~r"""foo""" (multi-line), ~r'''foo''' (multi-line), ~r/foo/, ~r|foo|, ~r"foo", ~r'foo', ~r(foo), ~r[foo], ~r{foo}, ~r<foo> |
| 1181 | − 'regex': /~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/, | |
| 1256 | + 'regex': { | |
| 1257 | + pattern: /~[rR](?:("""|''')(?:\\[\s\S]|(?!\1)[^\\])+\1|([\/|"'])(?:\\.|(?!\2)[^\\\r\n])+\2|\((?:\\.|[^\\)\r\n])+\)|\[(?:\\.|[^\\\]\r\n])+\]|\{(?:\\.|[^\\}\r\n])+\}|<(?:\\.|[^\\>\r\n])+>)[uismxfr]*/, | |
| 1258 | + greedy: true | |
| 1259 | + }, | |
| 1182 | 1260 | 'string': [ |
| 1183 | 1261 | { |
| 1184 | 1262 | // ~s"""foo""" (multi-line), ~s'''foo''' (multi-line), ~s/foo/, ~s|foo|, ~s"foo", ~s'foo', ~s(foo), ~s[foo], ~s{foo} (with interpolation care), ~s<foo> |
| @@ -1225,7 +1303,7 @@ Prism.languages.elixir = { · 40 unmodified lines | ||
| 1225 | 1303 | alias: 'variable' |
| 1226 | 1304 | }, |
| 1227 | 1305 | 'attribute': { |
| 1228 | − pattern: /@[\S]+/, | |
| 1306 | + pattern: /@\w+/, | |
| 1229 | 1307 | alias: 'variable' |
| 1230 | 1308 | }, |
| 1231 | 1309 | 'number': /\b(?:0[box][a-f\d_]+|\d[\d_]*)(?:\.[\d_]+)?(?:e[+-]?[\d_]+)?\b/i, |
| @@ -1256,13 +1334,102 @@ Prism.languages.elixir.string.forEach(function(o) { · 24 unmodified lines | ||
| 1256 | 1334 | pattern: /^#\{|\}$/, |
| 1257 | 1335 | alias: 'punctuation' |
| 1258 | 1336 | }, |
| 1259 | − rest: Prism.util.clone(Prism.languages.elixir) | |
| 1337 | + rest: Prism.languages.elixir | |
| 1260 | 1338 | } |
| 1261 | 1339 | } |
| 1262 | 1340 | }; |
| 1263 | 1341 | }); |
| 1264 | 1342 | |
| 1265 | 1343 | |
| 1344 | +Prism.languages['markup-templating'] = {}; | |
| 1345 | + | |
| 1346 | +Object.defineProperties(Prism.languages['markup-templating'], { | |
| 1347 | + buildPlaceholders: { | |
| 1348 | + // Tokenize all inline templating expressions matching placeholderPattern | |
| 1349 | + // If the replaceFilter function is provided, it will be called with every match. | |
| 1350 | + // If it returns false, the match will not be replaced. | |
| 1351 | + value: function (env, language, placeholderPattern, replaceFilter) { | |
| 1352 | + if (env.language !== language) { | |
| 1353 | + return; | |
| 1354 | + } | |
| 1355 | + | |
| 1356 | + env.tokenStack = []; | |
| 1357 | + | |
| 1358 | + env.code = env.code.replace(placeholderPattern, function(match) { | |
| 1359 | + if (typeof replaceFilter === 'function' && !replaceFilter(match)) { | |
| 1360 | + return match; | |
| 1361 | + } | |
| 1362 | + var i = env.tokenStack.length; | |
| 1363 | + // Check for existing strings | |
| 1364 | + while (env.code.indexOf('___' + language.toUpperCase() + i + '___') !== -1) | |
| 1365 | + ++i; | |
| 1366 | + | |
| 1367 | + // Create a sparse array | |
| 1368 | + env.tokenStack[i] = match; | |
| 1369 | + | |
| 1370 | + return '___' + language.toUpperCase() + i + '___'; | |
| 1371 | + }); | |
| 1372 | + | |
| 1373 | + // Switch the grammar to markup | |
| 1374 | + env.grammar = Prism.languages.markup; | |
| 1375 | + } | |
| 1376 | + }, | |
| 1377 | + tokenizePlaceholders: { | |
| 1378 | + // Replace placeholders with proper tokens after tokenizing | |
| 1379 | + value: function (env, language) { | |
| 1380 | + if (env.language !== language || !env.tokenStack) { | |
| 1381 | + return; | |
| 1382 | + } | |
| 1383 | + | |
| 1384 | + // Switch the grammar back | |
| 1385 | + env.grammar = Prism.languages[language]; | |
| 1386 | + | |
| 1387 | + var j = 0; | |
| 1388 | + var keys = Object.keys(env.tokenStack); | |
| 1389 | + var walkTokens = function (tokens) { | |
| 1390 | + if (j >= keys.length) { | |
| 1391 | + return; | |
| 1392 | + } | |
| 1393 | + for (var i = 0; i < tokens.length; i++) { | |
| 1394 | + var token = tokens[i]; | |
| 1395 | + if (typeof token === 'string' || (token.content && typeof token.content === 'string')) { | |
| 1396 | + var k = keys[j]; | |
| 1397 | + var t = env.tokenStack[k]; | |
| 1398 | + var s = typeof token === 'string' ? token : token.content; | |
| 1399 | + | |
| 1400 | + var index = s.indexOf('___' + language.toUpperCase() + k + '___'); | |
| 1401 | + if (index > -1) { | |
| 1402 | + ++j; | |
| 1403 | + var before = s.substring(0, index); | |
| 1404 | + var middle = new Prism.Token(language, Prism.tokenize(t, env.grammar, language), 'language-' + language, t); | |
| 1405 | + var after = s.substring(index + ('___' + language.toUpperCase() + k + '___').length); | |
| 1406 | + var replacement; | |
| 1407 | + if (before || after) { | |
| 1408 | + replacement = [before, middle, after].filter(function (v) { return !!v; }); | |
| 1409 | + walkTokens(replacement); | |
| 1410 | + } else { | |
| 1411 | + replacement = middle; | |
| 1412 | + } | |
| 1413 | + if (typeof token === 'string') { | |
| 1414 | + Array.prototype.splice.apply(tokens, [i, 1].concat(replacement)); | |
| 1415 | + } else { | |
| 1416 | + token.content = replacement; | |
| 1417 | + } | |
| 1418 | + | |
| 1419 | + if (j >= keys.length) { | |
| 1420 | + break; | |
| 1421 | + } | |
| 1422 | + } | |
| 1423 | + } else if (token.content && typeof token.content !== 'string') { | |
| 1424 | + walkTokens(token.content); | |
| 1425 | + } | |
| 1426 | + } | |
| 1427 | + }; | |
| 1428 | + | |
| 1429 | + walkTokens(env.tokens); | |
| 1430 | + } | |
| 1431 | + } | |
| 1432 | +}); | |
| 1266 | 1433 | Prism.languages.erlang = { |
| 1267 | 1434 | 'comment': /%.+/, |
| 1268 | 1435 | 'string': { |
| @@ -1282,7 +1449,7 @@ Prism.languages.erlang = { · 13 unmodified lines | ||
| 1282 | 1449 | 'number': [ |
| 1283 | 1450 | /\$\\?./, |
| 1284 | 1451 | /\d+#[a-z0-9]+/i, |
| 1285 | − /(?:\b|-)\d*\.?\d+([Ee][+-]?\d+)?\b/ | |
| 1452 | + /(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?/i | |
| 1286 | 1453 | ], |
| 1287 | 1454 | 'function': /\b[a-z][\w@]*(?=\()/, |
| 1288 | 1455 | 'variable': { |
| @@ -1312,7 +1479,7 @@ Prism.languages.go = Prism.languages.extend('clike', { · 23 unmodified lines | ||
| 1312 | 1479 | 'builtin': /\b(?:bool|byte|complex(?:64|128)|error|float(?:32|64)|rune|string|u?int(?:8|16|32|64)?|uintptr|append|cap|close|complex|copy|delete|imag|len|make|new|panic|print(?:ln)?|real|recover)\b/, |
| 1313 | 1480 | 'boolean': /\b(?:_|iota|nil|true|false)\b/, |
| 1314 | 1481 | 'operator': /[*\/%^!=]=?|\+[=+]?|-[=-]?|\|[=|]?|&(?:=|&|\^=?)?|>(?:>=?|=)?|<(?:<=?|=|-)?|:=|\.\.\./, |
| 1315 | − 'number': /\b(-?(0x[a-f\d]+|(\d+\.?\d*|\.\d+)(e[-+]?\d+)?)i?)\b/i, | |
| 1482 | + 'number': /(?:\b0x[a-f\d]+|(?:\b\d+\.?\d*|\B\.\d+)(?:e[-+]?\d+)?)i?/i, | |
| 1316 | 1483 | 'string': { |
| 1317 | 1484 | pattern: /(["'`])(\\[\s\S]|(?!\1)[^\\])*\1/, |
| 1318 | 1485 | greedy: true |
| @@ -1322,7 +1489,7 @@ delete Prism.languages.go['class-name']; · 3 unmodified lines | ||
| 1322 | 1489 | |
| 1323 | 1490 | Prism.languages.java = Prism.languages.extend('clike', { |
| 1324 | 1491 | 'keyword': /\b(?:abstract|continue|for|new|switch|assert|default|goto|package|synchronized|boolean|do|if|private|this|break|double|implements|protected|throw|byte|else|import|public|throws|case|enum|instanceof|return|transient|catch|extends|int|short|try|char|final|interface|static|void|class|finally|long|strictfp|volatile|const|float|native|super|while)\b/, |
| 1325 | − 'number': /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp\-]+\b|\b\d*\.?\d+(?:e[+-]?\d+)?[df]?\b/i, | |
| 1492 | + 'number': /\b0b[01]+\b|\b0x[\da-f]*\.?[\da-fp-]+\b|(?:\b\d+\.?\d*|\B\.\d+)(?:e[+-]?\d+)?[df]?/i, | |
| 1326 | 1493 | 'operator': { |
| 1327 | 1494 | pattern: /(^|[^.])(?:\+[+=]?|-[-=]?|!=?|<<?=?|>>?>?=?|==?|&[&=]?|\|[|=]?|\*=?|\/=?|%=?|\^=?|[?:~])/m, |
| 1328 | 1495 | lookbehind: true |
| @@ -1337,14 +1504,25 @@ Prism.languages.insertBefore('java','function', { · 8 unmodified lines | ||
| 1337 | 1504 | } |
| 1338 | 1505 | }); |
| 1339 | 1506 | |
| 1507 | +Prism.languages.insertBefore('java', 'class-name', { | |
| 1508 | + 'generics': { | |
| 1509 | + pattern: /<\s*\w+(?:\.\w+)?(?:\s*,\s*\w+(?:\.\w+)?)*>/i, | |
| 1510 | + alias: 'function', | |
| 1511 | + inside: { | |
| 1512 | + keyword: Prism.languages.java.keyword, | |
| 1513 | + punctuation: /[<>(),.:]/ | |
| 1514 | + } | |
| 1515 | + } | |
| 1516 | +}); | |
| 1517 | + | |
| 1340 | 1518 | Prism.languages.json = { |
| 1341 | 1519 | 'property': /"(?:\\.|[^\\"\r\n])*"(?=\s*:)/i, |
| 1342 | 1520 | 'string': { |
| 1343 | 1521 | pattern: /"(?:\\.|[^\\"\r\n])*"(?!\s*:)/, |
| 1344 | 1522 | greedy: true |
| 1345 | 1523 | }, |
| 1346 | − 'number': /\b-?(?:0x[\dA-Fa-f]+|\d*\.?\d+(?:[Ee][+-]?\d+)?)\b/, | |
| 1347 | − 'punctuation': /[{}[\]);,]/, | |
| 1524 | + 'number': /-?\d+\.?\d*([Ee][+-]?\d+)?/, | |
| 1525 | + 'punctuation': /[{}[\],]/, | |
| 1348 | 1526 | 'operator': /:/g, |
| 1349 | 1527 | 'boolean': /\b(?:true|false)\b/i, |
| 1350 | 1528 | 'null': /\bnull\b/i |
| @@ -1356,7 +1534,7 @@ Prism.languages.jsonp = Prism.languages.json; · 5 unmodified lines | ||
| 1356 | 1534 | Prism.languages.kotlin = Prism.languages.extend('clike', { |
| 1357 | 1535 | 'keyword': { |
| 1358 | 1536 | // The lookbehind prevents wrong highlighting of e.g. kotlin.properties.get |
| 1359 | − pattern: /(^|[^.])\b(?:abstract|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|else|enum|final|finally|for|fun|get|if|import|in|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|out|override|package|private|protected|public|reified|return|sealed|set|super|tailrec|this|throw|to|try|val|var|when|where|while)\b/, | |
| 1537 | + pattern: /(^|[^.])\b(?:abstract|actual|annotation|as|break|by|catch|class|companion|const|constructor|continue|crossinline|data|do|dynamic|else|enum|expect|external|final|finally|for|fun|get|if|import|in|infix|init|inline|inner|interface|internal|is|lateinit|noinline|null|object|open|operator|out|override|package|private|protected|public|reified|return|sealed|set|super|suspend|tailrec|this|throw|to|try|typealias|val|var|vararg|when|where|while)\b/, | |
| 1360 | 1538 | lookbehind: true |
| 1361 | 1539 | }, |
| 1362 | 1540 | 'function': [ |
| @@ -1366,7 +1544,7 @@ Prism.languages.jsonp = Prism.languages.json; · 3 unmodified lines | ||
| 1366 | 1544 | lookbehind: true |
| 1367 | 1545 | } |
| 1368 | 1546 | ], |
| 1369 | − 'number': /\b(?:0[bx][\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?[fFL]?)\b/, | |
| 1547 | + 'number': /\b(?:0[xX][\da-fA-F]+(?:_[\da-fA-F]+)*|0[bB][01]+(?:_[01]+)*|\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?[fFL]?)\b/, | |
| 1370 | 1548 | 'operator': /\+[+=]?|-[-=>]?|==?=?|!(?:!|==?)?|[\/*%<>]=?|[?:]:?|\.\.|&&|\|\||\b(?:and|inv|or|shl|shr|ushr|xor)\b/ |
| 1371 | 1549 | }); |
| 1372 | 1550 | |
| @@ -1400,7 +1578,7 @@ Prism.languages.jsonp = Prism.languages.json; · 27 unmodified lines | ||
| 1400 | 1578 | pattern: /^\$\{|\}$/, |
| 1401 | 1579 | alias: 'variable' |
| 1402 | 1580 | }, |
| 1403 | − rest: Prism.util.clone(Prism.languages.kotlin) | |
| 1581 | + rest: Prism.languages.kotlin | |
| 1404 | 1582 | } |
| 1405 | 1583 | }, |
| 1406 | 1584 | { |
| @@ -1414,6 +1592,7 @@ Prism.languages.jsonp = Prism.languages.json; · 7 unmodified lines | ||
| 1414 | 1592 | }; |
| 1415 | 1593 | |
| 1416 | 1594 | }(Prism)); |
| 1595 | + | |
| 1417 | 1596 | Prism.languages.lua = { |
| 1418 | 1597 | 'comment': /^#!.+|--(?:\[(=*)\[[\s\S]*?\]\1\]|.*)/m, |
| 1419 | 1598 | // \z may be used to skip the following space |
| @@ -1434,16 +1613,68 @@ Prism.languages.lua = { · 14 unmodified lines | ||
| 1434 | 1613 | ], |
| 1435 | 1614 | 'punctuation': /[\[\](){},;]|\.+|:+/ |
| 1436 | 1615 | }; |
| 1616 | +(function(Prism) { | |
| 1617 | + Prism.languages.crystal = Prism.languages.extend('ruby', { | |
| 1618 | + keyword: [ | |
| 1619 | + /\b(?:abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|select|self|sizeof|struct|super|then|type|typeof|uninitialized|union|unless|until|when|while|with|yield|__DIR__|__END_LINE__|__FILE__|__LINE__)\b/, | |
| 1620 | + { | |
| 1621 | + pattern: /(\.\s*)(?:is_a|responds_to)\?/, | |
| 1622 | + lookbehind: true | |
| 1623 | + } | |
| 1624 | + ], | |
| 1625 | + | |
| 1626 | + number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[\da-fA-F_]*[\da-fA-F]|(?:\d(?:[\d_]*\d)?)(?:\.[\d_]*\d)?(?:[eE][+-]?[\d_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/ | |
| 1627 | + }); | |
| 1628 | + | |
| 1629 | + Prism.languages.insertBefore('crystal', 'string', { | |
| 1630 | + attribute: { | |
| 1631 | + pattern: /@\[.+?\]/, | |
| 1632 | + alias: 'attr-name', | |
| 1633 | + inside: { | |
| 1634 | + delimiter: { | |
| 1635 | + pattern: /^@\[|\]$/, | |
| 1636 | + alias: 'tag' | |
| 1637 | + }, | |
| 1638 | + rest: Prism.languages.crystal | |
| 1639 | + } | |
| 1640 | + }, | |
| 1641 | + | |
| 1642 | + expansion: [ | |
| 1643 | + { | |
| 1644 | + pattern: /\{\{.+?\}\}/, | |
| 1645 | + inside: { | |
| 1646 | + delimiter: { | |
| 1647 | + pattern: /^\{\{|\}\}$/, | |
| 1648 | + alias: 'tag' | |
| 1649 | + }, | |
| 1650 | + rest: Prism.languages.crystal | |
| 1651 | + } | |
| 1652 | + }, | |
| 1653 | + { | |
| 1654 | + pattern: /\{%.+?%\}/, | |
| 1655 | + inside: { | |
| 1656 | + delimiter: { | |
| 1657 | + pattern: /^\{%|%\}$/, | |
| 1658 | + alias: 'tag' | |
| 1659 | + }, | |
| 1660 | + rest: Prism.languages.crystal | |
| 1661 | + } | |
| 1662 | + } | |
| 1663 | + ] | |
| 1664 | + }); | |
| 1665 | + | |
| 1666 | +}(Prism)); | |
| 1667 | + | |
| 1437 | 1668 | Prism.languages.nginx = Prism.languages.extend('clike', { |
| 1438 | − 'comment': { | |
| 1439 | − pattern: /(^|[^"{\\])#.*/, | |
| 1440 | − lookbehind: true | |
| 1441 | − }, | |
| 1442 | − 'keyword': /\b(?:CONTENT_|DOCUMENT_|GATEWAY_|HTTP_|HTTPS|if_not_empty|PATH_|QUERY_|REDIRECT_|REMOTE_|REQUEST_|SCGI|SCRIPT_|SERVER_|http|events|accept_mutex|accept_mutex_delay|access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth|auth_basic|auth_basic_user_file|auth_http|auth_http_header|auth_http_timeout|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|debug_connection|debug_points|default_type|deny|devpoll_changes|devpoll_events|directio|directio_alignment|disable_symlinks|empty_gif|env|epoll_events|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_methods|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_purge|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_redirect_errors|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|google_perftools_profiles|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|imap_capabilities|imap_client_buffer|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|kqueue_changes|kqueue_events|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|lock_file|log_format|log_format_combined|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|multi_accept|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|pop3_auth|pop3_capabilities|port_in_redirect|post_action|postpone_output|protocol|proxy|proxy_buffer|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_methods|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_headers_hash_bucket_size|proxy_headers_hash_max_size|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_method|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_error_message|proxy_pass_header|proxy_pass_request_body|proxy_pass_request_headers|proxy_read_timeout|proxy_redirect|proxy_redirect_errors|proxy_send_lowat|proxy_send_timeout|proxy_set_body|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|proxy_timeout|proxy_upstream_fail_timeout|proxy_upstream_max_fails|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|rtsig_overflow_events|rtsig_overflow_test|rtsig_overflow_threshold|rtsig_signo|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|smtp_auth|smtp_capabilities|so_keepalive|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssi_value_length|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|starttls|stub_status|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timeout|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|use|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_connections|worker_cpu_affinity|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|worker_rlimit_sigpending|working_directory|xclient|xml_entities|xslt_entities|xslt_stylesheet|xslt_types)\b/i | |
| 1669 | + 'comment': { | |
| 1670 | + pattern: /(^|[^"{\\])#.*/, | |
| 1671 | + lookbehind: true | |
| 1672 | + }, | |
| 1673 | + 'keyword': /\b(?:CONTENT_|DOCUMENT_|GATEWAY_|HTTP_|HTTPS|if_not_empty|PATH_|QUERY_|REDIRECT_|REMOTE_|REQUEST_|SCGI|SCRIPT_|SERVER_|http|events|accept_mutex|accept_mutex_delay|access_log|add_after_body|add_before_body|add_header|addition_types|aio|alias|allow|ancient_browser|ancient_browser_value|auth|auth_basic|auth_basic_user_file|auth_http|auth_http_header|auth_http_timeout|autoindex|autoindex_exact_size|autoindex_localtime|break|charset|charset_map|charset_types|chunked_transfer_encoding|client_body_buffer_size|client_body_in_file_only|client_body_in_single_buffer|client_body_temp_path|client_body_timeout|client_header_buffer_size|client_header_timeout|client_max_body_size|connection_pool_size|create_full_put_path|daemon|dav_access|dav_methods|debug_connection|debug_points|default_type|deny|devpoll_changes|devpoll_events|directio|directio_alignment|disable_symlinks|empty_gif|env|epoll_events|error_log|error_page|expires|fastcgi_buffer_size|fastcgi_buffers|fastcgi_busy_buffers_size|fastcgi_cache|fastcgi_cache_bypass|fastcgi_cache_key|fastcgi_cache_lock|fastcgi_cache_lock_timeout|fastcgi_cache_methods|fastcgi_cache_min_uses|fastcgi_cache_path|fastcgi_cache_purge|fastcgi_cache_use_stale|fastcgi_cache_valid|fastcgi_connect_timeout|fastcgi_hide_header|fastcgi_ignore_client_abort|fastcgi_ignore_headers|fastcgi_index|fastcgi_intercept_errors|fastcgi_keep_conn|fastcgi_max_temp_file_size|fastcgi_next_upstream|fastcgi_no_cache|fastcgi_param|fastcgi_pass|fastcgi_pass_header|fastcgi_read_timeout|fastcgi_redirect_errors|fastcgi_send_timeout|fastcgi_split_path_info|fastcgi_store|fastcgi_store_access|fastcgi_temp_file_write_size|fastcgi_temp_path|flv|geo|geoip_city|geoip_country|google_perftools_profiles|gzip|gzip_buffers|gzip_comp_level|gzip_disable|gzip_http_version|gzip_min_length|gzip_proxied|gzip_static|gzip_types|gzip_vary|if|if_modified_since|ignore_invalid_headers|image_filter|image_filter_buffer|image_filter_jpeg_quality|image_filter_sharpen|image_filter_transparency|imap_capabilities|imap_client_buffer|include|index|internal|ip_hash|keepalive|keepalive_disable|keepalive_requests|keepalive_timeout|kqueue_changes|kqueue_events|large_client_header_buffers|limit_conn|limit_conn_log_level|limit_conn_zone|limit_except|limit_rate|limit_rate_after|limit_req|limit_req_log_level|limit_req_zone|limit_zone|lingering_close|lingering_time|lingering_timeout|listen|location|lock_file|log_format|log_format_combined|log_not_found|log_subrequest|map|map_hash_bucket_size|map_hash_max_size|master_process|max_ranges|memcached_buffer_size|memcached_connect_timeout|memcached_next_upstream|memcached_pass|memcached_read_timeout|memcached_send_timeout|merge_slashes|min_delete_depth|modern_browser|modern_browser_value|mp4|mp4_buffer_size|mp4_max_buffer_size|msie_padding|msie_refresh|multi_accept|open_file_cache|open_file_cache_errors|open_file_cache_min_uses|open_file_cache_valid|open_log_file_cache|optimize_server_names|override_charset|pcre_jit|perl|perl_modules|perl_require|perl_set|pid|pop3_auth|pop3_capabilities|port_in_redirect|post_action|postpone_output|protocol|proxy|proxy_buffer|proxy_buffer_size|proxy_buffering|proxy_buffers|proxy_busy_buffers_size|proxy_cache|proxy_cache_bypass|proxy_cache_key|proxy_cache_lock|proxy_cache_lock_timeout|proxy_cache_methods|proxy_cache_min_uses|proxy_cache_path|proxy_cache_use_stale|proxy_cache_valid|proxy_connect_timeout|proxy_cookie_domain|proxy_cookie_path|proxy_headers_hash_bucket_size|proxy_headers_hash_max_size|proxy_hide_header|proxy_http_version|proxy_ignore_client_abort|proxy_ignore_headers|proxy_intercept_errors|proxy_max_temp_file_size|proxy_method|proxy_next_upstream|proxy_no_cache|proxy_pass|proxy_pass_error_message|proxy_pass_header|proxy_pass_request_body|proxy_pass_request_headers|proxy_read_timeout|proxy_redirect|proxy_redirect_errors|proxy_send_lowat|proxy_send_timeout|proxy_set_body|proxy_set_header|proxy_ssl_session_reuse|proxy_store|proxy_store_access|proxy_temp_file_write_size|proxy_temp_path|proxy_timeout|proxy_upstream_fail_timeout|proxy_upstream_max_fails|random_index|read_ahead|real_ip_header|recursive_error_pages|request_pool_size|reset_timedout_connection|resolver|resolver_timeout|return|rewrite|root|rtsig_overflow_events|rtsig_overflow_test|rtsig_overflow_threshold|rtsig_signo|satisfy|satisfy_any|secure_link_secret|send_lowat|send_timeout|sendfile|sendfile_max_chunk|server|server_name|server_name_in_redirect|server_names_hash_bucket_size|server_names_hash_max_size|server_tokens|set|set_real_ip_from|smtp_auth|smtp_capabilities|so_keepalive|source_charset|split_clients|ssi|ssi_silent_errors|ssi_types|ssi_value_length|ssl|ssl_certificate|ssl_certificate_key|ssl_ciphers|ssl_client_certificate|ssl_crl|ssl_dhparam|ssl_engine|ssl_prefer_server_ciphers|ssl_protocols|ssl_session_cache|ssl_session_timeout|ssl_verify_client|ssl_verify_depth|starttls|stub_status|sub_filter|sub_filter_once|sub_filter_types|tcp_nodelay|tcp_nopush|timeout|timer_resolution|try_files|types|types_hash_bucket_size|types_hash_max_size|underscores_in_headers|uninitialized_variable_warn|upstream|use|user|userid|userid_domain|userid_expires|userid_name|userid_p3p|userid_path|userid_service|valid_referers|variables_hash_bucket_size|variables_hash_max_size|worker_connections|worker_cpu_affinity|worker_priority|worker_processes|worker_rlimit_core|worker_rlimit_nofile|worker_rlimit_sigpending|working_directory|xclient|xml_entities|xslt_entities|xslt_stylesheet|xslt_types)\b/i | |
| 1443 | 1674 | }); |
| 1444 | 1675 | |
| 1445 | 1676 | Prism.languages.insertBefore('nginx', 'keyword', { |
| 1446 | − 'variable': /\$[a-z_]+/i | |
| 1677 | + 'variable': /\$[a-z_]+/i | |
| 1447 | 1678 | }); |
| 1448 | 1679 | Prism.languages.nim = { |
| 1449 | 1680 | 'comment': /#.*/, |
| @@ -1497,31 +1728,31 @@ Prism.languages.perl = { · 47 unmodified lines | ||
| 1497 | 1728 | pattern: /\b(?:q|qq|qx|qw)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1/, |
| 1498 | 1729 | greedy: true |
| 1499 | 1730 | }, |
| 1500 | − | |
| 1731 | + | |
| 1501 | 1732 | // q a...a |
| 1502 | 1733 | { |
| 1503 | 1734 | pattern: /\b(?:q|qq|qx|qw)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1/, |
| 1504 | 1735 | greedy: true |
| 1505 | 1736 | }, |
| 1506 | − | |
| 1737 | + | |
| 1507 | 1738 | // q(...) |
| 1508 | 1739 | { |
| 1509 | 1740 | pattern: /\b(?:q|qq|qx|qw)\s*\((?:[^()\\]|\\[\s\S])*\)/, |
| 1510 | 1741 | greedy: true |
| 1511 | 1742 | }, |
| 1512 | − | |
| 1743 | + | |
| 1513 | 1744 | // q{...} |
| 1514 | 1745 | { |
| 1515 | 1746 | pattern: /\b(?:q|qq|qx|qw)\s*\{(?:[^{}\\]|\\[\s\S])*\}/, |
| 1516 | 1747 | greedy: true |
| 1517 | 1748 | }, |
| 1518 | − | |
| 1749 | + | |
| 1519 | 1750 | // q[...] |
| 1520 | 1751 | { |
| 1521 | 1752 | pattern: /\b(?:q|qq|qx|qw)\s*\[(?:[^[\]\\]|\\[\s\S])*\]/, |
| 1522 | 1753 | greedy: true |
| 1523 | 1754 | }, |
| 1524 | − | |
| 1755 | + | |
| 1525 | 1756 | // q<...> |
| 1526 | 1757 | { |
| 1527 | 1758 | pattern: /\b(?:q|qq|qx|qw)\s*<(?:[^<>\\]|\\[\s\S])*>/, |
| @@ -1547,31 +1778,31 @@ Prism.languages.perl = { · 19 unmodified lines | ||
| 1547 | 1778 | pattern: /\b(?:m|qr)\s*([^a-zA-Z0-9\s{(\[<])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/, |
| 1548 | 1779 | greedy: true |
| 1549 | 1780 | }, |
| 1550 | − | |
| 1781 | + | |
| 1551 | 1782 | // m a...a |
| 1552 | 1783 | { |
| 1553 | 1784 | pattern: /\b(?:m|qr)\s+([a-zA-Z0-9])(?:(?!\1)[^\\]|\\[\s\S])*\1[msixpodualngc]*/, |
| 1554 | 1785 | greedy: true |
| 1555 | 1786 | }, |
| 1556 | − | |
| 1787 | + | |
| 1557 | 1788 | // m(...) |
| 1558 | 1789 | { |
| 1559 | 1790 | pattern: /\b(?:m|qr)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngc]*/, |
| 1560 | 1791 | greedy: true |
| 1561 | 1792 | }, |
| 1562 | − | |
| 1793 | + | |
| 1563 | 1794 | // m{...} |
| 1564 | 1795 | { |
| 1565 | 1796 | pattern: /\b(?:m|qr)\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngc]*/, |
| 1566 | 1797 | greedy: true |
| 1567 | 1798 | }, |
| 1568 | − | |
| 1799 | + | |
| 1569 | 1800 | // m[...] |
| 1570 | 1801 | { |
| 1571 | 1802 | pattern: /\b(?:m|qr)\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngc]*/, |
| 1572 | 1803 | greedy: true |
| 1573 | 1804 | }, |
| 1574 | − | |
| 1805 | + | |
| 1575 | 1806 | // m<...> |
| 1576 | 1807 | { |
| 1577 | 1808 | pattern: /\b(?:m|qr)\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngc]*/, |
| @@ -1586,42 +1817,42 @@ Prism.languages.perl = { · 8 unmodified lines | ||
| 1586 | 1817 | lookbehind: true, |
| 1587 | 1818 | greedy: true |
| 1588 | 1819 | }, |
| 1589 | − | |
| 1820 | + | |
| 1590 | 1821 | // s a...a...a |
| 1591 | 1822 | { |
| 1592 | 1823 | pattern: /(^|[^-]\b)(?:s|tr|y)\s+([a-zA-Z0-9])(?:(?!\2)[^\\]|\\[\s\S])*\2(?:(?!\2)[^\\]|\\[\s\S])*\2[msixpodualngcer]*/, |
| 1593 | 1824 | lookbehind: true, |
| 1594 | 1825 | greedy: true |
| 1595 | 1826 | }, |
| 1596 | − | |
| 1827 | + | |
| 1597 | 1828 | // s(...)(...) |
| 1598 | 1829 | { |
| 1599 | 1830 | pattern: /(^|[^-]\b)(?:s|tr|y)\s*\((?:[^()\\]|\\[\s\S])*\)\s*\((?:[^()\\]|\\[\s\S])*\)[msixpodualngcer]*/, |
| 1600 | 1831 | lookbehind: true, |
| 1601 | 1832 | greedy: true |
| 1602 | 1833 | }, |
| 1603 | − | |
| 1834 | + | |
| 1604 | 1835 | // s{...}{...} |
| 1605 | 1836 | { |
| 1606 | 1837 | pattern: /(^|[^-]\b)(?:s|tr|y)\s*\{(?:[^{}\\]|\\[\s\S])*\}\s*\{(?:[^{}\\]|\\[\s\S])*\}[msixpodualngcer]*/, |
| 1607 | 1838 | lookbehind: true, |
| 1608 | 1839 | greedy: true |
| 1609 | 1840 | }, |
| 1610 | − | |
| 1841 | + | |
| 1611 | 1842 | // s[...][...] |
| 1612 | 1843 | { |
| 1613 | 1844 | pattern: /(^|[^-]\b)(?:s|tr|y)\s*\[(?:[^[\]\\]|\\[\s\S])*\]\s*\[(?:[^[\]\\]|\\[\s\S])*\][msixpodualngcer]*/, |
| 1614 | 1845 | lookbehind: true, |
| 1615 | 1846 | greedy: true |
| 1616 | 1847 | }, |
| 1617 | − | |
| 1848 | + | |
| 1618 | 1849 | // s<...><...> |
| 1619 | 1850 | { |
| 1620 | 1851 | pattern: /(^|[^-]\b)(?:s|tr|y)\s*<(?:[^<>\\]|\\[\s\S])*>\s*<(?:[^<>\\]|\\[\s\S])*>[msixpodualngcer]*/, |
| 1621 | 1852 | lookbehind: true, |
| 1622 | 1853 | greedy: true |
| 1623 | 1854 | }, |
| 1624 | − | |
| 1855 | + | |
| 1625 | 1856 | // /.../ |
| 1626 | 1857 | // The look-ahead tries to prevent two divisions on |
| 1627 | 1858 | // the same line from being highlighted as regex. |
| @@ -1665,7 +1896,7 @@ Prism.languages.perl = { · 37 unmodified lines | ||
| 1665 | 1896 | } |
| 1666 | 1897 | }, |
| 1667 | 1898 | 'keyword': /\b(?:any|break|continue|default|delete|die|do|else|elsif|eval|for|foreach|given|goto|if|last|local|my|next|our|package|print|redo|require|say|state|sub|switch|undef|unless|until|use|when|while)\b/, |
| 1668 | − 'number': /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/, | |
| 1899 | + 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0b[01](?:_?[01])*|(?:\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)\b/, | |
| 1669 | 1900 | 'operator': /-[rwxoRWXOezsfdlpSbctugkTBMAC]\b|\+[+=]?|-[-=>]?|\*\*?=?|\/\/?=?|=[=~>]?|~[~=]?|\|\|?=?|&&?=?|<(?:=>?|<=?)?|>>?=?|![~=]?|[%^]=?|\.(?:=|\.\.?)?|[\\?]|\bx(?:=|\b)|\b(?:lt|gt|le|ge|eq|ne|cmp|not|and|or|xor)\b/, |
| 1670 | 1901 | 'punctuation': /[{}[\];(),:]/ |
| 1671 | 1902 | }; |
| @@ -1682,110 +1913,211 @@ Prism.languages.perl = { · 10 unmodified lines | ||
| 1682 | 1913 | * Adds the following new token classes: |
| 1683 | 1914 | * constant, delimiter, variable, function, package |
| 1684 | 1915 | */ |
| 1916 | +(function (Prism) { | |
| 1917 | + Prism.languages.php = Prism.languages.extend('clike', { | |
| 1918 | + 'keyword': /\b(?:and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i, | |
| 1919 | + 'constant': /\b[A-Z0-9_]{2,}\b/, | |
| 1920 | + 'comment': { | |
| 1921 | + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, | |
| 1922 | + lookbehind: true | |
| 1923 | + } | |
| 1924 | + }); | |
| 1685 | 1925 | |
| 1686 | −Prism.languages.php = Prism.languages.extend('clike', { | |
| 1687 | − 'keyword': /\b(?:and|or|xor|array|as|break|case|cfunction|class|const|continue|declare|default|die|do|else|elseif|enddeclare|endfor|endforeach|endif|endswitch|endwhile|extends|for|foreach|function|include|include_once|global|if|new|return|static|switch|use|require|require_once|var|while|abstract|interface|public|implements|private|protected|parent|throw|null|echo|print|trait|namespace|final|yield|goto|instanceof|finally|try|catch)\b/i, | |
| 1688 | − 'constant': /\b[A-Z0-9_]{2,}\b/, | |
| 1689 | − 'comment': { | |
| 1690 | − pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, | |
| 1691 | − lookbehind: true | |
| 1692 | − } | |
| 1693 | −}); | |
| 1926 | + Prism.languages.insertBefore('php', 'string', { | |
| 1927 | + 'shell-comment': { | |
| 1928 | + pattern: /(^|[^\\])#.*/, | |
| 1929 | + lookbehind: true, | |
| 1930 | + alias: 'comment' | |
| 1931 | + } | |
| 1932 | + }); | |
| 1694 | 1933 | |
| 1695 | −// Shell-like comments are matched after strings, because they are less | |
| 1696 | −// common than strings containing hashes... | |
| 1697 | −Prism.languages.insertBefore('php', 'class-name', { | |
| 1698 | − 'shell-comment': { | |
| 1699 | − pattern: /(^|[^\\])#.*/, | |
| 1700 | − lookbehind: true, | |
| 1701 | − alias: 'comment' | |
| 1702 | − } | |
| 1703 | −}); | |
| 1934 | + Prism.languages.insertBefore('php', 'keyword', { | |
| 1935 | + 'delimiter': { | |
| 1936 | + pattern: /\?>|<\?(?:php|=)?/i, | |
| 1937 | + alias: 'important' | |
| 1938 | + }, | |
| 1939 | + 'variable': /\$+(?:\w+\b|(?={))/i, | |
| 1940 | + 'package': { | |
| 1941 | + pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, | |
| 1942 | + lookbehind: true, | |
| 1943 | + inside: { | |
| 1944 | + punctuation: /\\/ | |
| 1945 | + } | |
| 1946 | + } | |
| 1947 | + }); | |
| 1704 | 1948 | |
| 1705 | −Prism.languages.insertBefore('php', 'keyword', { | |
| 1706 | − 'delimiter': { | |
| 1707 | − pattern: /\?>|<\?(?:php|=)?/i, | |
| 1708 | − alias: 'important' | |
| 1709 | − }, | |
| 1710 | − 'variable': /\$\w+\b/i, | |
| 1711 | − 'package': { | |
| 1712 | − pattern: /(\\|namespace\s+|use\s+)[\w\\]+/, | |
| 1713 | − lookbehind: true, | |
| 1714 | − inside: { | |
| 1715 | − punctuation: /\\/ | |
| 1949 | + // Must be defined after the function pattern | |
| 1950 | + Prism.languages.insertBefore('php', 'operator', { | |
| 1951 | + 'property': { | |
| 1952 | + pattern: /(->)[\w]+/, | |
| 1953 | + lookbehind: true | |
| 1716 | 1954 | } |
| 1717 | − } | |
| 1718 | −}); | |
| 1955 | + }); | |
| 1719 | 1956 | |
| 1720 | −// Must be defined after the function pattern | |
| 1721 | −Prism.languages.insertBefore('php', 'operator', { | |
| 1722 | − 'property': { | |
| 1723 | − pattern: /(->)[\w]+/, | |
| 1724 | − lookbehind: true | |
| 1725 | − } | |
| 1726 | −}); | |
| 1957 | + Prism.languages.insertBefore('php', 'string', { | |
| 1958 | + 'nowdoc-string': { | |
| 1959 | + pattern: /<<<'([^']+)'(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;/, | |
| 1960 | + greedy: true, | |
| 1961 | + alias: 'string', | |
| 1962 | + inside: { | |
| 1963 | + 'delimiter': { | |
| 1964 | + pattern: /^<<<'[^']+'|[a-z_]\w*;$/i, | |
| 1965 | + alias: 'symbol', | |
| 1966 | + inside: { | |
| 1967 | + 'punctuation': /^<<<'?|[';]$/ | |
| 1968 | + } | |
| 1969 | + } | |
| 1970 | + } | |
| 1971 | + }, | |
| 1972 | + 'heredoc-string': { | |
| 1973 | + pattern: /<<<(?:"([^"]+)"(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\1;|([a-z_]\w*)(?:\r\n?|\n)(?:.*(?:\r\n?|\n))*?\2;)/i, | |
| 1974 | + greedy: true, | |
| 1975 | + alias: 'string', | |
| 1976 | + inside: { | |
| 1977 | + 'delimiter': { | |
| 1978 | + pattern: /^<<<(?:"[^"]+"|[a-z_]\w*)|[a-z_]\w*;$/i, | |
| 1979 | + alias: 'symbol', | |
| 1980 | + inside: { | |
| 1981 | + 'punctuation': /^<<<"?|[";]$/ | |
| 1982 | + } | |
| 1983 | + }, | |
| 1984 | + 'interpolation': null // See below | |
| 1985 | + } | |
| 1986 | + }, | |
| 1987 | + 'single-quoted-string': { | |
| 1988 | + pattern: /'(?:\\[\s\S]|[^\\'])*'/, | |
| 1989 | + greedy: true, | |
| 1990 | + alias: 'string' | |
| 1991 | + }, | |
| 1992 | + 'double-quoted-string': { | |
| 1993 | + pattern: /"(?:\\[\s\S]|[^\\"])*"/, | |
| 1994 | + greedy: true, | |
| 1995 | + alias: 'string', | |
| 1996 | + inside: { | |
| 1997 | + 'interpolation': null // See below | |
| 1998 | + } | |
| 1999 | + } | |
| 2000 | + }); | |
| 2001 | + // The different types of PHP strings "replace" the C-like standard string | |
| 2002 | + delete Prism.languages.php['string']; | |
| 1727 | 2003 | |
| 1728 | −// Add HTML support if the markup language exists | |
| 1729 | −if (Prism.languages.markup) { | |
| 2004 | + var string_interpolation = { | |
| 2005 | + pattern: /{\$(?:{(?:{[^{}]+}|[^{}]+)}|[^{}])+}|(^|[^\\{])\$+(?:\w+(?:\[.+?]|->\w+)*)/, | |
| 2006 | + lookbehind: true, | |
| 2007 | + inside: { | |
| 2008 | + rest: Prism.languages.php | |
| 2009 | + } | |
| 2010 | + }; | |
| 2011 | + Prism.languages.php['heredoc-string'].inside['interpolation'] = string_interpolation; | |
| 2012 | + Prism.languages.php['double-quoted-string'].inside['interpolation'] = string_interpolation; | |
| 1730 | 2013 | |
| 1731 | − // Tokenize all inline PHP blocks that are wrapped in <?php ?> | |
| 1732 | − // This allows for easy PHP + markup highlighting | |
| 1733 | − Prism.hooks.add('before-highlight', function(env) { | |
| 1734 | − if (env.language !== 'php' || !/(?:<\?php|<\?)/ig.test(env.code)) { | |
| 2014 | + Prism.hooks.add('before-tokenize', function(env) { | |
| 2015 | + if (!/(?:<\?php|<\?)/ig.test(env.code)) { | |
| 1735 | 2016 | return; |
| 1736 | 2017 | } |
| 1737 | 2018 | |
| 1738 | − env.tokenStack = []; | |
| 1739 | − | |
| 1740 | − env.backupCode = env.code; | |
| 1741 | − env.code = env.code.replace(/(?:<\?php|<\?)[\s\S]*?(?:\?>|$)/ig, function(match) { | |
| 1742 | − var i = env.tokenStack.length; | |
| 1743 | − // Check for existing strings | |
| 1744 | − while (env.backupCode.indexOf('___PHP' + i + '___') !== -1) | |
| 1745 | − ++i; | |
| 1746 | − | |
| 1747 | − // Create a sparse array | |
| 1748 | − env.tokenStack[i] = match; | |
| 1749 | − | |
| 1750 | − return '___PHP' + i + '___'; | |
| 1751 | − }); | |
| 2019 | + var phpPattern = /(?:<\?php|<\?)[\s\S]*?(?:\?>|$)/ig; | |
| 2020 | + Prism.languages['markup-templating'].buildPlaceholders(env, 'php', phpPattern); | |
| 2021 | + }); | |
| 1752 | 2022 | |
| 1753 | − // Switch the grammar to markup | |
| 1754 | − env.grammar = Prism.languages.markup; | |
| 2023 | + Prism.hooks.add('after-tokenize', function(env) { | |
| 2024 | + Prism.languages['markup-templating'].tokenizePlaceholders(env, 'php'); | |
| 1755 | 2025 | }); |
| 1756 | 2026 | |
| 1757 | − // Restore env.code for other plugins (e.g. line-numbers) | |
| 1758 | − Prism.hooks.add('before-insert', function(env) { | |
| 1759 | − if (env.language === 'php' && env.backupCode) { | |
| 1760 | − env.code = env.backupCode; | |
| 1761 | − delete env.backupCode; | |
| 2027 | +}(Prism)); | |
| 2028 | +Prism.languages.sql= { | |
| 2029 | + 'comment': { | |
| 2030 | + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, | |
| 2031 | + lookbehind: true | |
| 2032 | + }, | |
| 2033 | + 'string' : { | |
| 2034 | + pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\])*\2/, | |
| 2035 | + greedy: true, | |
| 2036 | + lookbehind: true | |
| 2037 | + }, | |
| 2038 | + 'variable': /@[\w.$]+|@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/, | |
| 2039 | + 'function': /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, // Should we highlight user defined functions too? | |
| 2040 | + 'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i, | |
| 2041 | + 'boolean': /\b(?:TRUE|FALSE|NULL)\b/i, | |
| 2042 | + 'number': /\b0x[\da-f]+\b|\b\d+\.?\d*|\B\.\d+\b/i, | |
| 2043 | + 'operator': /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, | |
| 2044 | + 'punctuation': /[;[\]()`,.]/ | |
| 2045 | +}; | |
| 2046 | +Prism.languages.scss = Prism.languages.extend('css', { | |
| 2047 | + 'comment': { | |
| 2048 | + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, | |
| 2049 | + lookbehind: true | |
| 2050 | + }, | |
| 2051 | + 'atrule': { | |
| 2052 | + pattern: /@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/, | |
| 2053 | + inside: { | |
| 2054 | + 'rule': /@[\w-]+/ | |
| 2055 | + // See rest below | |
| 1762 | 2056 | } |
| 1763 | − }); | |
| 2057 | + }, | |
| 2058 | + // url, compassified | |
| 2059 | + 'url': /(?:[-a-z]+-)*url(?=\()/i, | |
| 2060 | + // CSS selector regex is not appropriate for Sass | |
| 2061 | + // since there can be lot more things (var, @ directive, nesting..) | |
| 2062 | + // a selector must start at the end of a property or after a brace (end of other rules or nesting) | |
| 2063 | + // it can contain some characters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable | |
| 2064 | + // the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var | |
| 2065 | + // can "pass" as a selector- e.g: proper#{$erty}) | |
| 2066 | + // this one was hard to do, so please be careful if you edit this one :) | |
| 2067 | + 'selector': { | |
| 2068 | + // Initial look-ahead is used to prevent matching of blank selectors | |
| 2069 | + pattern: /(?=\S)[^@;{}()]?(?:[^@;{}()]|&|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}]+[:{][^}]+))/m, | |
| 2070 | + inside: { | |
| 2071 | + 'parent': { | |
| 2072 | + pattern: /&/, | |
| 2073 | + alias: 'important' | |
| 2074 | + }, | |
| 2075 | + 'placeholder': /%[-\w]+/, | |
| 2076 | + 'variable': /\$[-\w]+|#\{\$[-\w]+\}/ | |
| 2077 | + } | |
| 2078 | + } | |
| 2079 | +}); | |
| 1764 | 2080 | |
| 1765 | − // Re-insert the tokens after highlighting | |
| 1766 | − Prism.hooks.add('after-highlight', function(env) { | |
| 1767 | − if (env.language !== 'php' || !env.tokenStack) { | |
| 1768 | − return; | |
| 2081 | +Prism.languages.insertBefore('scss', 'atrule', { | |
| 2082 | + 'keyword': [ | |
| 2083 | + /@(?:if|else(?: if)?|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)/i, | |
| 2084 | + { | |
| 2085 | + pattern: /( +)(?:from|through)(?= )/, | |
| 2086 | + lookbehind: true | |
| 1769 | 2087 | } |
| 2088 | + ] | |
| 2089 | +}); | |
| 1770 | 2090 | |
| 1771 | − // Switch the grammar back | |
| 1772 | − env.grammar = Prism.languages.php; | |
| 2091 | +Prism.languages.scss.property = { | |
| 2092 | + pattern: /(?:[\w-]|\$[-\w]+|#\{\$[-\w]+\})+(?=\s*:)/i, | |
| 2093 | + inside: { | |
| 2094 | + 'variable': /\$[-\w]+|#\{\$[-\w]+\}/ | |
| 2095 | + } | |
| 2096 | +}; | |
| 1773 | 2097 | |
| 1774 | − for (var i = 0, keys = Object.keys(env.tokenStack); i < keys.length; ++i) { | |
| 1775 | − var k = keys[i]; | |
| 1776 | − var t = env.tokenStack[k]; | |
| 2098 | +Prism.languages.insertBefore('scss', 'important', { | |
| 2099 | + // var and interpolated vars | |
| 2100 | + 'variable': /\$[-\w]+|#\{\$[-\w]+\}/ | |
| 2101 | +}); | |
| 1777 | 2102 | |
| 1778 | − // The replace prevents $$, $&, $`, $', $n, $nn from being interpreted as special patterns | |
| 1779 | − env.highlightedCode = env.highlightedCode.replace('___PHP' + k + '___', | |
| 1780 | − "<span class=\"token php language-php\">" + | |
| 1781 | − Prism.highlight(t, env.grammar, 'php').replace(/\$/g, '$$$$') + | |
| 1782 | − "</span>"); | |
| 1783 | − } | |
| 2103 | +Prism.languages.insertBefore('scss', 'function', { | |
| 2104 | + 'placeholder': { | |
| 2105 | + pattern: /%[-\w]+/, | |
| 2106 | + alias: 'selector' | |
| 2107 | + }, | |
| 2108 | + 'statement': { | |
| 2109 | + pattern: /\B!(?:default|optional)\b/i, | |
| 2110 | + alias: 'keyword' | |
| 2111 | + }, | |
| 2112 | + 'boolean': /\b(?:true|false)\b/, | |
| 2113 | + 'null': /\bnull\b/, | |
| 2114 | + 'operator': { | |
| 2115 | + pattern: /(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/, | |
| 2116 | + lookbehind: true | |
| 2117 | + } | |
| 2118 | +}); | |
| 1784 | 2119 | |
| 1785 | − env.element.innerHTML = env.highlightedCode; | |
| 1786 | − }); | |
| 1787 | −} | |
| 1788 | −; | |
| 2120 | +Prism.languages.scss['atrule'].inside.rest = Prism.languages.scss; | |
| 1789 | 2121 | Prism.languages.python = { |
| 1790 | 2122 | 'comment': { |
| 1791 | 2123 | pattern: /(^|[^\\])#.*/, |
| @@ -1811,7 +2143,7 @@ Prism.languages.python = { · 19 unmodified lines | ||
| 1811 | 2143 | 'keyword': /\b(?:as|assert|async|await|break|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|nonlocal|pass|print|raise|return|try|while|with|yield)\b/, |
| 1812 | 2144 | 'builtin':/\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/, |
| 1813 | 2145 | 'boolean': /\b(?:True|False|None)\b/, |
| 1814 | − 'number': /\b-?(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, | |
| 2146 | + 'number': /(?:\b(?=\d)|\B(?=\.))(?:0[bo])?(?:(?:\d|0x[\da-f])[\da-f]*\.?\d*|\.\d+)(?:e[+-]?\d+)?j?\b/i, | |
| 1815 | 2147 | 'operator': /[-+%=]=?|!=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]|\b(?:or|and|not)\b/, |
| 1816 | 2148 | 'punctuation': /[{}[\];(),.:]/ |
| 1817 | 2149 | }; |
| @@ -1821,93 +2153,134 @@ Prism.languages.python = { · 3 unmodified lines | ||
| 1821 | 2153 | var javascript = Prism.util.clone(Prism.languages.javascript); |
| 1822 | 2154 | |
| 1823 | 2155 | Prism.languages.jsx = Prism.languages.extend('markup', javascript); |
| 1824 | −Prism.languages.jsx.tag.pattern= /<\/?[\w.:-]+\s*(?:\s+(?:[\w\.:-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">=]+|(?:\{[^}]*\})))?|\{\.{3}\w+\}))*\s*\/?>/i; | |
| 2156 | +Prism.languages.jsx.tag.pattern= /<\/?(?:[\w.:-]+\s*(?:\s+(?:[\w.:-]+(?:=(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s{'">=]+|\{(?:\{(?:\{[^}]*\}|[^{}])*\}|[^{}])+\}))?|\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}))*\s*\/?)?>/i; | |
| 1825 | 2157 | |
| 2158 | +Prism.languages.jsx.tag.inside['tag'].pattern = /^<\/?[^\s>\/]*/i; | |
| 1826 | 2159 | Prism.languages.jsx.tag.inside['attr-value'].pattern = /=(?!\{)(?:("|')(?:\\[\s\S]|(?!\1)[^\\])*\1|[^\s'">]+)/i; |
| 1827 | 2160 | |
| 1828 | 2161 | Prism.languages.insertBefore('inside', 'attr-name', { |
| 1829 | 2162 | 'spread': { |
| 1830 | − pattern: /\{\.{3}\w+\}/, | |
| 2163 | + pattern: /\{\.{3}[a-z_$][\w$]*(?:\.[a-z_$][\w$]*)*\}/, | |
| 1831 | 2164 | inside: { |
| 1832 | − 'punctuation': /[{}]|\.{3}/, | |
| 2165 | + 'punctuation': /\.{3}|[{}.]/, | |
| 1833 | 2166 | 'attr-value': /\w+/ |
| 1834 | 2167 | } |
| 1835 | 2168 | } |
| 1836 | 2169 | }, Prism.languages.jsx.tag); |
| 1837 | 2170 | |
| 1838 | −var jsxExpression = Prism.util.clone(Prism.languages.jsx); | |
| 1839 | − | |
| 1840 | −delete jsxExpression.punctuation; | |
| 1841 | − | |
| 1842 | −jsxExpression = Prism.languages.insertBefore('jsx', 'operator', { | |
| 1843 | − 'punctuation': /=(?={)|[{}[\];(),.:]/ | |
| 1844 | −}, { jsx: jsxExpression }); | |
| 1845 | − | |
| 1846 | 2171 | Prism.languages.insertBefore('inside', 'attr-value',{ |
| 1847 | 2172 | 'script': { |
| 1848 | − // Allow for one level of nesting | |
| 1849 | − pattern: /=(\{(?:\{[^}]*\}|[^}])+\})/i, | |
| 1850 | − inside: jsxExpression, | |
| 2173 | + // Allow for two levels of nesting | |
| 2174 | + pattern: /=(\{(?:\{(?:\{[^}]*\}|[^}])*\}|[^}])+\})/i, | |
| 2175 | + inside: { | |
| 2176 | + 'script-punctuation': { | |
| 2177 | + pattern: /^=(?={)/, | |
| 2178 | + alias: 'punctuation' | |
| 2179 | + }, | |
| 2180 | + rest: Prism.languages.jsx | |
| 2181 | + }, | |
| 1851 | 2182 | 'alias': 'language-javascript' |
| 1852 | 2183 | } |
| 1853 | 2184 | }, Prism.languages.jsx.tag); |
| 1854 | 2185 | |
| 1855 | −}(Prism)); | |
| 2186 | +// The following will handle plain text inside tags | |
| 2187 | +var stringifyToken = function (token) { | |
| 2188 | + if (!token) { | |
| 2189 | + return ''; | |
| 2190 | + } | |
| 2191 | + if (typeof token === 'string') { | |
| 2192 | + return token; | |
| 2193 | + } | |
| 2194 | + if (typeof token.content === 'string') { | |
| 2195 | + return token.content; | |
| 2196 | + } | |
| 2197 | + return token.content.map(stringifyToken).join(''); | |
| 2198 | +}; | |
| 1856 | 2199 | |
| 1857 | −(function(Prism) { | |
| 1858 | − Prism.languages.crystal = Prism.languages.extend('ruby', { | |
| 1859 | − keyword: [ | |
| 1860 | − /\b(?:abstract|alias|as|asm|begin|break|case|class|def|do|else|elsif|end|ensure|enum|extend|for|fun|if|include|instance_sizeof|lib|macro|module|next|of|out|pointerof|private|protected|rescue|return|require|select|self|sizeof|struct|super|then|type|typeof|uninitialized|union|unless|until|when|while|with|yield|__DIR__|__END_LINE__|__FILE__|__LINE__)\b/, | |
| 1861 | − { | |
| 1862 | − pattern: /(\.\s*)(?:is_a|responds_to)\?/, | |
| 1863 | − lookbehind: true | |
| 1864 | − } | |
| 1865 | − ], | |
| 2200 | +var walkTokens = function (tokens) { | |
| 2201 | + var openedTags = []; | |
| 2202 | + for (var i = 0; i < tokens.length; i++) { | |
| 2203 | + var token = tokens[i]; | |
| 2204 | + var notTagNorBrace = false; | |
| 2205 | + | |
| 2206 | + if (typeof token !== 'string') { | |
| 2207 | + if (token.type === 'tag' && token.content[0] && token.content[0].type === 'tag') { | |
| 2208 | + // We found a tag, now find its kind | |
| 2209 | + | |
| 2210 | + if (token.content[0].content[0].content === '</') { | |
| 2211 | + // Closing tag | |
| 2212 | + if (openedTags.length > 0 && openedTags[openedTags.length - 1].tagName === stringifyToken(token.content[0].content[1])) { | |
| 2213 | + // Pop matching opening tag | |
| 2214 | + openedTags.pop(); | |
| 2215 | + } | |
| 2216 | + } else { | |
| 2217 | + if (token.content[token.content.length - 1].content === '/>') { | |
| 2218 | + // Autoclosed tag, ignore | |
| 2219 | + } else { | |
| 2220 | + // Opening tag | |
| 2221 | + openedTags.push({ | |
| 2222 | + tagName: stringifyToken(token.content[0].content[1]), | |
| 2223 | + openedBraces: 0 | |
| 2224 | + }); | |
| 2225 | + } | |
| 2226 | + } | |
| 2227 | + } else if (openedTags.length > 0 && token.type === 'punctuation' && token.content === '{') { | |
| 1866 | 2228 | |
| 1867 | − number: /\b(?:0b[01_]*[01]|0o[0-7_]*[0-7]|0x[0-9a-fA-F_]*[0-9a-fA-F]|(?:\d(?:[0-9_]*\d)?)(?:\.[0-9_]*\d)?(?:[eE][+-]?[0-9_]*\d)?)(?:_(?:[uif](?:8|16|32|64))?)?\b/ | |
| 1868 | − }); | |
| 2229 | + // Here we might have entered a JSX context inside a tag | |
| 2230 | + openedTags[openedTags.length - 1].openedBraces++; | |
| 1869 | 2231 | |
| 1870 | − var rest = Prism.util.clone(Prism.languages.crystal); | |
| 2232 | + } else if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces > 0 && token.type === 'punctuation' && token.content === '}') { | |
| 1871 | 2233 | |
| 1872 | − Prism.languages.insertBefore('crystal', 'string', { | |
| 1873 | − attribute: { | |
| 1874 | − pattern: /@\[.+?\]/, | |
| 1875 | − alias: 'attr-name', | |
| 1876 | − inside: { | |
| 1877 | − delimiter: { | |
| 1878 | − pattern: /^@\[|\]$/, | |
| 1879 | − alias: 'tag' | |
| 1880 | − }, | |
| 1881 | − rest: rest | |
| 1882 | − } | |
| 1883 | − }, | |
| 2234 | + // Here we might have left a JSX context inside a tag | |
| 2235 | + openedTags[openedTags.length - 1].openedBraces--; | |
| 1884 | 2236 | |
| 1885 | − expansion: [ | |
| 1886 | − { | |
| 1887 | − pattern: /\{\{.+?\}\}/, | |
| 1888 | − inside: { | |
| 1889 | − delimiter: { | |
| 1890 | − pattern: /^\{\{|\}\}$/, | |
| 1891 | − alias: 'tag' | |
| 1892 | − }, | |
| 1893 | − rest: rest | |
| 2237 | + } else { | |
| 2238 | + notTagNorBrace = true | |
| 1894 | 2239 | } |
| 1895 | − }, | |
| 1896 | − { | |
| 1897 | − pattern: /\{%.+?%\}/, | |
| 1898 | − inside: { | |
| 1899 | − delimiter: { | |
| 1900 | − pattern: /^\{%|%\}$/, | |
| 1901 | − alias: 'tag' | |
| 1902 | − }, | |
| 1903 | − rest: rest | |
| 2240 | + } | |
| 2241 | + if (notTagNorBrace || typeof token === 'string') { | |
| 2242 | + if (openedTags.length > 0 && openedTags[openedTags.length - 1].openedBraces === 0) { | |
| 2243 | + // Here we are inside a tag, and not inside a JSX context. | |
| 2244 | + // That's plain text: drop any tokens matched. | |
| 2245 | + var plainText = stringifyToken(token); | |
| 2246 | + | |
| 2247 | + // And merge text with adjacent text | |
| 2248 | + if (i < tokens.length - 1 && (typeof tokens[i + 1] === 'string' || tokens[i + 1].type === 'plain-text')) { | |
| 2249 | + plainText += stringifyToken(tokens[i + 1]); | |
| 2250 | + tokens.splice(i + 1, 1); | |
| 2251 | + } | |
| 2252 | + if (i > 0 && (typeof tokens[i - 1] === 'string' || tokens[i - 1].type === 'plain-text')) { | |
| 2253 | + plainText = stringifyToken(tokens[i - 1]) + plainText; | |
| 2254 | + tokens.splice(i - 1, 1); | |
| 2255 | + i--; | |
| 2256 | + } | |
| 2257 | + | |
| 2258 | + tokens[i] = new Prism.Token('plain-text', plainText, null, plainText); | |
| 1904 | 2259 | } |
| 1905 | 2260 | } |
| 1906 | − ] | |
| 1907 | − }); | |
| 2261 | + | |
| 2262 | + if (token.content && typeof token.content !== 'string') { | |
| 2263 | + walkTokens(token.content); | |
| 2264 | + } | |
| 2265 | + } | |
| 2266 | +}; | |
| 2267 | + | |
| 2268 | +Prism.hooks.add('after-tokenize', function (env) { | |
| 2269 | + if (env.language !== 'jsx' && env.language !== 'tsx') { | |
| 2270 | + return; | |
| 2271 | + } | |
| 2272 | + walkTokens(env.tokens); | |
| 2273 | +}); | |
| 1908 | 2274 | |
| 1909 | 2275 | }(Prism)); |
| 1910 | 2276 | |
| 2277 | +Prism.languages.typescript = Prism.languages.extend('javascript', { | |
| 2278 | + // From JavaScript Prism keyword list and TypeScript language spec: https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#221-reserved-words | |
| 2279 | + 'keyword': /\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield|module|declare|constructor|namespace|abstract|require|type)\b/, | |
| 2280 | + 'builtin': /\b(?:string|Function|any|number|boolean|Array|symbol|console)\b/, | |
| 2281 | +}); | |
| 2282 | + | |
| 2283 | +Prism.languages.ts = Prism.languages.typescript; | |
| 1911 | 2284 | /* TODO |
| 1912 | 2285 | Add support for Markdown notation inside doc comments |
| 1913 | 2286 | Add support for nested block comments... |
| @@ -1932,10 +2305,18 @@ Prism.languages.rust = { · 18 unmodified lines | ||
| 1932 | 2305 | greedy: true |
| 1933 | 2306 | }, |
| 1934 | 2307 | { |
| 1935 | − pattern: /b?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/, | |
| 2308 | + pattern: /b?"(?:\\.|[^\\\r\n"])*"/, | |
| 1936 | 2309 | greedy: true |
| 1937 | 2310 | } |
| 1938 | 2311 | ], |
| 2312 | + 'char': { | |
| 2313 | + pattern: /b?'(?:\\(?:x[0-7][\da-fA-F]|u{(?:[\da-fA-F]_*){1,6}|.)|[^\\\r\n\t'])'/, | |
| 2314 | + alias: 'string' | |
| 2315 | + }, | |
| 2316 | + 'lifetime-annotation': { | |
| 2317 | + pattern: /'[^\s>']+/, | |
| 2318 | + alias: 'symbol' | |
| 2319 | + }, | |
| 1939 | 2320 | 'keyword': /\b(?:abstract|alignof|as|be|box|break|const|continue|crate|do|else|enum|extern|false|final|fn|for|if|impl|in|let|loop|match|mod|move|mut|offsetof|once|override|priv|pub|pure|ref|return|sizeof|static|self|struct|super|true|trait|type|typeof|unsafe|unsized|use|virtual|where|while|yield)\b/, |
| 1940 | 2321 | |
| 1941 | 2322 | 'attribute': { |
| @@ -1955,7 +2336,7 @@ Prism.languages.rust = { · 13 unmodified lines | ||
| 1955 | 2336 | }, |
| 1956 | 2337 | |
| 1957 | 2338 | // Hex, oct, bin, dec numbers with visual separators and type suffix |
| 1958 | − 'number': /\b-?(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64)?|f32|f64))?\b/, | |
| 2339 | + 'number': /\b(?:0x[\dA-Fa-f](?:_?[\dA-Fa-f])*|0o[0-7](?:_?[0-7])*|0b[01](?:_?[01])*|(\d(?:_?\d)*)?\.?\d(?:_?\d)*(?:[Ee][+-]?\d+)?)(?:_?(?:[iu](?:8|16|32|64)?|f32|f64))?\b/, | |
| 1959 | 2340 | |
| 1960 | 2341 | // Closure params should not be confused with bitwise OR | |
| 1961 | 2342 | 'closure-params': { |
| @@ -1966,107 +2347,8 @@ Prism.languages.rust = { · 4 unmodified lines | ||
| 1966 | 2347 | } |
| 1967 | 2348 | }, |
| 1968 | 2349 | 'punctuation': /[{}[\];(),:]|\.+|->/, |
| 1969 | − 'operator': /[-+*\/%!^=]=?|@|&[&=]?|\|[|=]?|<<?=?|>>?=?/ | |
| 2350 | + 'operator': /[-+*\/%!^]=?|=[=>]?|@|&[&=]?|\|[|=]?|<<?=?|>>?=?/ | |
| 1970 | 2351 | }; |
| 1971 | −Prism.languages.scss = Prism.languages.extend('css', { | |
| 1972 | − 'comment': { | |
| 1973 | − pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|\/\/.*)/, | |
| 1974 | − lookbehind: true | |
| 1975 | − }, | |
| 1976 | − 'atrule': { | |
| 1977 | − pattern: /@[\w-]+(?:\([^()]+\)|[^(])*?(?=\s+[{;])/, | |
| 1978 | − inside: { | |
| 1979 | − 'rule': /@[\w-]+/ | |
| 1980 | − // See rest below | |
| 1981 | − } | |
| 1982 | − }, | |
| 1983 | − // url, compassified | |
| 1984 | − 'url': /(?:[-a-z]+-)*url(?=\()/i, | |
| 1985 | − // CSS selector regex is not appropriate for Sass | |
| 1986 | − // since there can be lot more things (var, @ directive, nesting..) | |
| 1987 | − // a selector must start at the end of a property or after a brace (end of other rules or nesting) | |
| 1988 | − // it can contain some characters that aren't used for defining rules or end of selector, & (parent selector), or interpolated variable | |
| 1989 | − // the end of a selector is found when there is no rules in it ( {} or {\s}) or if there is a property (because an interpolated var | |
| 1990 | − // can "pass" as a selector- e.g: proper#{$erty}) | |
| 1991 | − // this one was hard to do, so please be careful if you edit this one :) | |
| 1992 | − 'selector': { | |
| 1993 | − // Initial look-ahead is used to prevent matching of blank selectors | |
| 1994 | − pattern: /(?=\S)[^@;{}()]?(?:[^@;{}()]|&|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}]+[:{][^}]+))/m, | |
| 1995 | − inside: { | |
| 1996 | − 'parent': { | |
| 1997 | − pattern: /&/, | |
| 1998 | − alias: 'important' | |
| 1999 | − }, | |
| 2000 | − 'placeholder': /%[-\w]+/, | |
| 2001 | − 'variable': /\$[-\w]+|#\{\$[-\w]+\}/ | |
| 2002 | − } | |
| 2003 | − } | |
| 2004 | −}); | |
| 2005 | − | |
| 2006 | −Prism.languages.insertBefore('scss', 'atrule', { | |
| 2007 | − 'keyword': [ | |
| 2008 | − /@(?:if|else(?: if)?|for|each|while|import|extend|debug|warn|mixin|include|function|return|content)/i, | |
| 2009 | − { | |
| 2010 | − pattern: /( +)(?:from|through)(?= )/, | |
| 2011 | − lookbehind: true | |
| 2012 | − } | |
| 2013 | − ] | |
| 2014 | −}); | |
| 2015 | − | |
| 2016 | −Prism.languages.scss.property = { | |
| 2017 | − pattern: /(?:[\w-]|\$[-\w]+|#\{\$[-\w]+\})+(?=\s*:)/i, | |
| 2018 | − inside: { | |
| 2019 | − 'variable': /\$[-\w]+|#\{\$[-\w]+\}/ | |
| 2020 | − } | |
| 2021 | −}; | |
| 2022 | − | |
| 2023 | −Prism.languages.insertBefore('scss', 'important', { | |
| 2024 | − // var and interpolated vars | |
| 2025 | − 'variable': /\$[-\w]+|#\{\$[-\w]+\}/ | |
| 2026 | −}); | |
| 2027 | − | |
| 2028 | −Prism.languages.insertBefore('scss', 'function', { | |
| 2029 | − 'placeholder': { | |
| 2030 | − pattern: /%[-\w]+/, | |
| 2031 | − alias: 'selector' | |
| 2032 | − }, | |
| 2033 | − 'statement': { | |
| 2034 | − pattern: /\B!(?:default|optional)\b/i, | |
| 2035 | − alias: 'keyword' | |
| 2036 | − }, | |
| 2037 | − 'boolean': /\b(?:true|false)\b/, | |
| 2038 | − 'null': /\bnull\b/, | |
| 2039 | − 'operator': { | |
| 2040 | − pattern: /(\s)(?:[-+*\/%]|[=!]=|<=?|>=?|and|or|not)(?=\s)/, | |
| 2041 | − lookbehind: true | |
| 2042 | − } | |
| 2043 | −}); | |
| 2044 | − | |
| 2045 | −Prism.languages.scss['atrule'].inside.rest = Prism.util.clone(Prism.languages.scss); | |
| 2046 | −Prism.languages.sql= { | |
| 2047 | − 'comment': { | |
| 2048 | − pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, | |
| 2049 | − lookbehind: true | |
| 2050 | − }, | |
| 2051 | − 'string' : { | |
| 2052 | − pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\])*\2/, | |
| 2053 | − greedy: true, | |
| 2054 | − lookbehind: true | |
| 2055 | − }, | |
| 2056 | − 'variable': /@[\w.$]+|@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/, | |
| 2057 | − 'function': /\b(?:COUNT|SUM|AVG|MIN|MAX|FIRST|LAST|UCASE|LCASE|MID|LEN|ROUND|NOW|FORMAT)(?=\s*\()/i, // Should we highlight user defined functions too? | |
| 2058 | − 'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR VARYING|CHARACTER (?:SET|VARYING)|CHARSET|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COLUMNS|COMMENT|COMMIT|COMMITTED|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|DATA(?:BASES?)?|DATE(?:TIME)?|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITER(?:S)?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE(?: PRECISION)?|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE KEY|ELSE|ENABLE|ENCLOSED BY|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPE(?:D BY)?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|IDENTITY(?:_INSERT|COL)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTO|INVOKER|ISOLATION LEVEL|JOIN|KEYS?|KILL|LANGUAGE SQL|LAST|LEFT|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MODIFIES SQL DATA|MODIFY|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL(?: CHAR VARYING| CHARACTER(?: VARYING)?| VARCHAR)?|NATURAL|NCHAR(?: VARCHAR)?|NEXT|NO(?: SQL|CHECK|CYCLE)?|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READ(?:S SQL DATA|TEXT)?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEATABLE|REPLICATION|REQUIRE|RESTORE|RESTRICT|RETURNS?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE MODE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|START(?:ING BY)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED BY|TEXT(?:SIZE)?|THEN|TIMESTAMP|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNPIVOT|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?)\b/i, | |
| 2059 | − 'boolean': /\b(?:TRUE|FALSE|NULL)\b/i, | |
| 2060 | − 'number': /\b-?(?:0x)?\d*\.?[\da-f]+\b/, | |
| 2061 | − 'operator': /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|IN|LIKE|NOT|OR|IS|DIV|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, | |
| 2062 | − 'punctuation': /[;[\]()`,.]/ | |
| 2063 | −}; | |
| 2064 | −Prism.languages.typescript = Prism.languages.extend('javascript', { | |
| 2065 | − // From JavaScript Prism keyword list and TypeScript language spec: https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#221-reserved-words | |
| 2066 | − 'keyword': /\b(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|var|void|while|with|yield|false|true|module|declare|constructor|string|Function|any|number|boolean|Array|symbol|namespace|abstract|require|type)\b/ | |
| 2067 | −}); | |
| 2068 | − | |
| 2069 | −Prism.languages.ts = Prism.languages.typescript; | |
| 2070 | 2352 | Prism.languages.yaml = { |
| 2071 | 2353 | 'scalar': { |
| 2072 | 2354 | pattern: /([\-:]\s*(?:![^\s]+)?[ \t]*[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)[^\r\n]+(?:\2[^\r\n]+)*)/, |
| @@ -2105,11 +2387,10 @@ Prism.languages.yaml = { · 32 unmodified lines | ||
| 2105 | 2387 | greedy: true |
| 2106 | 2388 | }, |
| 2107 | 2389 | 'number': { |
| 2108 | − pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)[+\-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+\.?\d*|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im, | |
| 2390 | + pattern: /([:\-,[{]\s*(?:![^\s]+)?[ \t]*)[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+\.?\d*|\.?\d+)(?:e[+-]?\d+)?|\.inf|\.nan)[ \t]*(?=$|,|]|})/im, | |
| 2109 | 2391 | lookbehind: true |
| 2110 | 2392 | }, |
| 2111 | 2393 | 'tag': /![^\s]+/, |
| 2112 | 2394 | 'important': /[&*][\w]+/, |
| 2113 | 2395 | 'punctuation': /---|[:[\]{}\-,|>?]|\.\.\./ |
| 2114 | 2396 | }; |
| 2115 | − | |
| @@ -19,10 +19,6 @@ class app.views.RootPage extends app.View · 18 unmodified lines | ||
| 19 | 19 | else |
| 20 | 20 | 'intro' |
| 21 | 21 | |
| 22 | − # temporary | |
| 23 | − if location.host is 'devdocs.io' and location.protocol is 'http:' | |
| 24 | − tmpl = 'httpWarning' | |
| 25 | − | |
| 26 | 22 | @append @tmpl(tmpl) |
| 27 | 23 | return |
| 28 | 24 | |
| @@ -24,10 +24,9 @@ class app.views.SettingsPage extends app.View · 23 unmodified lines | ||
| 24 | 24 | 'Preferences' |
| 25 | 25 | |
| 26 | 26 | toggleDark: (enable) -> |
| 27 | − css = $('link[rel="stylesheet"][data-alt]') | |
| 28 | − alt = css.getAttribute('data-alt') | |
| 29 | − css.setAttribute('data-alt', css.getAttribute('href')) | |
| 30 | − css.setAttribute('href', alt) | |
| 27 | + html = document.documentElement | |
| 28 | + html.classList.toggle('_theme-default') | |
| 29 | + html.classList.toggle('_theme-dark') | |
| 31 | 30 | app.settings.set('dark', !!enable) |
| 32 | 31 | app.appCache?.updateInBackground() |
| 33 | 32 | return |
| @@ -17,6 +17,7 @@ class app.views.Search extends app.View · 16 unmodified lines | ||
| 17 | 17 | typing: 'focus' |
| 18 | 18 | altG: 'google' |
| 19 | 19 | altS: 'stackoverflow' |
| 20 | + altD: 'duckduckgo' | |
| 20 | 21 | |
| 21 | 22 | @routes: |
| 22 | 23 | after: 'afterRoute' |
| @@ -113,6 +114,10 @@ class app.views.Search extends app.View · 90 unmodified lines | ||
| 113 | 114 | @externalSearch "https://stackoverflow.com/search?q=" |
| 114 | 115 | return |
| 115 | 116 | |
| 117 | + duckduckgo: => | |
| 118 | + @externalSearch "https://duckduckgo.com/?t=devdocs&q=" | |
| 119 | + return | |
| 120 | + | |
| 116 | 121 | onResults: (results) => |
| 117 | 122 | @hasResults = true if results.length |
| 118 | 123 | @trigger 'results', results, @flags |
| @@ -1,105 +0,0 @@ | ||
| 1 | −//= depend_on docs-1.png | |
| 2 | −//= depend_on docs-1@2x.png | |
| 3 | −//= depend_on docs-2.png | |
| 4 | −//= depend_on docs-2@2x.png | |
| 5 | − | |
| 6 | −/*! | |
| 7 | − * Copyright 2013-2018 Thibaut Courouble and other contributors | |
| 8 | − * | |
| 9 | − * This source code is licensed under the terms of the Mozilla | |
| 10 | − * Public License, v. 2.0, a copy of which may be obtained at: | |
| 11 | − * http://mozilla.org/MPL/2.0/ | |
| 12 | − */ | |
| 13 | − | |
| 14 | −@import 'global/variables-dark', | |
| 15 | − 'global/mixins', | |
| 16 | − 'global/icons', | |
| 17 | − 'global/classes', | |
| 18 | − 'global/base'; | |
| 19 | − | |
| 20 | −@import 'components/app', | |
| 21 | − 'components/header', | |
| 22 | − 'components/notif', | |
| 23 | − 'components/sidebar', | |
| 24 | − 'components/settings', | |
| 25 | − 'components/content', | |
| 26 | − 'components/page', | |
| 27 | − 'components/fail', | |
| 28 | − 'components/path', | |
| 29 | − 'components/notice', | |
| 30 | − 'components/prism', | |
| 31 | − 'components/mobile'; | |
| 32 | − | |
| 33 | −@import 'pages/simple', | |
| 34 | − 'pages/angular', | |
| 35 | − 'pages/angularjs', | |
| 36 | − 'pages/apache', | |
| 37 | − 'pages/async', | |
| 38 | − 'pages/bootstrap', | |
| 39 | − 'pages/c', | |
| 40 | − 'pages/cakephp', | |
| 41 | − 'pages/clojure', | |
| 42 | − 'pages/codeception', | |
| 43 | − 'pages/coffeescript', | |
| 44 | − 'pages/cordova', | |
| 45 | − 'pages/crystal', | |
| 46 | − 'pages/d', | |
| 47 | − 'pages/d3', | |
| 48 | − 'pages/dojo', | |
| 49 | − 'pages/drupal', | |
| 50 | − 'pages/elixir', | |
| 51 | − 'pages/ember', | |
| 52 | − 'pages/erlang', | |
| 53 | − 'pages/express', | |
| 54 | − 'pages/git', | |
| 55 | − 'pages/github', | |
| 56 | − 'pages/go', | |
| 57 | − 'pages/haskell', | |
| 58 | − 'pages/jekyll', | |
| 59 | − 'pages/jquery', | |
| 60 | − 'pages/julia', | |
| 61 | − 'pages/knockout', | |
| 62 | − 'pages/kotlin', | |
| 63 | − 'pages/laravel', | |
| 64 | − 'pages/liquid', | |
| 65 | − 'pages/love', | |
| 66 | − 'pages/lua', | |
| 67 | − 'pages/mariadb', | |
| 68 | − 'pages/mdn', | |
| 69 | − 'pages/meteor', | |
| 70 | − 'pages/modernizr', | |
| 71 | − 'pages/moment', | |
| 72 | − 'pages/nginx', | |
| 73 | − 'pages/node', | |
| 74 | − 'pages/npm', | |
| 75 | − 'pages/openjdk', | |
| 76 | − 'pages/perl', | |
| 77 | − 'pages/phalcon', | |
| 78 | − 'pages/phaser', | |
| 79 | − 'pages/php', | |
| 80 | − 'pages/phpunit', | |
| 81 | − 'pages/postgres', | |
| 82 | − 'pages/pug', | |
| 83 | − 'pages/python', | |
| 84 | − 'pages/ramda', | |
| 85 | − 'pages/rdoc', | |
| 86 | − 'pages/react_native', | |
| 87 | − 'pages/redis', | |
| 88 | − 'pages/rethinkdb', | |
| 89 | − 'pages/rfc', | |
| 90 | − 'pages/rubydoc', | |
| 91 | − 'pages/rust', | |
| 92 | − 'pages/sinon', | |
| 93 | − 'pages/socketio', | |
| 94 | − 'pages/sphinx', | |
| 95 | − 'pages/sphinx_simple', | |
| 96 | − 'pages/sqlite', | |
| 97 | − 'pages/support_tables', | |
| 98 | − 'pages/tcl_tk', | |
| 99 | − 'pages/tensorflow', | |
| 100 | − 'pages/terraform', | |
| 101 | − 'pages/underscore', | |
| 102 | − 'pages/vue', | |
| 103 | − 'pages/webpack', | |
| 104 | − 'pages/yard', | |
| 105 | − 'pages/yii'; | |
| @@ -11,7 +11,9 @@ · 10 unmodified lines | ||
| 11 | 11 | * http://mozilla.org/MPL/2.0/ |
| 12 | 12 | */ |
| 13 | 13 | |
| 14 | −@import 'global/variables', | |
| 14 | +@import 'global/variables-light', | |
| 15 | + 'global/variables-dark', | |
| 16 | + 'global/variables', | |
| 15 | 17 | 'global/mixins', |
| 16 | 18 | 'global/icons', |
| 17 | 19 | 'global/classes', |
| @@ -35,6 +37,7 @@ · 17 unmodified lines | ||
| 35 | 37 | 'pages/angularjs', |
| 36 | 38 | 'pages/apache', |
| 37 | 39 | 'pages/async', |
| 40 | + 'pages/bash', | |
| 38 | 41 | 'pages/bootstrap', |
| 39 | 42 | 'pages/c', |
| 40 | 43 | 'pages/cakephp', |
| @@ -45,6 +48,7 @@ · 4 unmodified lines | ||
| 45 | 48 | 'pages/crystal', |
| 46 | 49 | 'pages/d', |
| 47 | 50 | 'pages/d3', |
| 51 | + 'pages/dart', | |
| 48 | 52 | 'pages/dojo', |
| 49 | 53 | 'pages/drupal', |
| 50 | 54 | 'pages/elixir', |
| @@ -54,6 +58,7 @@ · 3 unmodified lines | ||
| 54 | 58 | 'pages/git', |
| 55 | 59 | 'pages/github', |
| 56 | 60 | 'pages/go', |
| 61 | + 'pages/graphite', | |
| 57 | 62 | 'pages/haskell', |
| 58 | 63 | 'pages/jekyll', |
| 59 | 64 | 'pages/jquery', |
| @@ -81,6 +86,7 @@ · 21 unmodified lines | ||
| 81 | 86 | 'pages/postgres', |
| 82 | 87 | 'pages/pug', |
| 83 | 88 | 'pages/python', |
| 89 | + 'pages/qt', | |
| 84 | 90 | 'pages/ramda', |
| 85 | 91 | 'pages/rdoc', |
| 86 | 92 | 'pages/react_native', |
| @@ -1,6 +1,6 @@ | ||
| 1 | −html._booting { background: $contentBackground; } | |
| 1 | +html._booting { background: var(--contentBackground); } | |
| 2 | 2 | body._max-width { background: none; } |
| 3 | −html._booting body._max-width { background: $documentBackground; } | |
| 3 | +html._booting body._max-width { background: var(--documentBackground); } | |
| 4 | 4 | |
| 5 | 5 | ._app { |
| 6 | 6 | position: relative; |
| @@ -15,8 +15,8 @@ html._booting body._max-width { background: $documentBackground; } · 8 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | ._max-width & { |
| 17 | 17 | margin: 0 auto; |
| 18 | − max-width: $maxWidth; | |
| 19 | − background: $contentBackground; | |
| 20 | − box-shadow: 1px 0 $headerBorder, -1px 0 $headerBorder; | |
| 18 | + max-width: var(--maxWidth); | |
| 19 | + background: var(--contentBackground); | |
| 20 | + box-shadow: 1px 0 var(--headerBorder), -1px 0 var(--headerBorder); | |
| 21 | 21 | } |
| 22 | 22 | } |
| @@ -4,13 +4,13 @@ · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | ._container { |
| 6 | 6 | position: relative; |
| 7 | − z-index: $contentZ; | |
| 7 | + z-index: var(--contentZ); | |
| 8 | 8 | height: 100%; |
| 9 | − margin-left: $sidebarWidth; | |
| 9 | + margin-left: var(--sidebarWidth); | |
| 10 | 10 | pointer-events: none; |
| 11 | 11 | @extend %border-box; |
| 12 | 12 | |
| 13 | − @media #{$mediumScreen} { margin-left: $sidebarMediumWidth; } | |
| 13 | + @include mobile { margin-left: var(--sidebarMediumWidth); } | |
| 14 | 14 | |
| 15 | 15 | ._sidebar-hidden & { margin-left: 0; } |
| 16 | 16 | body:not(._native-scrollbars) & { -webkit-margin-end: -1px; } |
| @@ -30,7 +30,7 @@ · 13 unmodified lines | ||
| 30 | 30 | ._sidebar-hidden &:before { |
| 31 | 31 | content: ''; |
| 32 | 32 | display: block; |
| 33 | − margin-top: $headerHeight; | |
| 33 | + margin-top: var(--headerHeight); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | ._overlay-scrollbars & { padding-left: .625rem; } |
| @@ -54,7 +54,7 @@ · 17 unmodified lines | ||
| 54 | 54 | font-size: 4rem; |
| 55 | 55 | font-weight: 300; |
| 56 | 56 | letter-spacing: -.125rem; |
| 57 | − color: $loadingText; | |
| 57 | + color: var(--loadingText); | |
| 58 | 58 | text-align: center; |
| 59 | 59 | cursor: default; |
| 60 | 60 | } |
| @@ -68,7 +68,7 @@ · 7 unmodified lines | ||
| 68 | 68 | // |
| 69 | 69 | |
| 70 | 70 | ._splash-title { |
| 71 | − color: $splashText; | |
| 71 | + color: var(--splashText); | |
| 72 | 72 | @extend %loading, %user-select-none; |
| 73 | 73 | } |
| 74 | 74 | |
| @@ -88,7 +88,7 @@ · 13 unmodified lines | ||
| 88 | 88 | min-height: calc(100vh - 2.375rem); |
| 89 | 89 | |
| 90 | 90 | ._sidebar-hidden & { |
| 91 | − min-height: calc(100vh - 2.375rem - #{$headerHeight}); | |
| 91 | + min-height: calc(100vh - 2.375rem - var(--headerHeight)); | |
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | |
| @@ -140,12 +140,12 @@ · 45 unmodified lines | ||
| 140 | 140 | |
| 141 | 141 | ._error-text { |
| 142 | 142 | margin: 0 0 1rem; |
| 143 | − color: $textColorLight; | |
| 143 | + color: var(--textColorLight); | |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | ._error-links { |
| 147 | 147 | font-size: 1rem; |
| 148 | − font-weight: $boldFontWeight; | |
| 148 | + font-weight: var(--boldFontWeight); | |
| 149 | 149 | } |
| 150 | 150 | |
| 151 | 151 | ._error-link { padding: 0 .5rem; } |
| @@ -167,7 +167,7 @@ · 15 unmodified lines | ||
| 167 | 167 | height: 1px; |
| 168 | 168 | margin-top: .25rem; |
| 169 | 169 | margin-left: 1rem; |
| 170 | − background: $boxBorderLight; | |
| 170 | + background: var(--boxBorderLight); | |
| 171 | 171 | } |
| 172 | 172 | } |
| 173 | 173 | |
| @@ -197,7 +197,7 @@ · 23 unmodified lines | ||
| 197 | 197 | ._toc-title { |
| 198 | 198 | margin: 0 0 .5rem; |
| 199 | 199 | font-size: inherit; |
| 200 | − font-weight: $boldFontWeight; | |
| 200 | + font-weight: var(--boldFontWeight); | |
| 201 | 201 | } |
| 202 | 202 | |
| 203 | 203 | ._toc-list { |
| @@ -252,7 +252,7 @@ · 48 unmodified lines | ||
| 252 | 252 | ._docs-size { |
| 253 | 253 | text-align: right; |
| 254 | 254 | |
| 255 | − > small { color: $textColorLight; } | |
| 255 | + > small { color: var(--textColorLight); } | |
| 256 | 256 | } |
| 257 | 257 | |
| 258 | 258 | ._docs-tools { |
| @@ -285,7 +285,7 @@ · 26 unmodified lines | ||
| 285 | 285 | padding: 0 .75rem; |
| 286 | 286 | } |
| 287 | 287 | ._btn-link:not(._show) { display: none; } |
| 288 | − ._btn-link._show ~ ._btn-link._show { border-left: 1px solid $boxBorder; } | |
| 288 | + ._btn-link._show ~ ._btn-link._show { border-left: 1px solid var(--boxBorder); } | |
| 289 | 289 | } |
| 290 | 290 | |
| 291 | 291 | // |
| @@ -297,7 +297,7 @@ · 5 unmodified lines | ||
| 297 | 297 | position: relative; |
| 298 | 298 | padding-left: 10em; |
| 299 | 299 | font-size: .8125rem; |
| 300 | − color: $textColorLight; | |
| 300 | + color: var(--textColorLight); | |
| 301 | 301 | |
| 302 | 302 | + ._news-row { margin-top: 1em; } |
| 303 | 303 | } |
| @@ -305,7 +305,7 @@ · 1 unmodified line | ||
| 305 | 305 | ._news-title { |
| 306 | 306 | display: block; |
| 307 | 307 | font-size: .875rem; |
| 308 | − color: $textColor; | |
| 308 | + color: var(--textColor); | |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | 311 | ._news-date { |
| @@ -372,12 +372,12 @@ · 60 unmodified lines | ||
| 372 | 372 | // Utilities |
| 373 | 373 | // |
| 374 | 374 | |
| 375 | −._bold { font-weight: $boldFontWeight; } | |
| 375 | +._bold { font-weight: var(--boldFontWeight); } | |
| 376 | 376 | ._note { @extend %note; } |
| 377 | 377 | ._note-green { @extend %note-green; } |
| 378 | 378 | ._label { @extend %label; } |
| 379 | 379 | ._code { @extend %code; } |
| 380 | −._highlight { background: $highlightBackground !important; } | |
| 380 | +._highlight { background: var(--highlightBackground) !important; } | |
| 381 | 381 | |
| 382 | 382 | ._table { width: 100%; } |
| 383 | 383 | ._mobile ._table { overflow-x: auto; } |
| @@ -396,12 +396,9 @@ · 12 unmodified lines | ||
| 396 | 396 | pre:hover > & { display: block; } |
| 397 | 397 | &:hover { opacity: 1; } |
| 398 | 398 | |
| 399 | − > svg { @extend %svg-icon; } | |
| 400 | − | |
| 401 | − @if $style == 'dark' { | |
| 402 | − > svg { fill: white; } | |
| 403 | − } @else { | |
| 404 | − > svg { fill: black; } | |
| 399 | + > svg { | |
| 400 | + @extend %svg-icon; | |
| 401 | + fill: var(--absolute); | |
| 405 | 402 | } |
| 406 | 403 | |
| 407 | 404 | &._pre-clip-success > svg, |
| @@ -419,15 +416,13 @@ · 11 unmodified lines | ||
| 419 | 416 | line-height: normal; |
| 420 | 417 | white-space: nowrap; |
| 421 | 418 | padding: .375rem .675rem; |
| 422 | − background-image: linear-gradient(lighten($boxBackground, 4%), darken($boxBackground, 2%)); | |
| 423 | − border: 1px solid $boxBorder; | |
| 419 | + background-color: var(--boxBackground); | |
| 420 | + border: 1px solid var(--boxBorder); | |
| 424 | 421 | border-radius: 3px; |
| 425 | − box-shadow: 0 1px rgba($boxBorder, .08); | |
| 426 | 422 | cursor: pointer; |
| 427 | 423 | |
| 428 | 424 | &:active { |
| 429 | − background-color: $boxBackground; | |
| 430 | − box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px $boxBorder; | |
| 425 | + box-shadow: inset 0 1px 1px rgba(black, .05), inset 0 1px 4px var(--boxBorder); | |
| 431 | 426 | } |
| 432 | 427 | } |
| 433 | 428 | |
| @@ -447,18 +442,18 @@ · 13 unmodified lines | ||
| 447 | 442 | |
| 448 | 443 | ._btn-link { |
| 449 | 444 | line-height: inherit; |
| 450 | − color: $linkColor; | |
| 451 | − text-decoration: $linkTextDecoration; | |
| 445 | + color: var(--linkColor); | |
| 446 | + text-decoration: var(--linkTextDecoration); | |
| 452 | 447 | |
| 453 | 448 | &:hover { |
| 454 | − color: $linkColorHover; | |
| 449 | + color: var(--linkColorHover); | |
| 455 | 450 | text-decoration: underline; |
| 456 | 451 | } |
| 457 | 452 | } |
| 458 | 453 | |
| 459 | 454 | ._reset-btn, |
| 460 | 455 | ._reset-btn:hover { |
| 461 | − color: $textColorRed; | |
| 456 | + color: var(--textColorRed); | |
| 462 | 457 | } |
| 463 | 458 | |
| 464 | 459 | ._github-btn { |
| @@ -1,4 +1,4 @@ | ||
| 1 | −._fail { | |
| 1 | +._fail { // Don't use CSS variables, in case the browser doesn't support them. | |
| 2 | 2 | display: block; |
| 3 | 3 | position: relative; |
| 4 | 4 | top: 1.5rem; |
| @@ -23,7 +23,7 @@ · 18 unmodified lines | ||
| 23 | 23 | ._fail-title { |
| 24 | 24 | margin: 0 0 1rem; |
| 25 | 25 | font-size: 1rem; |
| 26 | − font-weight: $boldFontWeight; | |
| 26 | + font-weight: bold; | |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | ._fail-text, ._fail-list { |
| @@ -4,20 +4,20 @@ · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | ._header { |
| 6 | 6 | position: absolute; |
| 7 | − z-index: $headerZ; | |
| 7 | + z-index: var(--headerZ); | |
| 8 | 8 | top: 0; |
| 9 | 9 | left: 0; |
| 10 | 10 | display: -ms-flexbox; |
| 11 | 11 | display: flex; |
| 12 | − width: $sidebarWidth; | |
| 13 | − height: $headerHeight; | |
| 14 | − background: $headerBackground; | |
| 15 | − border-bottom: 1px solid $headerBorder; | |
| 16 | − border-right: 1px solid $headerBorder; | |
| 12 | + width: var(--sidebarWidth); | |
| 13 | + height: var(--headerHeight); | |
| 14 | + background: var(--headerBackground); | |
| 15 | + border-bottom: 1px solid var(--headerBorder); | |
| 16 | + border-right: 1px solid var(--headerBorder); | |
| 17 | 17 | @extend %border-box; |
| 18 | 18 | @extend %user-select-none; |
| 19 | 19 | |
| 20 | − @media #{$mediumScreen} { width: $sidebarMediumWidth; } | |
| 20 | + @include mobile { width: var(--sidebarMediumWidth); } | |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | 23 | ._header-left { |
| @@ -35,7 +35,7 @@ · 11 unmodified lines | ||
| 35 | 35 | flex: 0 0 auto; |
| 36 | 36 | width: 2.25rem; |
| 37 | 37 | height: 100%; |
| 38 | − color: $textColorLight; | |
| 38 | + color: var(--textColorLight); | |
| 39 | 39 | text-align: center; |
| 40 | 40 | |
| 41 | 41 | &[hidden] { display: none; } |
| @@ -67,8 +67,8 @@ · 25 unmodified lines | ||
| 67 | 67 | word-wrap: normal; |
| 68 | 68 | overflow-wrap: normal; |
| 69 | 69 | font-size: .875rem; |
| 70 | − background: $contentBackground; | |
| 71 | − border: 1px solid $headerBorder; | |
| 70 | + background: var(--contentBackground); | |
| 71 | + border: 1px solid var(--headerBorder); | |
| 72 | 72 | border-radius: 3px; |
| 73 | 73 | box-shadow: -1px 1px 1px rgba(black, .05); |
| 74 | 74 | transition: all 0ms cubic-bezier(0.23, 1, 0.32, 1) 1ms; |
| @@ -98,10 +98,10 @@ · 23 unmodified lines | ||
| 98 | 98 | margin: 0; |
| 99 | 99 | line-height: 1.5rem; |
| 100 | 100 | font-size: 1rem; |
| 101 | − font-weight: $boldFontWeight; | |
| 101 | + font-weight: var(--boldFontWeight); | |
| 102 | 102 | letter-spacing: -.5px; |
| 103 | − background: $sidebarBackground; | |
| 104 | − border-bottom: 1px solid $sidebarBorder; | |
| 103 | + background: var(--sidebarBackground); | |
| 104 | + border-bottom: 1px solid var(--sidebarBorder); | |
| 105 | 105 | border-radius: 2px 2px 0 0; |
| 106 | 106 | } |
| 107 | 107 | |
| @@ -109,7 +109,7 @@ · 1 unmodified line | ||
| 109 | 109 | ._menu-title-link:hover { |
| 110 | 110 | display: block; |
| 111 | 111 | padding: .5rem 1rem; |
| 112 | − color: $focusText; | |
| 112 | + color: var(--focusText); | |
| 113 | 113 | text-decoration: none; |
| 114 | 114 | } |
| 115 | 115 | |
| @@ -121,9 +121,9 @@ · 5 unmodified lines | ||
| 121 | 121 | text-decoration: none; |
| 122 | 122 | |
| 123 | 123 | &:hover { |
| 124 | − color: $focusText; | |
| 124 | + color: var(--focusText); | |
| 125 | 125 | text-decoration: none; |
| 126 | − background: $sidebarBackground; | |
| 126 | + background: var(--sidebarBackground); | |
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | &:last-child { border-radius: 0 0 2px 2px; } |
| @@ -151,11 +151,7 @@ · 21 unmodified lines | ||
| 151 | 151 | opacity: .42; |
| 152 | 152 | @extend %svg-icon; |
| 153 | 153 | |
| 154 | − @if $style == 'dark' { | |
| 155 | − fill: white; | |
| 156 | − } @else { | |
| 157 | − fill: black; | |
| 158 | − } | |
| 154 | + fill: var(--absolute); | |
| 159 | 155 | } |
| 160 | 156 | } |
| 161 | 157 | |
| @@ -166,21 +162,19 @@ · 4 unmodified lines | ||
| 166 | 162 | height: 100%; |
| 167 | 163 | padding: 0 .75rem 1px 1.75rem; |
| 168 | 164 | font-size: .875rem; |
| 169 | − background: $contentBackground; | |
| 165 | + background: var(--contentBackground); | |
| 170 | 166 | border: 1px solid; |
| 171 | − border-color: darken($headerBorder, 2%); | |
| 167 | + border-color: var(--searchBorder); | |
| 172 | 168 | border-radius: 3px; |
| 173 | 169 | |
| 174 | 170 | &:focus { |
| 175 | 171 | outline: 0; |
| 176 | − @if $inputFocusBorder { | |
| 177 | − border-color: $inputFocusBorder; | |
| 178 | − box-shadow: 0 0 1px $inputFocusBorder; | |
| 179 | − } | |
| 172 | + border-color: var(--inputFocusBorder); | |
| 173 | + box-shadow: 0 0 1px var(--inputFocusBorder); | |
| 180 | 174 | } |
| 181 | 175 | |
| 182 | 176 | &[disabled] { |
| 183 | − background: $sidebarBackground; | |
| 177 | + background: var(--sidebarBackground); | |
| 184 | 178 | cursor: not-allowed; |
| 185 | 179 | } |
| 186 | 180 | } |
| @@ -202,13 +196,9 @@ · 15 unmodified lines | ||
| 202 | 196 | top: .5rem; |
| 203 | 197 | left: .375rem; |
| 204 | 198 | @extend %svg-icon; |
| 199 | + fill: var(--absolute); | |
| 205 | 200 | } |
| 206 | 201 | |
| 207 | − @if $style == 'dark' { | |
| 208 | − > svg { fill: white; } | |
| 209 | − } @else { | |
| 210 | − > svg { fill: black; } | |
| 211 | − } | |
| 212 | 202 | ._search-active > & { display: block; } |
| 213 | 203 | } |
| 214 | 204 | |
| @@ -222,8 +212,8 @@ · 7 unmodified lines | ||
| 222 | 212 | line-height: 1.25rem; |
| 223 | 213 | max-width: 50%; |
| 224 | 214 | font-size: .8125rem; |
| 225 | − color: $textColorLight; | |
| 226 | − background: darken($headerBackground, 5%); | |
| 215 | + color: var(--textColorLight); | |
| 216 | + background: var(--searchTagBackground); | |
| 227 | 217 | border-radius: 2px; |
| 228 | 218 | @extend %truncate-text; |
| 229 | 219 | } |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | ._mobile { |
| 6 | 6 | font-size: 100%; |
| 7 | − background: $contentBackground; | |
| 7 | + background: var(--contentBackground); | |
| 8 | 8 | |
| 9 | 9 | ._hide-on-mobile { display: none; } |
| 10 | 10 | |
| @@ -18,7 +18,7 @@ · 7 unmodified lines | ||
| 18 | 18 | |
| 19 | 19 | ._container { |
| 20 | 20 | margin: 0; |
| 21 | − padding-top: $headerHeight; | |
| 21 | + padding-top: var(--headerHeight); | |
| 22 | 22 | } |
| 23 | 23 | |
| 24 | 24 | ._content { |
| @@ -1,15 +1,15 @@ | ||
| 1 | 1 | ._notice { |
| 2 | 2 | position: absolute; |
| 3 | − z-index: $noticeZ; | |
| 3 | + z-index: var(--noticeZ); | |
| 4 | 4 | bottom: 0; |
| 5 | − left: $sidebarWidth; | |
| 5 | + left: var(--sidebarWidth); | |
| 6 | 6 | right: 0; |
| 7 | 7 | height: 2.5rem; |
| 8 | 8 | padding: 0 1.25rem; |
| 9 | − background: $noticeBackground; | |
| 10 | − box-shadow: inset 0 1px $noticeBorder; | |
| 9 | + background: var(--noticeBackground); | |
| 10 | + box-shadow: inset 0 1px var(--noticeBorder); | |
| 11 | 11 | |
| 12 | − @media #{$mediumScreen} { left: $sidebarMediumWidth; } | |
| 12 | + @include mobile { left: var(--sidebarMediumWidth); } | |
| 13 | 13 | |
| 14 | 14 | ._sidebar-hidden & { left: 0; } |
| 15 | 15 | |
| @@ -7,9 +7,9 @@ · 6 unmodified lines | ||
| 7 | 7 | max-width: 90%; |
| 8 | 8 | padding: .625rem 1rem; |
| 9 | 9 | font-size: .75rem; |
| 10 | − color: $notifColor; | |
| 11 | − background: $notifBackground; | |
| 12 | − border: $notifBorder; | |
| 10 | + color: var(--notifColor); | |
| 11 | + background: var(--notifBackground); | |
| 12 | + border: var(--notifBorder); | |
| 13 | 13 | border-radius: .25rem; |
| 14 | 14 | transition: opacity .2s; |
| 15 | 15 | opacity: 0; |
| @@ -30,7 +30,7 @@ · 14 unmodified lines | ||
| 30 | 30 | |
| 31 | 31 | ._notif-info { |
| 32 | 32 | float: right; |
| 33 | − color: $notifColorLight; | |
| 33 | + color: var(--notifColorLight); | |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | 36 | ._notif-link, |
| @@ -69,13 +69,13 @@ · 32 unmodified lines | ||
| 69 | 69 | &::-webkit-scrollbar { width: 10px !important; } |
| 70 | 70 | |
| 71 | 71 | &::-webkit-scrollbar-track { |
| 72 | − background: $notifBackground !important; | |
| 72 | + background: var(--notifBackground) !important; | |
| 73 | 73 | border: 0 !important; |
| 74 | 74 | border-radius: 5px !important; |
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | &::-webkit-scrollbar-thumb { |
| 78 | − border: 3px solid $notifBackground !important; | |
| 78 | + border: 3px solid var(--notifBackground) !important; | |
| 79 | 79 | |
| 80 | 80 | &:hover, &:active { border-width: 2px !important; } |
| 81 | 81 | } |
| @@ -90,7 +90,7 @@ · 8 unmodified lines | ||
| 90 | 90 | > ._news-row { |
| 91 | 91 | line-height: 1.125rem; |
| 92 | 92 | font-size: .6875rem; |
| 93 | − color: $notifColorLight; | |
| 93 | + color: var(--notifColorLight); | |
| 94 | 94 | margin-bottom: .25rem; |
| 95 | 95 | |
| 96 | 96 | + ._news-row { margin-top: .625rem; } |
| @@ -107,7 +107,7 @@ · 10 unmodified lines | ||
| 107 | 107 | ._news-date { |
| 108 | 108 | float: right; |
| 109 | 109 | margin-left: 1rem; |
| 110 | − font-weight: $boldFontWeight; | |
| 110 | + font-weight: var(--boldFontWeight); | |
| 111 | 111 | } |
| 112 | 112 | |
| 113 | 113 | code { |
| @@ -128,9 +128,9 @@ · 14 unmodified lines | ||
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | ._notif-tip { |
| 131 | − color: $textColor; | |
| 132 | − background: $tipBackground; | |
| 133 | − border: $tipBorder; | |
| 131 | + color: var(--textColor); | |
| 132 | + background: var(--tipBackground); | |
| 133 | + border: var(--tipBorder); | |
| 134 | 134 | |
| 135 | − ._notif-info { color: $textColorLight; } | |
| 135 | + ._notif-info { color: var(--textColorLight); } | |
| 136 | 136 | } |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | max-width: 100%; |
| 24 | 24 | margin-bottom: 1em; |
| 25 | 25 | padding: 1px; |
| 26 | − border: 1px dotted $boxBorder; | |
| 26 | + border: 1px dotted var(--boxBorder); | |
| 27 | 27 | border-radius: 3px; |
| 28 | 28 | @extend %border-box; |
| 29 | 29 | } |
| @@ -50,7 +50,7 @@ · 20 unmodified lines | ||
| 50 | 50 | display: inline-block; |
| 51 | 51 | vertical-align: top; |
| 52 | 52 | padding: 0 .5rem; |
| 53 | − background: $contentBackground; | |
| 53 | + background: var(--contentBackground); | |
| 54 | 54 | @extend %internal-link; |
| 55 | 55 | |
| 56 | 56 | & + & { margin-left: .75rem; } |
| @@ -66,7 +66,7 @@ · 9 unmodified lines | ||
| 66 | 66 | clear: both; |
| 67 | 67 | margin: 2rem 0 1.5rem; |
| 68 | 68 | font-size: .75rem; |
| 69 | − color: $textColorLight; | |
| 69 | + color: var(--textColorLight); | |
| 70 | 70 | text-align: center; |
| 71 | 71 | -webkit-font-smoothing: subpixel-antialiased; |
| 72 | 72 | |
| @@ -78,7 +78,7 @@ · 5 unmodified lines | ||
| 78 | 78 | display: inline-block; |
| 79 | 79 | margin: 0; |
| 80 | 80 | padding: .25rem .75rem; |
| 81 | − background: $labelBackground; | |
| 81 | + background: var(--labelBackground); | |
| 82 | 82 | border-radius: 3px; |
| 83 | 83 | } |
| 84 | 84 | |
| @@ -1,17 +1,17 @@ | ||
| 1 | 1 | ._path { |
| 2 | 2 | position: absolute; |
| 3 | − z-index: $noticeZ - 1; | |
| 3 | + z-index: var(--headerZ); | |
| 4 | 4 | bottom: 0; |
| 5 | − left: $sidebarWidth; | |
| 5 | + left: var(--sidebarWidth); | |
| 6 | 6 | right: 0; |
| 7 | 7 | height: 2rem; |
| 8 | 8 | line-height: 2rem; |
| 9 | 9 | padding: 0 .375rem; |
| 10 | 10 | font-size: .875rem; |
| 11 | − background: $pathBackground; | |
| 12 | − box-shadow: inset 0 1px $pathBorder; | |
| 11 | + background: var(--pathBackground); | |
| 12 | + box-shadow: inset 0 1px var(--pathBorder); | |
| 13 | 13 | |
| 14 | − @media #{$mediumScreen} { left: $sidebarMediumWidth; } | |
| 14 | + @include mobile { left: var(--sidebarMediumWidth); } | |
| 15 | 15 | |
| 16 | 16 | ._sidebar-hidden & { left: 0; } |
| 17 | 17 | |
| @@ -24,7 +24,7 @@ · 6 unmodified lines | ||
| 24 | 24 | display: inline-block; |
| 25 | 25 | vertical-align: top; |
| 26 | 26 | padding: 0 .375rem; |
| 27 | − color: $textColor; | |
| 27 | + color: var(--textColor); | |
| 28 | 28 | text-decoration: none; |
| 29 | 29 | |
| 30 | 30 | &:first-child:before { |
| @@ -1,9 +1,26 @@ | ||
| 1 | +html { | |
| 2 | + --prismValue: #905; | |
| 3 | + --prismText: #5e8e01; | |
| 4 | + --prismOperator: #a67f59; | |
| 5 | + --prismKeyword: #0070a3; | |
| 6 | + --prismFunction: #dd4a68; | |
| 7 | + --prismVariable: #e90; | |
| 8 | +} | |
| 9 | +html._theme-dark { | |
| 10 | + --prismValue: #eb8160; | |
| 11 | + --prismText: #ddcf88; | |
| 12 | + --prismOperator: #b1c676; | |
| 13 | + --prismKeyword: #91b3ed; | |
| 14 | + --prismFunction: #c79e6b; | |
| 15 | + --prismVariable: #e9c062; | |
| 16 | +} | |
| 17 | + | |
| 1 | 18 | .token.comment, |
| 2 | 19 | .token.prolog, |
| 3 | 20 | .token.doctype, |
| 4 | 21 | .token.cdata, |
| 5 | 22 | .token.punctuation { |
| 6 | − color: $textColorLight; | |
| 23 | + color: var(--textColorLight); | |
| 7 | 24 | } |
| 8 | 25 | |
| 9 | 26 | .namespace { |
| @@ -17,11 +34,7 @@ · 7 unmodified lines | ||
| 17 | 34 | .token.constant, |
| 18 | 35 | .token.symbol, |
| 19 | 36 | .token.deleted { |
| 20 | − @if $style == 'dark' { | |
| 21 | − color: #eb8160; | |
| 22 | − } @else { | |
| 23 | − color: #905; | |
| 24 | − } | |
| 37 | + color: var(--prismValue); | |
| 25 | 38 | } |
| 26 | 39 | |
| 27 | 40 | .token.selector, |
| @@ -30,11 +43,7 @@ · 2 unmodified lines | ||
| 30 | 43 | .token.char, |
| 31 | 44 | .token.builtin, |
| 32 | 45 | .token.inserted { |
| 33 | − @if $style == 'dark' { | |
| 34 | − color: #ddcf88; | |
| 35 | − } @else { | |
| 36 | − color: #5e8e01; | |
| 37 | − } | |
| 46 | + color: var(--prismText); | |
| 38 | 47 | } |
| 39 | 48 | |
| 40 | 49 | .token.operator, |
| @@ -42,44 +51,28 @@ · 1 unmodified line | ||
| 42 | 51 | .token.url, |
| 43 | 52 | .language-css .token.string, |
| 44 | 53 | .style .token.string { |
| 45 | − @if $style == 'dark' { | |
| 46 | − color: #b1c676; | |
| 47 | − } @else { | |
| 48 | − color: #a67f59; | |
| 49 | − } | |
| 54 | + color: var(--prismOperator); | |
| 50 | 55 | } |
| 51 | 56 | |
| 52 | 57 | .token.atrule, |
| 53 | 58 | .token.attr-value, |
| 54 | 59 | .token.keyword { |
| 55 | − @if $style == 'dark' { | |
| 56 | − color: #91b3ed; | |
| 57 | − } @else { | |
| 58 | − color: #0070a3; | |
| 59 | − } | |
| 60 | + color: var(--prismKeyword); | |
| 60 | 61 | } |
| 61 | 62 | |
| 62 | 63 | .token.function { |
| 63 | − @if $style == 'dark' { | |
| 64 | − color: #c79e6b; | |
| 65 | − } @else { | |
| 66 | − color: #dd4a68; | |
| 67 | − } | |
| 64 | + color: var(--prismFunction); | |
| 68 | 65 | } |
| 69 | 66 | |
| 70 | 67 | .token.regex, |
| 71 | 68 | .token.important, |
| 72 | 69 | .token.variable { |
| 73 | − @if $style == 'dark' { | |
| 74 | − color: #e9c062; | |
| 75 | − } @else { | |
| 76 | − color: #e90; | |
| 77 | − } | |
| 70 | + color: var(--prismVariable); | |
| 78 | 71 | } |
| 79 | 72 | |
| 80 | 73 | .token.important, |
| 81 | 74 | .token.bold { |
| 82 | − font-weight: $boldFontWeight; | |
| 75 | + font-weight: var(--boldFontWeight); | |
| 83 | 76 | } |
| 84 | 77 | |
| 85 | 78 | .token.italic { |
| @@ -7,15 +7,15 @@ · 6 unmodified lines | ||
| 7 | 7 | position: absolute; |
| 8 | 8 | top: 0; |
| 9 | 9 | bottom: 0; |
| 10 | − z-index: $headerZ; | |
| 10 | + z-index: var(--headerZ); | |
| 11 | 11 | |
| 12 | 12 | &._in { display: block; } |
| 13 | 13 | |
| 14 | 14 | > ._header { justify-content: space-between; } |
| 15 | 15 | |
| 16 | 16 | &._dirty > ._header { |
| 17 | − background: $noteGreenBackground; | |
| 18 | − border-color: $noteGreenBorder; | |
| 17 | + background: var(--noteGreenBackground); | |
| 18 | + border-color: var(--noteGreenBorder); | |
| 19 | 19 | } |
| 20 | 20 | } |
| 21 | 21 | |
| @@ -37,7 +37,7 @@ · 15 unmodified lines | ||
| 37 | 37 | padding-right: .5rem; |
| 38 | 38 | line-height: inherit; |
| 39 | 39 | font-size: inherit; |
| 40 | − font-weight: $boldFontWeight; | |
| 40 | + font-weight: var(--boldFontWeight); | |
| 41 | 41 | text-align: right; |
| 42 | 42 | @extend %border-box; |
| 43 | 43 | } |
| @@ -52,7 +52,7 @@ · 8 unmodified lines | ||
| 52 | 52 | |
| 53 | 53 | > small { |
| 54 | 54 | display: block; |
| 55 | − color: $textColorLight; | |
| 55 | + color: var(--textColorLight); | |
| 56 | 56 | margin-left: 1.75rem; |
| 57 | 57 | } |
| 58 | 58 | |
| @@ -62,7 +62,7 @@ · 3 unmodified lines | ||
| 62 | 62 | } |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | −@media (max-width: $maxWidth) { | |
| 65 | +@media (max-width: 80rem) { | |
| 66 | 66 | ._setting-max-width { display: none; } |
| 67 | 67 | } |
| 68 | 68 | |
| @@ -80,7 +80,7 @@ · 11 unmodified lines | ||
| 80 | 80 | line-height: 1.5rem; |
| 81 | 81 | padding: 0 .75rem; |
| 82 | 82 | font-size: .875rem; |
| 83 | − font-weight: $boldFontWeight; | |
| 83 | + font-weight: var(--boldFontWeight); | |
| 84 | 84 | color: inherit; |
| 85 | 85 | text-align: left; |
| 86 | 86 | cursor: pointer; |
| @@ -119,12 +119,12 @@ · 32 unmodified lines | ||
| 119 | 119 | position: relative; |
| 120 | 120 | vertical-align: top; |
| 121 | 121 | padding: 0 .75rem; |
| 122 | − line-height: $headerHeight; | |
| 123 | − color: $textColorLight; | |
| 122 | + line-height: var(--headerHeight); | |
| 123 | + color: var(--textColorLight); | |
| 124 | 124 | |
| 125 | 125 | &.active { |
| 126 | − color: $textColor; | |
| 127 | − font-weight: $boldFontWeight; | |
| 128 | − box-shadow: inset 0 -2px $linkColor; | |
| 126 | + color: var(--textColor); | |
| 127 | + font-weight: var(--boldFontWeight); | |
| 128 | + box-shadow: inset 0 -2px var(--linkColor); | |
| 129 | 129 | } |
| 130 | 130 | } |
| @@ -4,14 +4,14 @@ · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | ._sidebar { |
| 6 | 6 | position: absolute; |
| 7 | − z-index: $sidebarZ; | |
| 7 | + z-index: var(--sidebarZ); | |
| 8 | 8 | top: 0; |
| 9 | 9 | bottom: 0; |
| 10 | 10 | left: 0; |
| 11 | 11 | overflow-x: hidden; |
| 12 | 12 | overflow-y: scroll; |
| 13 | − padding-top: $headerHeight; | |
| 14 | − background: $sidebarBackground; | |
| 13 | + padding-top: var(--headerHeight); | |
| 14 | + background: var(--sidebarBackground); | |
| 15 | 15 | background-clip: content-box; |
| 16 | 16 | -webkit-overflow-scrolling: touch; |
| 17 | 17 | -ms-overflow-style: none; // IE 10 doesn't support pointer-events |
| @@ -22,13 +22,13 @@ · 4 unmodified lines | ||
| 22 | 22 | |
| 23 | 23 | ._overlay-scrollbars & { |
| 24 | 24 | padding-top: 0; |
| 25 | − top: $headerHeight; | |
| 25 | + top: var(--headerHeight); | |
| 26 | 26 | } |
| 27 | 27 | |
| 28 | 28 | body:not(._native-scrollbars) & { |
| 29 | 29 | &::-webkit-scrollbar { width: 10px; } |
| 30 | 30 | &::-webkit-scrollbar-track { |
| 31 | − background: $contentBackground; | |
| 31 | + background: var(--contentBackground); | |
| 32 | 32 | border: 0; |
| 33 | 33 | } |
| 34 | 34 | &::-webkit-scrollbar-thumb { |
| @@ -52,10 +52,10 @@ · 17 unmodified lines | ||
| 52 | 52 | |
| 53 | 53 | ._resizer { |
| 54 | 54 | position: absolute; |
| 55 | − z-index: $sidebarZ + 1; | |
| 56 | − top: $headerHeight; | |
| 57 | − bottom: $headerHeight; | |
| 58 | − left: $sidebarWidth; | |
| 55 | + z-index: var(--headerZ); | |
| 56 | + top: var(--headerHeight); | |
| 57 | + bottom: var(--headerHeight); | |
| 58 | + left: var(--sidebarWidth); | |
| 59 | 59 | margin-left: -2px; |
| 60 | 60 | width: 3px; |
| 61 | 61 | cursor: col-resize; |
| @@ -72,11 +72,11 @@ · 10 unmodified lines | ||
| 72 | 72 | margin: 0; |
| 73 | 73 | padding: 0; |
| 74 | 74 | list-style: none; |
| 75 | − width: $sidebarWidth; | |
| 76 | − box-shadow: inset -1px 0 $sidebarBorder; | |
| 75 | + width: var(--sidebarWidth); | |
| 76 | + box-shadow: inset -1px 0 var(--sidebarBorder); | |
| 77 | 77 | @extend %border-box; |
| 78 | 78 | |
| 79 | − @media #{$mediumScreen} { width: $sidebarMediumWidth; } | |
| 79 | + @include mobile { width: var(--sidebarMediumWidth); } | |
| 80 | 80 | |
| 81 | 81 | ._sidebar > & { min-height: 100%; } |
| 82 | 82 | |
| @@ -89,7 +89,7 @@ · 6 unmodified lines | ||
| 89 | 89 | padding: 0 .75rem 0 2.125rem; |
| 90 | 90 | line-height: 2rem; |
| 91 | 91 | font-size: .75rem; |
| 92 | − color: $textColorLight; | |
| 92 | + color: var(--textColorLight); | |
| 93 | 93 | text-transform: uppercase; |
| 94 | 94 | cursor: default; |
| 95 | 95 | } |
| @@ -110,8 +110,8 @@ · 14 unmodified lines | ||
| 110 | 110 | line-height: 1.5rem; |
| 111 | 111 | font-size: .875rem; |
| 112 | 112 | cursor: default; |
| 113 | − background: $sidebarBackground; | |
| 114 | − box-shadow: inset -1px 0 $sidebarBorder; | |
| 113 | + background: var(--sidebarBackground); | |
| 114 | + box-shadow: inset -1px 0 var(--sidebarBorder); | |
| 115 | 115 | @extend %truncate-text; |
| 116 | 116 | |
| 117 | 117 | &, &:hover { |
| @@ -123,16 +123,16 @@ · 5 unmodified lines | ||
| 123 | 123 | &.focus:hover, |
| 124 | 124 | &.active, |
| 125 | 125 | &.active:hover { |
| 126 | − color: $focusText; | |
| 127 | − background: $focusBackground; | |
| 128 | − box-shadow: inset -1px 0 $focusBorder; | |
| 126 | + color: var(--focusText); | |
| 127 | + background: var(--focusBackground); | |
| 128 | + box-shadow: inset -1px 0 var(--focusBorder); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | &.active, |
| 132 | 132 | &.active:hover { |
| 133 | − color: $selectionText; | |
| 134 | − background: $selectionBackground; | |
| 135 | − box-shadow: inset -1px 0 $selectionBorder; | |
| 133 | + color: var(--selectionText); | |
| 134 | + background: var(--selectionBackground); | |
| 135 | + box-shadow: inset -1px 0 var(--selectionBorder); | |
| 136 | 136 | } |
| 137 | 137 | |
| 138 | 138 | &:before { |
| @@ -160,7 +160,7 @@ · 21 unmodified lines | ||
| 160 | 160 | } |
| 161 | 161 | |
| 162 | 162 | ._list-count { |
| 163 | − color: $textColorLighter; | |
| 163 | + color: var(--textColorLighter); | |
| 164 | 164 | pointer-events: none; |
| 165 | 165 | |
| 166 | 166 | ._list-disabled:hover > & { display: none; } |
| @@ -168,7 +168,7 @@ · 1 unmodified line | ||
| 168 | 168 | |
| 169 | 169 | ._list-enable { |
| 170 | 170 | display: none; |
| 171 | − color: $linkColor; | |
| 171 | + color: var(--linkColor); | |
| 172 | 172 | cursor: pointer; |
| 173 | 173 | |
| 174 | 174 | &:hover { text-decoration: underline; } |
| @@ -188,7 +188,7 @@ · 13 unmodified lines | ||
| 188 | 188 | ._list-disabled { |
| 189 | 189 | @extend %_list-dir; |
| 190 | 190 | |
| 191 | − &, &:hover { color: $textColorLight; } | |
| 191 | + &, &:hover { color: var(--textColorLight); } | |
| 192 | 192 | &:before { opacity: .7; } |
| 193 | 193 | } |
| 194 | 194 | |
| @@ -200,11 +200,9 @@ · 5 unmodified lines | ||
| 200 | 200 | width: 1rem; |
| 201 | 201 | height: 1rem; |
| 202 | 202 | cursor: pointer; |
| 203 | − fill: black; | |
| 203 | + fill: var(--absolute); | |
| 204 | 204 | opacity: .4; |
| 205 | 205 | |
| 206 | − @if $style == 'dark' { fill: white; } | |
| 207 | − | |
| 208 | 206 | &:hover { opacity: .65; } |
| 209 | 207 | |
| 210 | 208 | ._list-rdir > & { |
| @@ -239,11 +237,11 @@ · 28 unmodified lines | ||
| 239 | 237 | // |
| 240 | 238 | |
| 241 | 239 | ._list-pagelink { |
| 242 | − color: $linkColor; | |
| 240 | + color: var(--linkColor); | |
| 243 | 241 | cursor: pointer; |
| 244 | 242 | |
| 245 | 243 | &:hover { |
| 246 | − color: $linkColorHover; | |
| 244 | + color: var(--linkColorHover); | |
| 247 | 245 | text-decoration: underline; |
| 248 | 246 | } |
| 249 | 247 | } |
| @@ -275,9 +273,9 @@ · 25 unmodified lines | ||
| 275 | 273 | left: .75rem; |
| 276 | 274 | width: .75rem; |
| 277 | 275 | height: 1px; |
| 278 | − background: rgba($selectionText, .9); | |
| 279 | − box-shadow: 0 -3px rgba($selectionText, .9), // top line | |
| 280 | − 0 3px rgba($selectionText, .9); // bottom line | |
| 276 | + background: var(--transparentSelectionText); | |
| 277 | + box-shadow: 0 -3px var(--transparentSelectionText), // top line | |
| 278 | + 0 3px var(--transparentSelectionText); // bottom line | |
| 281 | 279 | } |
| 282 | 280 | } |
| 283 | 281 | |
| @@ -289,7 +287,7 @@ · 5 unmodified lines | ||
| 289 | 287 | padding: .5rem .75rem; |
| 290 | 288 | line-height: 1.25rem; |
| 291 | 289 | font-size: .8125rem; |
| 292 | − color: $textColorLight; | |
| 290 | + color: var(--textColorLight); | |
| 293 | 291 | |
| 294 | 292 | & + & { padding-top: 0; } |
| 295 | 293 | } |
| @@ -303,9 +301,9 @@ · 7 unmodified lines | ||
| 303 | 301 | ._list-hover.clone { |
| 304 | 302 | position: fixed; |
| 305 | 303 | overflow: visible; |
| 306 | − z-index: $hoverZ; | |
| 304 | + z-index: var(--hoverZ); | |
| 307 | 305 | left: 0; |
| 308 | − min-width: $sidebarWidth; | |
| 306 | + min-width: var(--sidebarWidth); | |
| 309 | 307 | padding: .25rem .75rem; |
| 310 | 308 | pointer-events: none; |
| 311 | 309 | -webkit-font-smoothing: subpixel-antialiased; |
| @@ -313,7 +311,7 @@ · 1 unmodified line | ||
| 313 | 311 | transform: translate3d(0, 0, 0); |
| 314 | 312 | @extend %border-box; |
| 315 | 313 | |
| 316 | − @media #{$mediumScreen} { min-width: $sidebarMediumWidth; } | |
| 314 | + @include mobile { min-width: var(--sidebarMediumWidth); } | |
| 317 | 315 | |
| 318 | 316 | > ._list-text { display: inline; } |
| 319 | 317 | |
| @@ -346,10 +344,10 @@ · 26 unmodified lines | ||
| 346 | 344 | padding: .5rem .75rem .25rem .75rem; |
| 347 | 345 | line-height: 1.5rem; |
| 348 | 346 | font-size: .75rem; |
| 349 | − font-weight: $bolderFontWeight; | |
| 350 | − color: $textColorLight; | |
| 347 | + font-weight: var(--bolderFontWeight); | |
| 348 | + color: var(--textColorLight); | |
| 351 | 349 | text-transform: uppercase; |
| 352 | − background: linear-gradient(to bottom, $sidebarBackground, $sidebarBackground 75%, rgba($sidebarBackground, 0)); | |
| 350 | + background: linear-gradient(to bottom, var(--sidebarBackground), var(--sidebarBackground) 75%, var(--transparentSidebarBackground)); | |
| 353 | 351 | cursor: default; |
| 354 | 352 | } |
| 355 | 353 | |
| @@ -1,9 +1,10 @@ | ||
| 1 | 1 | html { |
| 2 | 2 | height: 100%; |
| 3 | 3 | font-size: 100%; |
| 4 | − background: $documentBackground; | |
| 4 | + background: #fff; // fallback to show the error message to browsers that don't support CSS variables. | |
| 5 | + background: var(--documentBackground); | |
| 5 | 6 | |
| 6 | − @media #{$mediumScreen} { font-size: 93.75%; } | |
| 7 | + @include mobile { font-size: 93.75%; } | |
| 7 | 8 | |
| 8 | 9 | @include print { background: none; } |
| 9 | 10 | @import 'global/print'; |
| @@ -17,10 +18,11 @@ body { · 7 unmodified lines | ||
| 17 | 18 | font-weight: normal; |
| 18 | 19 | font-family: $baseFont; |
| 19 | 20 | line-height: 1.7; |
| 20 | − color: $textColor; | |
| 21 | + color: $textColor; // fallback to show the error message to browsers that don't support CSS variables. | |
| 22 | + color: var(--textColor); | |
| 21 | 23 | word-wrap: break-word; |
| 22 | 24 | overflow-wrap: break-word; |
| 23 | − background: $contentBackground; | |
| 25 | + background: var(--contentBackground); | |
| 24 | 26 | touch-action: manipulation; |
| 25 | 27 | -webkit-tap-highlight-color: rgba(black, 0); |
| 26 | 28 | -webkit-touch-callout: none; |
| @@ -29,11 +31,11 @@ body { · 2 unmodified lines | ||
| 29 | 31 | } |
| 30 | 32 | |
| 31 | 33 | a { |
| 32 | − color: $linkColor; | |
| 33 | − text-decoration: $linkTextDecoration; | |
| 34 | + color: var(--linkColor); | |
| 35 | + text-decoration: var(--linkTextDecoration); | |
| 34 | 36 | |
| 35 | 37 | &:hover { |
| 36 | − color: $linkColorHover; | |
| 38 | + color: var(--linkColorHover); | |
| 37 | 39 | text-decoration: underline; |
| 38 | 40 | } |
| 39 | 41 | } |
| @@ -47,7 +49,7 @@ img { · 7 unmodified lines | ||
| 47 | 49 | h1, h2, h3, h4, h5, h6 { |
| 48 | 50 | margin: 1.5em 0 1em; |
| 49 | 51 | line-height: 1.3; |
| 50 | − font-weight: $bolderFontWeight; | |
| 52 | + font-weight: var(--bolderFontWeight); | |
| 51 | 53 | } |
| 52 | 54 | |
| 53 | 55 | h1 { font-size: 1.5em; } |
| @@ -59,7 +61,7 @@ h5, h6 { font-size: 1em; } · 5 unmodified lines | ||
| 59 | 61 | p { margin: 0 0 1em; } |
| 60 | 62 | p:last-child { margin-bottom: 0; } |
| 61 | 63 | |
| 62 | −b, strong { font-weight: $boldFontWeight; } | |
| 64 | +b, strong { font-weight: var(--boldFontWeight); } | |
| 63 | 65 | |
| 64 | 66 | small { font-size: .9em; } |
| 65 | 67 | |
| @@ -79,7 +81,7 @@ li > ul, li > ol, dd > ul, dd > ol { margin: .5em 0; } · 13 unmodified lines | ||
| 79 | 81 | li > p { margin-bottom: .25em; } |
| 80 | 82 | |
| 81 | 83 | dl { margin: 1.5em 0; } |
| 82 | −dt { font-weight: $boldFontWeight; } | |
| 84 | +dt { font-weight: var(--boldFontWeight); } | |
| 83 | 85 | dd { |
| 84 | 86 | margin: .375em; |
| 85 | 87 | padding-left: 1em; |
| @@ -91,15 +93,15 @@ dfn, var { font-style: normal; } · 5 unmodified lines | ||
| 91 | 93 | |
| 92 | 94 | abbr, acronym, dfn { |
| 93 | 95 | cursor: help; |
| 94 | − border-bottom: 1px dotted $textColor; | |
| 96 | + border-bottom: 1px dotted var(--textColor); | |
| 95 | 97 | } |
| 96 | 98 | |
| 97 | 99 | pre, code, samp, %pre, %code { |
| 98 | − font-family: $monoFont; | |
| 100 | + font-family: var(--monoFont); | |
| 99 | 101 | font-weight: normal; |
| 100 | 102 | font-style: normal; |
| 101 | 103 | font-size: .9em; |
| 102 | − color: $textColor; | |
| 104 | + color: var(--textColor); | |
| 103 | 105 | white-space: pre-wrap; |
| 104 | 106 | direction: ltr; |
| 105 | 107 | -moz-tab-size: 2; |
| @@ -121,14 +123,14 @@ a > code { color: inherit; } · 15 unmodified lines | ||
| 121 | 123 | table { |
| 122 | 124 | margin: 1.5em 0; |
| 123 | 125 | background: none; |
| 124 | − border: 1px solid $boxBorder; | |
| 126 | + border: 1px solid var(--boxBorder); | |
| 125 | 127 | border-collapse: separate; |
| 126 | 128 | border-spacing: 0; |
| 127 | 129 | border-radius: 3px; |
| 128 | 130 | } |
| 129 | 131 | |
| 130 | 132 | caption { |
| 131 | − font-weight: $boldFontWeight; | |
| 133 | + font-weight: var(--boldFontWeight); | |
| 132 | 134 | padding: 0 .7em .3em; |
| 133 | 135 | } |
| 134 | 136 | |
| @@ -142,15 +144,15 @@ th, td { · 7 unmodified lines | ||
| 142 | 144 | } |
| 143 | 145 | |
| 144 | 146 | th { |
| 145 | − font-weight: $boldFontWeight; | |
| 147 | + font-weight: var(--boldFontWeight); | |
| 146 | 148 | border: 0; |
| 147 | − border-bottom: 1px solid $boxBorder; | |
| 149 | + border-bottom: 1px solid var(--boxBorder); | |
| 148 | 150 | border-radius: 0; |
| 149 | 151 | @extend %heading-box; |
| 150 | 152 | |
| 151 | 153 | &:empty { background: none; } |
| 152 | 154 | |
| 153 | − + th, + td { border-left: 1px solid $boxBorder; } | |
| 155 | + + th, + td { border-left: 1px solid var(--boxBorder); } | |
| 154 | 156 | |
| 155 | 157 | tr:first-child > &:first-child { border-top-left-radius: 3px; } |
| 156 | 158 | tr:first-child > &:last-child { border-top-right-radius: 3px; } |
| @@ -161,10 +163,10 @@ th { · 4 unmodified lines | ||
| 161 | 163 | } |
| 162 | 164 | |
| 163 | 165 | td { |
| 164 | − background: $contentBackground; | |
| 165 | − border-bottom: 1px solid $boxBorderLight; | |
| 166 | + background: var(--contentBackground); | |
| 167 | + border-bottom: 1px solid var(--boxBorderLight); | |
| 166 | 168 | |
| 167 | − + td { border-left: 1px solid $boxBorderLight; } | |
| 169 | + + td { border-left: 1px solid var(--boxBorderLight); } | |
| 168 | 170 | tr:last-child > & { border-bottom: 0; } |
| 169 | 171 | |
| 170 | 172 | > pre:only-child, > p:only-child, > ul:only-child, > ol:only-child { |
| @@ -190,7 +192,7 @@ input, button { · 19 unmodified lines | ||
| 190 | 192 | margin: 0; |
| 191 | 193 | font-family: inherit; |
| 192 | 194 | font-size: 100%; |
| 193 | − color: $textColor; | |
| 195 | + color: var(--textColor); | |
| 194 | 196 | line-height: normal; |
| 195 | 197 | @extend %border-box; |
| 196 | 198 | } |
| @@ -218,6 +220,10 @@ button:focus { · 21 unmodified lines | ||
| 218 | 220 | outline: -webkit-focus-ring-color auto 5px; |
| 219 | 221 | } |
| 220 | 222 | |
| 223 | +img, iframe { | |
| 224 | + background: var(--externalsBackground); | |
| 225 | +} | |
| 226 | + | |
| 221 | 227 | input[type="search"]::-webkit-search-cancel-button, |
| 222 | 228 | input[type="search"]::-webkit-search-decoration { |
| 223 | 229 | -webkit-appearance: none; |
| @@ -230,9 +236,9 @@ input[type="search"]::-webkit-search-decoration { · 6 unmodified lines | ||
| 230 | 236 | border: 0 !important; |
| 231 | 237 | } |
| 232 | 238 | |
| 233 | −::-webkit-input-placeholder { color: $textColorLighter; } | |
| 234 | −::-moz-placeholder { color: $textColorLighter; opacity: 1; } | |
| 235 | −:-ms-input-placeholder { color: $textColorLighter; } | |
| 239 | +::-webkit-input-placeholder { color: var(--textColorLighter); } | |
| 240 | +::-moz-placeholder { color: var(--textColorLighter); opacity: 1; } | |
| 241 | +:-ms-input-placeholder { color: var(--textColorLighter); } | |
| 236 | 242 | |
| 237 | 243 | body:not(._native-scrollbars) { |
| 238 | 244 | *::-webkit-scrollbar { -webkit-appearance: none; } |
| @@ -243,12 +249,12 @@ body:not(._native-scrollbars) { · 4 unmodified lines | ||
| 243 | 249 | *::-webkit-scrollbar-corner { display: none; } |
| 244 | 250 | |
| 245 | 251 | *::-webkit-scrollbar-track { |
| 246 | − background: $contentBackground; | |
| 247 | − border: 1px solid $contentBackground; | |
| 252 | + background: var(--contentBackground); | |
| 253 | + border: 1px solid var(--contentBackground); | |
| 248 | 254 | |
| 249 | 255 | &:hover { |
| 250 | − background: $sidebarBackground; | |
| 251 | − border-color: $sidebarBorder; | |
| 256 | + background: var(--sidebarBackground); | |
| 257 | + border-color: var(--sidebarBorder); | |
| 252 | 258 | } |
| 253 | 259 | |
| 254 | 260 | &:vertical { border-width: 0 0 0 1px; } |
| @@ -266,14 +272,14 @@ body:not(._native-scrollbars) { · 11 unmodified lines | ||
| 266 | 272 | |
| 267 | 273 | *::-webkit-scrollbar-thumb { |
| 268 | 274 | min-height: 2rem; |
| 269 | − background: $scrollbarColor; | |
| 275 | + background: var(--scrollbarColor); | |
| 270 | 276 | background-clip: padding-box; |
| 271 | 277 | border: 5px solid rgba(black, 0); |
| 272 | 278 | border-radius: 10px; |
| 273 | 279 | |
| 274 | 280 | &:hover, |
| 275 | 281 | &:active { |
| 276 | − background-color: $scrollbarColorHover; | |
| 282 | + background-color: var(--scrollbarColorHover); | |
| 277 | 283 | border-width: 4px; |
| 278 | 284 | } |
| 279 | 285 | } |
| @@ -36,15 +36,15 @@ · 35 unmodified lines | ||
| 36 | 36 | // |
| 37 | 37 | |
| 38 | 38 | %box { |
| 39 | − background: $boxBackground; | |
| 40 | − border: 1px solid $boxBorder; | |
| 39 | + background: var(--boxBackground); | |
| 40 | + border: 1px solid var(--boxBorder); | |
| 41 | 41 | border-radius: 3px; |
| 42 | 42 | } |
| 43 | 43 | |
| 44 | 44 | %heading-box { |
| 45 | − color: $boxHeaderColor; | |
| 46 | − background: $boxHeaderBackground; | |
| 47 | − border: 1px solid $boxBorder; | |
| 45 | + color: var(--boxHeaderColor); | |
| 46 | + background: var(--boxHeaderBackground); | |
| 47 | + border: 1px solid var(--boxBorder); | |
| 48 | 48 | border-radius: 3px; |
| 49 | 49 | } |
| 50 | 50 | |
| @@ -82,15 +82,15 @@ · 31 unmodified lines | ||
| 82 | 82 | %note { |
| 83 | 83 | margin: 1.5rem 0; |
| 84 | 84 | padding: .5rem .875rem; |
| 85 | − background: $noteBackground; | |
| 86 | − border: 1px solid $noteBorder; | |
| 85 | + background: var(--noteBackground); | |
| 86 | + border: 1px solid var(--noteBorder); | |
| 87 | 87 | border-radius: 3px; |
| 88 | 88 | } |
| 89 | 89 | |
| 90 | 90 | %label { |
| 91 | 91 | margin: 0 1px; |
| 92 | 92 | padding: 1px 4px 2px; |
| 93 | − background: $labelBackground; | |
| 93 | + background: var(--labelBackground); | |
| 94 | 94 | border-radius: 3px; |
| 95 | 95 | } |
| 96 | 96 | |
| @@ -102,35 +102,35 @@ · 5 unmodified lines | ||
| 102 | 102 | padding-right: .5em; |
| 103 | 103 | overflow: hidden; |
| 104 | 104 | font-size: inherit; |
| 105 | − color: $boxHeaderColor; | |
| 106 | − border: 1px solid $boxBorder; | |
| 105 | + color: var(--boxHeaderColor); | |
| 106 | + border: 1px solid var(--boxBorder); | |
| 107 | 107 | border-radius: 2px; |
| 108 | 108 | @extend %label; |
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | %label-yellow { |
| 112 | − background: $noteBackground; | |
| 113 | − border-color: $noteBorder; | |
| 112 | + background: var(--noteBackground); | |
| 113 | + border-color: var(--noteBorder); | |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | 116 | %note-green, %label-green { |
| 117 | − background: $noteGreenBackground; | |
| 118 | − border-color: $noteGreenBorder; | |
| 117 | + background: var(--noteGreenBackground); | |
| 118 | + border-color: var(--noteGreenBorder); | |
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | %note-blue, %label-blue { |
| 122 | − background: $noteBlueBackground; | |
| 123 | − border-color: $noteBlueBorder; | |
| 122 | + background: var(--noteBlueBackground); | |
| 123 | + border-color: var(--noteBlueBorder); | |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | %note-orange, %label-orange { |
| 127 | − background: $noteOrangeBackground; | |
| 128 | − border-color: $noteOrangeBorder; | |
| 127 | + background: var(--noteOrangeBackground); | |
| 128 | + border-color: var(--noteOrangeBorder); | |
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | %note-red, %label-red { |
| 132 | − background: $noteRedBackground; | |
| 133 | − border-color: $noteRedBorder; | |
| 132 | + background: var(--noteRedBackground); | |
| 133 | + border-color: var(--noteRedBorder); | |
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | // |
| @@ -149,12 +149,11 @@ · 12 unmodified lines | ||
| 149 | 149 | pointer-events: none; |
| 150 | 150 | |
| 151 | 151 | // <svg viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path d="M15,15H2V6h2.595c0,0,0.689-0.896,2.17-2H1C0.447,4,0,4.449,0,5v11c0,0.553,0.447,1,1,1h15c0.553,0,1-0.447,1-1v-3.746 l-2,1.645V15z M13.361,8.05v3.551L20,6.4l-6.639-4.999v3.131C5.3,4.532,5.3,12.5,5.3,12.5C7.582,8.752,8.986,8.05,13.361,8.05z"/></svg> |
| 152 | − @if $style == 'dark' { | |
| 153 | − background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); | |
| 154 | − } @else { | |
| 155 | − background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); | |
| 156 | − } | |
| 152 | + background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iIzMzNzdjMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); | |
| 157 | 153 | } |
| 158 | 154 | } |
| 155 | +html._theme-dark %external-link:after { | |
| 156 | + background-image: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2NiZDBkMCIgZD0iTTE1LDE1SDJWNmgyLjU5NWMwLDAsMC42ODktMC44OTYsMi4xNy0ySDFDMC40NDcsNCwwLDQuNDQ5LDAsNXYxMWMwLDAuNTUzLDAuNDQ3LDEsMSwxaDE1YzAuNTUzLDAsMS0wLjQ0NywxLTF2LTMuNzQ2IGwtMiwxLjY0NVYxNXogTTEzLjM2MSw4LjA1djMuNTUxTDIwLDYuNGwtNi42MzktNC45OTl2My4xMzFDNS4zLDQuNTMyLDUuMywxMi41LDUuMywxMi41QzcuNTgyLDguNzUyLDguOTg2LDguMDUsMTMuMzYxLDguMDV6Ii8+PC9zdmc+); | |
| 157 | +} | |
| 159 | 158 | |
| 160 | 159 | %internal-link:after { content: none !important; } |
| @@ -23,8 +23,8 @@ · 22 unmodified lines | ||
| 23 | 23 | %doc-icon-2 { background-image: image-url('docs-2@2x.png') !important; } |
| 24 | 24 | } |
| 25 | 25 | |
| 26 | −%darkIconFix { | |
| 27 | − @if $style == 'dark' { | |
| 26 | +html._theme-dark { | |
| 27 | + %darkIconFix { | |
| 28 | 28 | filter: invert(100%) grayscale(100%); |
| 29 | 29 | -webkit-filter: invert(100%) grayscale(100%); |
| 30 | 30 | } |
| @@ -94,6 +94,7 @@ · 63 unmodified lines | ||
| 94 | 94 | ._icon-marionette:before { background-position: -6rem -5rem; } |
| 95 | 95 | ._icon-jsdoc:before, |
| 96 | 96 | ._icon-koa:before, |
| 97 | +._icon-graphite:before, | |
| 97 | 98 | ._icon-mongoose:before { background-position: -7rem -5rem; } |
| 98 | 99 | ._icon-phpunit:before { background-position: -8rem -5rem; } |
| 99 | 100 | ._icon-nokogiri:before { background-position: -9rem -5rem; @extend %darkIconFix !optional; } |
| @@ -173,3 +174,9 @@ · 73 unmodified lines | ||
| 173 | 174 | ._icon-babel:before { background-position: -2rem -3rem; @extend %doc-icon-2; } |
| 174 | 175 | ._icon-leaflet:before { background-position: -3rem -3rem; @extend %doc-icon-2; } |
| 175 | 176 | ._icon-terraform:before { background-position: -4rem -3rem; @extend %doc-icon-2; } |
| 177 | +._icon-pygame:before { background-position: -5rem -3rem; @extend %doc-icon-2; } | |
| 178 | +._icon-bash:before { background-position: -6rem -3rem; @extend %doc-icon-2; } | |
| 179 | +._icon-dart:before { background-position: -7rem -3rem; @extend %doc-icon-2; } | |
| 180 | +._icon-qt:before { background-position: -8rem -3rem; @extend %doc-icon-2; } | |
| 181 | +._icon-puppeteer:before { background-position: -9rem -3rem; @extend %doc-icon-2; } | |
| 182 | +._icon-handlebars:before { background-position: 0 -4rem; @extend %doc-icon-2; @extend %darkIconFix !optional; } | |
| @@ -7,3 +7,9 @@ · 6 unmodified lines | ||
| 7 | 7 | @content; |
| 8 | 8 | } |
| 9 | 9 | } |
| 10 | + | |
| 11 | +@mixin mobile { | |
| 12 | + @media (max-width: 800px) { | |
| 13 | + @content; | |
| 14 | + } | |
| 15 | +} | |
| @@ -25,14 +25,14 @@ · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | ._attribution-p { |
| 27 | 27 | background: none; |
| 28 | − border: 2px solid $boxBorder; | |
| 28 | + border: 2px solid var(--boxBorder); | |
| 29 | 29 | } |
| 30 | 30 | |
| 31 | 31 | ._attribution:last-child:after { |
| 32 | 32 | content: 'Exported from DevDocs \2014 https://devdocs.io'; |
| 33 | 33 | display: block; |
| 34 | 34 | margin-top: 1rem; |
| 35 | − font-weight: $bolderFontWeight; | |
| 35 | + font-weight: var(--bolderFontWeight); | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | ._attribution { |
| @@ -1,92 +1,76 @@ | ||
| 1 | −$baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif; | |
| 2 | −$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; | |
| 3 | −$boldFontWeight: 500; | |
| 4 | −$bolderFontWeight: 600; | |
| 1 | +html._theme-dark { | |
| 2 | + --absolute: white; | |
| 5 | 3 | |
| 6 | −$style: 'dark'; | |
| 4 | + --documentBackground: #222; | |
| 5 | + --contentBackground: #33373a; | |
| 7 | 6 | |
| 8 | −$maxWidth: 80rem; | |
| 9 | −$headerHeight: 3rem; | |
| 10 | −$sidebarWidth: 20rem; | |
| 11 | −$sidebarMediumWidth: 16rem; | |
| 7 | + --textColor: #cbd0d0; | |
| 8 | + --textColorLight: #9da5ad; | |
| 9 | + --textColorLighter: #77787a; | |
| 12 | 10 | |
| 13 | −$documentBackground: #222; | |
| 14 | −$contentBackground: #33373a; | |
| 11 | + --externalsBackground: #fff; | |
| 15 | 12 | |
| 16 | −$textColor: #cbd0d0; | |
| 17 | −$textColorLight: #9da5ad; | |
| 18 | −$textColorLighter: #77787a; | |
| 19 | −$textColorRed: #f44336; | |
| 13 | + --inputFocusBorder: transparent; | |
| 20 | 14 | |
| 21 | −$inputFocusBorder: false; | |
| 15 | + --focusBackground: #3f4042; | |
| 16 | + --focusBorder: #000; | |
| 17 | + --focusText: #f7f2f2; | |
| 22 | 18 | |
| 23 | −$focusBackground: #3f4042; | |
| 24 | −$focusBorder: #000; | |
| 25 | −$focusText: #f7f2f2; | |
| 19 | + --loadingText: #5d6164; | |
| 26 | 20 | |
| 27 | −$loadingText: #5d6164; | |
| 28 | −$splashText: $loadingText; | |
| 21 | + --selectionBackground: #007acc; | |
| 22 | + --selectionBorder: #000; | |
| 29 | 23 | |
| 30 | −$selectionBackground: #007acc; | |
| 31 | −$selectionBorder: #000; | |
| 32 | −$selectionText: #fff; | |
| 24 | + --highlightBackground: #64675f; | |
| 33 | 25 | |
| 34 | −$highlightBackground: #64675f; | |
| 26 | + --linkColor: var(--textColor); | |
| 27 | + --linkColorHover: white; | |
| 28 | + --linkTextDecoration: underline; | |
| 35 | 29 | |
| 36 | −$linkColor: $textColor; | |
| 37 | −$linkColorHover: white; | |
| 38 | −$linkTextDecoration: underline; | |
| 30 | + --headerBackground: #1c1c1c; | |
| 31 | + --headerBorder: #000; | |
| 32 | + --searchTagBackground: #{darken(#1c1c1c, 5%)}; | |
| 33 | + --searchBorder: #{darken(#000, 2%)}; | |
| 39 | 34 | |
| 40 | −$headerBackground: #1c1c1c; | |
| 41 | −$headerBorder: #000; | |
| 35 | + --sidebarBackground: #24282a; | |
| 36 | + --transparentSidebarBackground: #{rgba(#24282a, 0)}; | |
| 37 | + --sidebarBorder: #000; | |
| 42 | 38 | |
| 43 | −$sidebarBackground: #24282a; | |
| 44 | −$sidebarBorder: #000; | |
| 39 | + --scrollbarColor: #6c6c6f; | |
| 40 | + --scrollbarColorHover: #949697; | |
| 45 | 41 | |
| 46 | −$scrollbarColor: #6c6c6f; | |
| 47 | −$scrollbarColorHover: #949697; | |
| 42 | + --pathBackground: var(--headerBackground); | |
| 43 | + --pathBorder: var(--headerBorder); | |
| 48 | 44 | |
| 49 | −$pathBackground: $headerBackground; | |
| 50 | −$pathBorder: $headerBorder; | |
| 45 | + --noticeBackground: var(--sidebarBackground); | |
| 46 | + --noticeBorder: var(--sidebarBorder); | |
| 51 | 47 | |
| 52 | −$noticeBackground: $sidebarBackground; | |
| 53 | −$noticeBorder: $sidebarBorder; | |
| 48 | + --boxBackground: var(--sidebarBackground); | |
| 49 | + --boxBorder: var(--headerBorder); | |
| 50 | + --boxBorderLight: var(--headerBorder); | |
| 51 | + --boxHeaderColor: #dbe4e4; | |
| 52 | + --boxHeaderBackground: var(--sidebarBackground); | |
| 54 | 53 | |
| 55 | −$boxBackground: $sidebarBackground; | |
| 56 | −$boxBorder: $headerBorder; | |
| 57 | −$boxBorderLight: $headerBorder; | |
| 58 | −$boxHeaderColor: #dbe4e4; | |
| 59 | −$boxHeaderBackground: $sidebarBackground; | |
| 54 | + --noteBackground: #45474b; | |
| 55 | + --noteBorder: #000; | |
| 60 | 56 | |
| 61 | −$noteBackground: #45474b; | |
| 62 | −$noteBorder: #000; | |
| 57 | + --noteGreenBackground: #284a2a; | |
| 58 | + --noteGreenBorder: #000; | |
| 63 | 59 | |
| 64 | −$noteGreenBackground: #284a2a; | |
| 65 | −$noteGreenBorder: #000; | |
| 60 | + --noteBlueBackground: #2a4151; | |
| 61 | + --noteBlueBorder: #000; | |
| 66 | 62 | |
| 67 | −$noteBlueBackground: #2a4151; | |
| 68 | −$noteBlueBorder: #000; | |
| 63 | + --noteOrangeBackground: #563322; | |
| 64 | + --noteOrangeBorder: #000; | |
| 69 | 65 | |
| 70 | −$noteOrangeBackground: #563322; | |
| 71 | −$noteOrangeBorder: #000; | |
| 66 | + --noteRedBackground: #603033; | |
| 67 | + --noteRedBorder: #000; | |
| 72 | 68 | |
| 73 | −$noteRedBackground: #603033; | |
| 74 | −$noteRedBorder: #000; | |
| 69 | + --labelBackground: var(--boxBackground); | |
| 75 | 70 | |
| 76 | −$labelBackground: $boxBackground; | |
| 71 | + --notifBackground: #{rgba(#555, .95)}; | |
| 72 | + --notifBorder: 1px solid #000; | |
| 77 | 73 | |
| 78 | −$notifBackground: rgba(#555, .95); | |
| 79 | −$notifBorder: 1px solid #000; | |
| 80 | −$notifColor: #fff; | |
| 81 | −$notifColorLight: #ccc; | |
| 82 | − | |
| 83 | −$tipBackground: $notifBackground; | |
| 84 | −$tipBorder: $notifBorder; | |
| 85 | − | |
| 86 | −$mediumScreen: '(max-width: 800px)'; | |
| 87 | − | |
| 88 | −$contentZ: 1; | |
| 89 | −$sidebarZ: 2; | |
| 90 | −$headerZ: 3; | |
| 91 | −$noticeZ: 4; | |
| 92 | −$hoverZ: 5; | |
| 74 | + --tipBackground: var(--notifBackground); | |
| 75 | + --tipBorder: var(--notifBorder); | |
| 76 | +} | |
| @@ -0,0 +1,76 @@ | ||
| 1 | +html._theme-default { | |
| 2 | + --absolute: black; | |
| 3 | + | |
| 4 | + --documentBackground: #f3f3f3; | |
| 5 | + --contentBackground: #fff; | |
| 6 | + | |
| 7 | + --textColor: #333; | |
| 8 | + --textColorLight: #666; | |
| 9 | + --textColorLighter: #888; | |
| 10 | + | |
| 11 | + --externalsBackground: #fff; | |
| 12 | + | |
| 13 | + --inputFocusBorder: #35b5f4; | |
| 14 | + | |
| 15 | + --focusBackground: #e5e5e5; | |
| 16 | + --focusBorder: #d4d4d4; | |
| 17 | + --focusText: #000; | |
| 18 | + | |
| 19 | + --loadingText: #ccc; | |
| 20 | + | |
| 21 | + --selectionBackground: #398df0; | |
| 22 | + --selectionBorder: #196fc2; | |
| 23 | + | |
| 24 | + --highlightBackground: #fffdcd; | |
| 25 | + | |
| 26 | + --linkColor: #3377c0; | |
| 27 | + --linkColorHover: #2f6cb6; | |
| 28 | + --linkTextDecoration: none; | |
| 29 | + | |
| 30 | + --headerBackground: #eee; | |
| 31 | + --headerBorder: #d7d7d7; | |
| 32 | + --searchTagBackground: #{darken(#eee, 5%)}; | |
| 33 | + --searchBorder: #{darken(#d7d7d7, 2%)}; | |
| 34 | + | |
| 35 | + --sidebarBackground: #f9f9f9; | |
| 36 | + --transparentSidebarBackground: #{rgba(#f9f9f9, 0)}; | |
| 37 | + --sidebarBorder: #e1e1e1; | |
| 38 | + | |
| 39 | + --scrollbarColor: #ccc; | |
| 40 | + --scrollbarColorHover: #999; | |
| 41 | + | |
| 42 | + --pathBackground: var(--sidebarBackground); | |
| 43 | + --pathBorder: var(--sidebarBorder); | |
| 44 | + | |
| 45 | + --noticeBackground: #faf9e2; | |
| 46 | + --noticeBorder: #e2e2c1; | |
| 47 | + | |
| 48 | + --boxBackground: #fafafa; | |
| 49 | + --boxBorder: #d8d8d8; | |
| 50 | + --boxBorderLight: #e5e5e5; | |
| 51 | + --boxHeaderColor: var(--textColor); | |
| 52 | + --boxHeaderBackground: #f5f5f5; | |
| 53 | + | |
| 54 | + --noteBackground: #f8f8dd; | |
| 55 | + --noteBorder: #d3d952; | |
| 56 | + | |
| 57 | + --noteGreenBackground: #e7f8e1; | |
| 58 | + --noteGreenBorder: #89da70; | |
| 59 | + | |
| 60 | + --noteBlueBackground: #d4f3fd; | |
| 61 | + --noteBlueBorder: #94bbeb; | |
| 62 | + | |
| 63 | + --noteOrangeBackground: #fbe6d1; | |
| 64 | + --noteOrangeBorder: #ec8b01; | |
| 65 | + | |
| 66 | + --noteRedBackground: #fed5d3; | |
| 67 | + --noteRedBorder: #dc7874; | |
| 68 | + | |
| 69 | + --labelBackground: #f4f4f4; | |
| 70 | + | |
| 71 | + --notifBackground: #{rgba(#333, .85)}; | |
| 72 | + --notifBorder: none; | |
| 73 | + | |
| 74 | + --tipBackground: #{rgba(#fffdcd, .95)}; | |
| 75 | + --tipBorder: 1px solid #e7dca9; | |
| 76 | +} | |
| @@ -1,92 +1,35 @@ | ||
| 1 | +// Variables needed to style the error message for browsers that don't support CSS variables. | |
| 1 | 2 | $baseFont: -apple-system, BlinkMacSystemFont, 'San Francisco', 'Segoe UI', Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif; |
| 2 | −$monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; | |
| 3 | −$boldFontWeight: 500; | |
| 4 | −$bolderFontWeight: 600; | |
| 5 | − | |
| 6 | −$style: 'light'; | |
| 7 | − | |
| 8 | −$maxWidth: 80rem; | |
| 9 | −$headerHeight: 3rem; | |
| 10 | −$sidebarWidth: 20rem; | |
| 11 | −$sidebarMediumWidth: 16rem; | |
| 12 | − | |
| 13 | −$documentBackground: #f3f3f3; | |
| 14 | −$contentBackground: #fff; | |
| 15 | − | |
| 16 | 3 | $textColor: #333; |
| 17 | −$textColorLight: #666; | |
| 18 | −$textColorLighter: #888; | |
| 19 | −$textColorRed: #f44336; | |
| 20 | − | |
| 21 | −$inputFocusBorder: #35b5f4; | |
| 22 | − | |
| 23 | −$focusBackground: #e5e5e5; | |
| 24 | −$focusBorder: #d4d4d4; | |
| 25 | −$focusText: #000; | |
| 26 | − | |
| 27 | −$loadingText: #ccc; | |
| 28 | −$splashText: #ccc; | |
| 29 | − | |
| 30 | −$selectionBackground: #398df0; | |
| 31 | −$selectionBorder: #196fc2; | |
| 32 | −$selectionText: #fff; | |
| 33 | − | |
| 34 | −$highlightBackground: #fffdcd; | |
| 35 | − | |
| 36 | −$linkColor: #3377c0; | |
| 37 | −$linkColorHover: #2f6cb6; | |
| 38 | −$linkTextDecoration: none; | |
| 39 | − | |
| 40 | −$headerBackground: #eee; | |
| 41 | −$headerBorder: #d7d7d7; | |
| 42 | − | |
| 43 | −$sidebarBackground: #f9f9f9; | |
| 44 | −$sidebarBorder: #e1e1e1; | |
| 45 | − | |
| 46 | −$scrollbarColor: #ccc; | |
| 47 | −$scrollbarColorHover: #999; | |
| 48 | − | |
| 49 | −$pathBackground: $sidebarBackground; | |
| 50 | −$pathBorder: $sidebarBorder; | |
| 51 | − | |
| 52 | −$noticeBackground: #faf9e2; | |
| 53 | −$noticeBorder: #e2e2c1; | |
| 54 | − | |
| 55 | −$boxBackground: #fafafa; | |
| 56 | −$boxBorder: #d8d8d8; | |
| 57 | −$boxBorderLight: #e5e5e5; | |
| 58 | −$boxHeaderColor: $textColor; | |
| 59 | −$boxHeaderBackground: #f5f5f5; | |
| 60 | − | |
| 61 | −$noteBackground: #f8f8dd; | |
| 62 | −$noteBorder: #d3d952; | |
| 63 | − | |
| 64 | −$noteGreenBackground: #e7f8e1; | |
| 65 | −$noteGreenBorder: #89da70; | |
| 66 | 4 | |
| 67 | −$noteBlueBackground: #d4f3fd; | |
| 68 | −$noteBlueBorder: #94bbeb; | |
| 5 | +html { | |
| 6 | + --baseFont: #{$baseFont}; | |
| 7 | + --monoFont: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, Courier, monospace; | |
| 8 | + --boldFontWeight: 500; | |
| 9 | + --bolderFontWeight: 600; | |
| 69 | 10 | |
| 70 | −$noteOrangeBackground: #fbe6d1; | |
| 71 | −$noteOrangeBorder: #ec8b01; | |
| 11 | + --textColorRed: #f44336; | |
| 72 | 12 | |
| 73 | −$noteRedBackground: #fed5d3; | |
| 74 | −$noteRedBorder: #dc7874; | |
| 13 | + --splashText: var(--loadingText); | |
| 75 | 14 | |
| 76 | −$labelBackground: #f4f4f4; | |
| 15 | + --selectionText: #fff; | |
| 16 | + --transparentSelectionText: rgba(255, 255, 255, 0.9); | |
| 77 | 17 | |
| 78 | −$notifBackground: rgba(#333, .85); | |
| 79 | −$notifBorder: none; | |
| 80 | −$notifColor: #fff; | |
| 81 | −$notifColorLight: #ccc; | |
| 18 | + --notifColor: #fff; | |
| 19 | + --notifColorLight: #ccc; | |
| 82 | 20 | |
| 83 | −$tipBackground: rgba(#fffdcd, .95); | |
| 84 | −$tipBorder: 1px solid #e7dca9; | |
| 21 | + --maxWidth: 80rem; | |
| 22 | + --headerHeight: 3rem; | |
| 23 | + --sidebarWidth: 20rem; | |
| 24 | + --sidebarMediumWidth: 16rem; | |
| 85 | 25 | |
| 86 | −$mediumScreen: '(max-width: 800px)'; | |
| 26 | + --focusBackground: #e5e5e5; | |
| 27 | + --focusBorder: #d4d4d4; | |
| 28 | + --focusText: #000; | |
| 87 | 29 | |
| 88 | −$contentZ: 1; | |
| 89 | −$sidebarZ: 2; | |
| 90 | −$headerZ: 3; | |
| 91 | −$noticeZ: 4; | |
| 92 | −$hoverZ: 5; | |
| 30 | + --contentZ: 1; | |
| 31 | + --sidebarZ: 2; | |
| 32 | + --headerZ: 3; | |
| 33 | + --noticeZ: 4; | |
| 34 | + --hoverZ: 5; | |
| 35 | +} | |
| @@ -8,7 +8,7 @@ · 7 unmodified lines | ||
| 8 | 8 | .nav-index-section { |
| 9 | 9 | margin: 1.5em 0 1em -2em; |
| 10 | 10 | list-style: none; |
| 11 | − font-weight: $boldFontWeight; | |
| 11 | + font-weight: var(--boldFontWeight); | |
| 12 | 12 | text-transform: capitalize; |
| 13 | 13 | } |
| 14 | 14 | |
| @@ -3,13 +3,13 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | h3 > .type-signature { |
| 5 | 5 | float: right; |
| 6 | − color: $textColorLight; | |
| 6 | + color: var(--textColorLight); | |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | h3 > .signature-attributes { |
| 10 | 10 | font-size: .75rem; |
| 11 | 11 | font-weight: normal; |
| 12 | 12 | font-style: italic; |
| 13 | − color: $textColorLighter; | |
| 13 | + color: var(--textColorLighter); | |
| 14 | 14 | } |
| 15 | 15 | } |
| @@ -0,0 +1,12 @@ | ||
| 1 | +._bash { | |
| 2 | + dl > dt > code, | |
| 3 | + dl > dt > kbd { | |
| 4 | + @extend %block-label, %label-blue; | |
| 5 | + } | |
| 6 | + | |
| 7 | + th[align=left] { | |
| 8 | + border-left: 1px solid var(--boxBorder); | |
| 9 | + } | |
| 10 | + | |
| 11 | + code { @extend %label; } | |
| 12 | +} | |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | h4 > code, h5 > code, strong > code { @extend %label; } |
| 5 | 5 | |
| 6 | 6 | h2 > small { |
| 7 | − color: $textColorLight; | |
| 7 | + color: var(--textColorLight); | |
| 8 | 8 | float: right; |
| 9 | 9 | } |
| 10 | 10 | |
| @@ -23,7 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | |
| 24 | 24 | .t-spar { // language/switch, language/for, etc. |
| 25 | 25 | font-style: italic; |
| 26 | − color: $textColorLight; | |
| 26 | + color: var(--textColorLight); | |
| 27 | 27 | } |
| 28 | 28 | .t-sdsc-nopad dl, .t-sdsc-nopad dd { margin: 0; } |
| 29 | 29 | |
| @@ -57,7 +57,7 @@ · 27 unmodified lines | ||
| 57 | 57 | margin: 1rem 0; |
| 58 | 58 | padding: .375rem; |
| 59 | 59 | font-size: .75rem; |
| 60 | − border: 1px solid $boxBorder; | |
| 60 | + border: 1px solid var(--boxBorder); | |
| 61 | 61 | border-radius: 2px; |
| 62 | 62 | } |
| 63 | 63 | |
| @@ -5,6 +5,6 @@ · 4 unmodified lines | ||
| 5 | 5 | .type { |
| 6 | 6 | float: right; |
| 7 | 7 | font-size: .9em; |
| 8 | − color: $textColorLight; | |
| 8 | + color: var(--textColorLight); | |
| 9 | 9 | } |
| 10 | 10 | } |
| @@ -2,10 +2,10 @@ · 1 unmodified line | ||
| 2 | 2 | h2 { @extend %block-heading; } |
| 3 | 3 | h3, .d_decl { @extend %block-label, %label-blue; } |
| 4 | 4 | .d_decl { @extend %code; } |
| 5 | − .d_decl > small { color: $textColorLight; } | |
| 6 | − .d_decl > strong { font-weight: $bolderFontWeight; } | |
| 5 | + .d_decl > small { color: var(--textColorLight); } | |
| 6 | + .d_decl > strong { font-weight: var(--bolderFontWeight); } | |
| 7 | 7 | |
| 8 | 8 | p > code, li > code, td > code, dd > code { @extend %label; } |
| 9 | 9 | |
| 10 | − span.red { color: $textColorRed; } | |
| 10 | + span.red { color: var(--textColorRed); } | |
| 11 | 11 | } |
| @@ -0,0 +1,12 @@ | ||
| 1 | +._dart { | |
| 2 | + @extend %simple; | |
| 3 | + | |
| 4 | + dl:not(.dl-horizontal) dt, .multi-line-signature { | |
| 5 | + @extend %block-label; | |
| 6 | + | |
| 7 | + .features { | |
| 8 | + float: right; | |
| 9 | + color: var(--textColorLight); | |
| 10 | + } | |
| 11 | + } | |
| 12 | +} | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | ._dojo { |
| 2 | 2 | @extend %simple; |
| 3 | 3 | |
| 4 | − .jsdoc-inheritance { color: $textColorLight; } | |
| 4 | + .jsdoc-inheritance { color: var(--textColorLight); } | |
| 5 | 5 | } |
| @@ -5,7 +5,7 @@ · 4 unmodified lines | ||
| 5 | 5 | |
| 6 | 6 | h3 > .access { |
| 7 | 7 | float: right; |
| 8 | − color: $textColorLight; | |
| 8 | + color: var(--textColorLight); | |
| 9 | 9 | font-weight: normal; |
| 10 | 10 | } |
| 11 | 11 | |
| @@ -15,6 +15,6 @@ · 3 unmodified lines | ||
| 15 | 15 | } |
| 16 | 16 | |
| 17 | 17 | p.github-link { |
| 18 | − color: $textColorLight; | |
| 18 | + color: var(--textColorLight); | |
| 19 | 19 | } |
| 20 | 20 | } |
| @@ -5,5 +5,5 @@ · 4 unmodified lines | ||
| 5 | 5 | code.code { @extend %label; } |
| 6 | 6 | .note { @extend %note; } |
| 7 | 7 | .warning { @extend %note, %note-red; } |
| 8 | − .note .label, .warning .label { font-weight: $boldFontWeight; } | |
| 8 | + .note .label, .warning .label { font-weight: var(--boldFontWeight); } | |
| 9 | 9 | } |
| @@ -0,0 +1,7 @@ | ||
| 1 | +._graphite { | |
| 2 | + @extend %simple; | |
| 3 | + | |
| 4 | + dl > dt { | |
| 5 | + @extend %block-label, %label-blue; | |
| 6 | + } | |
| 7 | +} | |
| @@ -32,7 +32,7 @@ · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | .toc-list { |
| 34 | 34 | margin-top: 0; |
| 35 | − font-weight: $boldFontWeight; | |
| 35 | + font-weight: var(--boldFontWeight); | |
| 36 | 36 | |
| 37 | 37 | > li + li { margin-top: 1em; } |
| 38 | 38 | > li > ul { font-weight: normal; } |
| @@ -48,7 +48,7 @@ · 9 unmodified lines | ||
| 48 | 48 | .returns, |
| 49 | 49 | .option-type { |
| 50 | 50 | float: right; |
| 51 | − font-weight: $boldFontWeight; | |
| 51 | + font-weight: var(--boldFontWeight); | |
| 52 | 52 | margin-left: 1em; |
| 53 | 53 | } |
| 54 | 54 | |
| @@ -12,6 +12,6 @@ · 11 unmodified lines | ||
| 12 | 12 | .smwtable { width: 100%; } |
| 13 | 13 | .smwtable td:nth-last-child(2), .smwtable td:last-child { width: 2.5em; } |
| 14 | 14 | |
| 15 | − .cell-green { background: $noteGreenBackground; } | |
| 16 | − .cell-red { background: $noteRedBackground; } | |
| 15 | + .cell-green { background: var(--noteGreenBackground); } | |
| 16 | + .cell-red { background: var(--noteRedBackground); } | |
| 17 | 17 | } |
| @@ -7,7 +7,7 @@ · 6 unmodified lines | ||
| 7 | 7 | > span { |
| 8 | 8 | display: block; |
| 9 | 9 | font-size: 1rem; |
| 10 | − font-weight: $boldFontWeight; | |
| 10 | + font-weight: var(--boldFontWeight); | |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | 13 | ul, ol { |
| @@ -42,7 +42,7 @@ · 28 unmodified lines | ||
| 42 | 42 | > .note { |
| 43 | 43 | em { |
| 44 | 44 | font-style: normal; |
| 45 | − font-weight: $boldFontWeight; | |
| 45 | + font-weight: var(--boldFontWeight); | |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | > ul { margin: 1em 0; } |
| @@ -93,7 +93,7 @@ · 44 unmodified lines | ||
| 93 | 93 | dt > strong > code, // HTML element attribute |
| 94 | 94 | dl > dt > code { // CSS property value, Javascript function argument |
| 95 | 95 | font-family: inherit; |
| 96 | − font-weight: $boldFontWeight; | |
| 96 | + font-weight: var(--boldFontWeight); | |
| 97 | 97 | font-size: inherit; |
| 98 | 98 | } |
| 99 | 99 | |
| @@ -9,10 +9,10 @@ · 8 unmodified lines | ||
| 9 | 9 | dt > code { @extend %label; } |
| 10 | 10 | |
| 11 | 11 | .api-heading { overflow: hidden; } |
| 12 | − .api-heading > code { font-weight: $boldFontWeight; } | |
| 12 | + .api-heading > code { font-weight: var(--boldFontWeight); } | |
| 13 | 13 | .locus, .src-code { float: right; } |
| 14 | 14 | .locus, .type, .src-code { margin-left: .5em; } |
| 15 | 15 | h2 .subtext-api { margin-top: .25rem; } |
| 16 | 16 | .locus, .subtext-api, .subtext-api > code { font-size: .75rem; } |
| 17 | − .locus, .type { color: $textColorLight; } | |
| 17 | + .locus, .type { color: var(--textColorLight); } | |
| 18 | 18 | } |
| @@ -8,7 +8,7 @@ · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | .faint.heading { |
| 10 | 10 | font-size: .9em; |
| 11 | − color: $textColorLight; | |
| 11 | + color: var(--textColorLight); | |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | .youtube-video iframe { width: 420px; height: 315px; } |
| @@ -3,6 +3,6 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | h3 > small { |
| 5 | 5 | float: right; |
| 6 | − color: $textColorLight; | |
| 6 | + color: var(--textColorLight); | |
| 7 | 7 | } |
| 8 | 8 | } |
| @@ -13,7 +13,7 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | .verinfo { |
| 15 | 15 | float: right; |
| 16 | − font-weight: $boldFontWeight; | |
| 16 | + font-weight: var(--boldFontWeight); | |
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | .classsynopsis, |
| @@ -21,7 +21,7 @@ · 1 unmodified line | ||
| 21 | 21 | .description > .methodsynopsis, |
| 22 | 22 | .description > .fieldsynopsis { @extend %note, %note-blue; } |
| 23 | 23 | |
| 24 | − .classsynopsisinfo_comment { color: $textColorLight; } | |
| 24 | + .classsynopsisinfo_comment { color: var(--textColorLight); } | |
| 25 | 25 | |
| 26 | 26 | .classsynopsisinfo_comment, |
| 27 | 27 | .classsynopsis > .constructorsynopsis, |
| @@ -16,7 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | p > code { @extend %label; } |
| 19 | − p.c2 { font-weight: $boldFontWeight; } | |
| 19 | + p.c2 { font-weight: var(--boldFontWeight); } | |
| 20 | 20 | |
| 21 | 21 | .navfooter > table { width: 100%; } |
| 22 | 22 | td[align=center] { text-align: center; } |
| @@ -0,0 +1,9 @@ | ||
| 1 | +._qt { | |
| 2 | + @extend %simple; | |
| 3 | + | |
| 4 | + // Function headers | |
| 5 | + h3.fn > code { | |
| 6 | + float: right; | |
| 7 | + color: var(--textColorLight); | |
| 8 | + } | |
| 9 | +} | |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | .method-description > h2, h3, h4, h5, h6 { font-size: 1em; } |
| 7 | 7 | |
| 8 | 8 | .method-heading { |
| 9 | − font-weight: $boldFontWeight; | |
| 9 | + font-weight: var(--boldFontWeight); | |
| 10 | 10 | @extend %block-label, %label-blue; |
| 11 | 11 | |
| 12 | 12 | + .method-heading { margin-top: -.5em; } |
| @@ -22,7 +22,7 @@ · 9 unmodified lines | ||
| 22 | 22 | a.method-click-advice { |
| 23 | 23 | float: right; |
| 24 | 24 | font-size: .75rem; |
| 25 | − color: $linkColor; | |
| 25 | + color: var(--linkColor); | |
| 26 | 26 | cursor: pointer; |
| 27 | 27 | @extend %user-select-none; |
| 28 | 28 | |
| @@ -42,8 +42,8 @@ · 13 unmodified lines | ||
| 42 | 42 | top: 0; |
| 43 | 43 | left: -1em; |
| 44 | 44 | right: 0; |
| 45 | − background: rgba($contentBackground, .95); | |
| 46 | − box-shadow: 0 1em 1em 1em $contentBackground; | |
| 45 | + background: var(--contentBackground); | |
| 46 | + box-shadow: 0 1em 1em 1em var(--contentBackground); | |
| 47 | 47 | |
| 48 | 48 | > pre { margin: 0; } |
| 49 | 49 | } |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | @extend %simple; |
| 3 | 3 | |
| 4 | 4 | .deprecated { @extend %note, %note-orange; } |
| 5 | − .deprecatedTitle { font-weight: $boldFontWeight; } | |
| 5 | + .deprecatedTitle { font-weight: var(--boldFontWeight); } | |
| 6 | 6 | |
| 7 | 7 | span.platform { float: right; } |
| 8 | 8 | span.propType, span.platform { font-weight: normal; } |
| @@ -14,7 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | .args { |
| 16 | 16 | font-size: .75rem; |
| 17 | − color: $textColorLight; | |
| 17 | + color: var(--textColorLight); | |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | // Others |
| @@ -35,7 +35,7 @@ · 14 unmodified lines | ||
| 35 | 35 | > .prompt { |
| 36 | 36 | float: left; |
| 37 | 37 | margin-right: .5em; |
| 38 | − color: $textColorLight; | |
| 38 | + color: var(--textColorLight); | |
| 39 | 39 | } |
| 40 | 40 | |
| 41 | 41 | > code { |
| @@ -10,6 +10,6 @@ · 9 unmodified lines | ||
| 10 | 10 | |
| 11 | 11 | > h1, > h2, > h3, > h4, > h5 { |
| 12 | 12 | margin: 0; |
| 13 | − font-family: $baseFont; | |
| 13 | + font-family: var(--baseFont); | |
| 14 | 14 | } |
| 15 | 15 | } |
| @@ -3,9 +3,18 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | h4 { @extend %block-label; } |
| 5 | 5 | .docblock { margin-left: 1em; } |
| 6 | + div.information, div.important-traits { | |
| 7 | + @extend %note; | |
| 8 | + | |
| 9 | + > pre { margin: .5rem 0; } | |
| 10 | + } | |
| 6 | 11 | |
| 7 | 12 | div.stability { margin-bottom: 1em; } |
| 8 | 13 | em.stab, span.stab { @extend %label; } |
| 9 | 14 | em.stab.unstable, span.stab.unstable { @extend %label-orange; } |
| 10 | − .since, .out-of-band { float: right; } | |
| 15 | + .out-of-band { float: right; } | |
| 16 | + .since, .srclink { | |
| 17 | + float: right; | |
| 18 | + margin-left: .5rem; | |
| 19 | + } | |
| 11 | 20 | } |
| @@ -17,34 +17,4 @@ · 16 unmodified lines | ||
| 17 | 17 | blockquote > h4, blockquote > h5 { margin-top: .25rem; } |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | −._apache_pig, | |
| 21 | −._bower, | |
| 22 | −._chai, | |
| 23 | −._codeceptjs, | |
| 24 | −._docker, | |
| 25 | −._electron, | |
| 26 | −._fish, | |
| 27 | −._flow, | |
| 28 | −._gnu, | |
| 29 | −._grunt, | |
| 30 | −._haxe, | |
| 31 | −._immutable, | |
| 32 | −._influxdata, | |
| 33 | −._jasmine, | |
| 34 | −._jest, | |
| 35 | −._less, | |
| 36 | −._lodash, | |
| 37 | −._marionette, | |
| 38 | −._markdown, | |
| 39 | −._mocha, | |
| 40 | −._mongoose, | |
| 41 | −._nim, | |
| 42 | −._redux, | |
| 43 | −._requirejs, | |
| 44 | −._simple, | |
| 45 | −._typescript, | |
| 46 | −._vagrant, | |
| 47 | −._vulkan, | |
| 48 | −._yarn { | |
| 49 | − @extend %simple; | |
| 50 | −} | |
| 20 | +._simple { @extend %simple; } | |
| @@ -14,7 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | .versionmodified, span.title, .topic-title { |
| 16 | 16 | display: block; |
| 17 | − font-weight: $boldFontWeight; | |
| 17 | + font-weight: var(--boldFontWeight); | |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | p > code, li > code, dd > code, .docutils > dt > code { @extend %label; } |
| @@ -26,7 +26,7 @@ · 5 unmodified lines | ||
| 26 | 26 | .admonition-title { |
| 27 | 27 | float: left; |
| 28 | 28 | margin: 0 .5em 0 0; |
| 29 | − font-weight: $boldFontWeight; | |
| 29 | + font-weight: var(--boldFontWeight); | |
| 30 | 30 | |
| 31 | 31 | &:after { content: ':'; } |
| 32 | 32 | } |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | .admonition.tip { @extend %note-green; } |
| 7 | 7 | .admonition-title { |
| 8 | 8 | margin: 0 0 .25rem; |
| 9 | − font-weight: $boldFontWeight; | |
| 9 | + font-weight: var(--boldFontWeight); | |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | code { @extend %label; } |
| @@ -24,7 +24,7 @@ · 23 unmodified lines | ||
| 24 | 24 | } |
| 25 | 25 | |
| 26 | 26 | tr.current { |
| 27 | − font-weight: $boldFontWeight; | |
| 27 | + font-weight: var(--boldFontWeight); | |
| 28 | 28 | font-size: 1rem; |
| 29 | 29 | } |
| 30 | 30 | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | ._yard { |
| 2 | 2 | @extend %simple; |
| 3 | 3 | |
| 4 | − .tag_title { font-weight: $boldFontWeight; } | |
| 4 | + .tag_title { font-weight: var(--boldFontWeight); } | |
| 5 | 5 | } |
| @@ -3,6 +3,6 @@ · 2 unmodified lines | ||
| 3 | 3 | |
| 4 | 4 | .detail-header-tag, .detailHeaderTag { |
| 5 | 5 | float: right; |
| 6 | − color: $textColorLight; | |
| 6 | + color: var(--textColorLight); | |
| 7 | 7 | } |
| 8 | 8 | } |
| @@ -12,6 +12,8 @@ class App < Sinatra::Application · 11 unmodified lines | ||
| 12 | 12 | Rack::Mime::MIME_TYPES['.webapp'] = 'application/x-web-app-manifest+json' |
| 13 | 13 | |
| 14 | 14 | configure do |
| 15 | + use Rack::SslEnforcer, only_environments: ['production', 'test'], hsts: false, force_secure_cookies: false | |
| 16 | + | |
| 15 | 17 | set :sentry_dsn, ENV['SENTRY_DSN'] |
| 16 | 18 | set :protection, except: [:frame_options, :xss_header] |
| 17 | 19 | |
| @@ -194,7 +196,6 @@ class App < Sinatra::Application · 176 unmodified lines | ||
| 194 | 196 | @@manifest_asset_urls ||= [ |
| 195 | 197 | javascript_path('application', asset_host: false), |
| 196 | 198 | stylesheet_path('application'), |
| 197 | − stylesheet_path('application-dark'), | |
| 198 | 199 | image_path('docs-1.png'), |
| 199 | 200 | image_path('docs-1@2x.png'), |
| 200 | 201 | image_path('docs-2.png'), |
| @@ -203,21 +204,6 @@ class App < Sinatra::Application · 2 unmodified lines | ||
| 203 | 204 | ] |
| 204 | 205 | end |
| 205 | 206 | |
| 206 | − def main_stylesheet_path | |
| 207 | − stylesheet_paths[dark_theme? ? :dark : :default] | |
| 208 | − end | |
| 209 | − | |
| 210 | − def alternate_stylesheet_path | |
| 211 | − stylesheet_paths[dark_theme? ? :default : :dark] | |
| 212 | − end | |
| 213 | − | |
| 214 | − def stylesheet_paths | |
| 215 | − @@stylesheet_paths ||= { | |
| 216 | − default: stylesheet_path('application'), | |
| 217 | − dark: stylesheet_path('application-dark') | |
| 218 | − } | |
| 219 | − end | |
| 220 | − | |
| 221 | 207 | def app_size |
| 222 | 208 | @app_size ||= memoized_cookies['size'].nil? ? '20rem' : "#{memoized_cookies['size']}px" |
| 223 | 209 | end |
| @@ -0,0 +1,74 @@ | ||
| 1 | +module Docs | |
| 2 | + class Bash | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + # Remove the navigation header and footer and the lines underneath and above it | |
| 6 | + at_css('.header + hr').remove | |
| 7 | + line_above = at_xpath('//div[@class="header"]/preceding::hr[1]') | |
| 8 | + line_above.remove unless line_above.nil? | |
| 9 | + css('.header').remove | |
| 10 | + | |
| 11 | + # Remove chapter and section numbers from title | |
| 12 | + title_node = at_css('h1, h2, h3, h4, h5, h6') | |
| 13 | + title_node.content = title_node.content.gsub(/(\d+\.?)+/, '').strip | |
| 14 | + title_node.name = 'h1' | |
| 15 | + | |
| 16 | + # Remove the "D. " from names like "D. Concept Index" and "D. Function Index" | |
| 17 | + title_node.content = title_node.content[3..-1] if title_node.content.start_with?("D. ") | |
| 18 | + | |
| 19 | + # Remove columns containing a single space from tables | |
| 20 | + # In the original reference they are used to add width between two columns | |
| 21 | + xpath('//td[text()=" " and not(descendant::*)]').remove | |
| 22 | + | |
| 23 | + # Add id's to additional entry nodes | |
| 24 | + css('dl > dt > code').each do |node| | |
| 25 | + # Only take the direct text (i.e. "<div>Hello <span>World</span></div>" becomes "Hello") | |
| 26 | + node['id'] = node.xpath('text()').to_s.strip | |
| 27 | + end | |
| 28 | + | |
| 29 | + # Fix hashes of index entries so they link to the correct hash on the linked page | |
| 30 | + css('table[class^=index-] td[valign=top] > a').each do |node| | |
| 31 | + path = node['href'].split('#')[0] | |
| 32 | + hash = node.content | |
| 33 | + | |
| 34 | + # Fix the index entries linking to the Special Parameters page | |
| 35 | + # There are multiple index entries that should link to the same paragraph on that page | |
| 36 | + # Example: the documentation for "$!" is equal to the documentation for "!" | |
| 37 | + if path.downcase.include?('special-parameters') | |
| 38 | + if hash.size > 1 && hash[0] == '$' | |
| 39 | + hash = hash[1..-1] | |
| 40 | + end | |
| 41 | + end | |
| 42 | + | |
| 43 | + node['href'] = path + '#' + hash | |
| 44 | + end | |
| 45 | + | |
| 46 | + # Fix index table letter hashes (the "Jump to" hashes) | |
| 47 | + css('table[class^=index-] th > a').each do |node| | |
| 48 | + node['id'] = node['name'] | |
| 49 | + end | |
| 50 | + | |
| 51 | + # Remove the rows with a horizontal line in them from the index tables | |
| 52 | + css('td[colspan="4"]').remove | |
| 53 | + | |
| 54 | + # Remove additional text from menu entry and index entry cells | |
| 55 | + css('td[valign=top]').each do |node| | |
| 56 | + link = node.at_css('a') | |
| 57 | + node.children = link unless link.nil? | |
| 58 | + end | |
| 59 | + | |
| 60 | + css('tt', 'code', 'table').remove_attr('class') | |
| 61 | + | |
| 62 | + css('tt').each do |node| | |
| 63 | + node.name = 'code' | |
| 64 | + end | |
| 65 | + | |
| 66 | + css('pre').each do |node| | |
| 67 | + node.content = node.content | |
| 68 | + end | |
| 69 | + | |
| 70 | + doc | |
| 71 | + end | |
| 72 | + end | |
| 73 | + end | |
| 74 | +end | |
| @@ -0,0 +1,56 @@ | ||
| 1 | +module Docs | |
| 2 | + class Bash | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + name = at_css('hr + a + *').content.gsub(/(\d+\.?)+/, '') | |
| 6 | + | |
| 7 | + # Remove the "D. " from names like "D. Concept Index" and "D. Function Index" | |
| 8 | + name = name[3..-1] if name.start_with?('D. ') | |
| 9 | + | |
| 10 | + name | |
| 11 | + end | |
| 12 | + | |
| 13 | + def get_type | |
| 14 | + return 'Manual: Appendices' if name.start_with?('Appendix') | |
| 15 | + return 'Manual: Indexes' if at_css('a[rel=up]').content.include?("Index") | |
| 16 | + "Manual" | |
| 17 | + end | |
| 18 | + | |
| 19 | + def additional_entries | |
| 20 | + entry_type = { | |
| 21 | + "Function Index" => "Functions", | |
| 22 | + "Index of Shell Builtin Commands" => "Builtin Commands", | |
| 23 | + "Index of Shell Reserved Words" => "Reserved Words", | |
| 24 | + "Parameter and Variable Index" => "Parameters and Variables" | |
| 25 | + }[name] | |
| 26 | + | |
| 27 | + # Only extract additional entries from certain index pages | |
| 28 | + return [] if entry_type.nil? | |
| 29 | + | |
| 30 | + entries = [] | |
| 31 | + | |
| 32 | + css('table[class^=index-] td[valign=top] > a').each_slice(2) do |entry_node, section_node| | |
| 33 | + entry_name = entry_node.content | |
| 34 | + | |
| 35 | + page = section_node['href'].split('#')[0] | |
| 36 | + hash = entry_name | |
| 37 | + | |
| 38 | + # The Special Parameters page has multiple additional entries which should link to the same paragraph | |
| 39 | + # Example: the documentation for "$!" is equal to the documentation for "!" | |
| 40 | + if page == 'special-parameters' | |
| 41 | + if hash.size > 1 && hash[0] == '$' | |
| 42 | + hash = hash[1..-1] | |
| 43 | + end | |
| 44 | + end | |
| 45 | + | |
| 46 | + # Construct path to the page which the index links to | |
| 47 | + entry_path = '/html_node/' + page + '#' + hash | |
| 48 | + | |
| 49 | + entries << [entry_name, entry_path, entry_type] | |
| 50 | + end | |
| 51 | + | |
| 52 | + entries | |
| 53 | + end | |
| 54 | + end | |
| 55 | + end | |
| 56 | +end | |
| @@ -0,0 +1,66 @@ | ||
| 1 | +module Docs | |
| 2 | + class Dart | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + # Move the title into the main content node in the v1 docs | |
| 6 | + title = at_css('h1.title') | |
| 7 | + if title | |
| 8 | + name = title.children.last.content.strip | |
| 9 | + kind = title.at_css('.kind').content | |
| 10 | + at_css('.main-content').prepend_child("<h1>#{name} #{kind}</h1>") | |
| 11 | + end | |
| 12 | + | |
| 13 | + # Add a title to the homepage of the v2 docs | |
| 14 | + if subpath == 'index.html' && at_css('.main-content > h1').nil? | |
| 15 | + at_css('.main-content').prepend_child('<h1>Dart SDK</h1>') | |
| 16 | + end | |
| 17 | + | |
| 18 | + # Add the library to the main content (it is not always visible in the menu entry) | |
| 19 | + breadcrumbs = at_css('.breadcrumbs').css('li:not(.self-crumb) > a') | |
| 20 | + if breadcrumbs.length > 1 | |
| 21 | + library = breadcrumbs[1].content | |
| 22 | + | |
| 23 | + # Generate the link to the homepage of the library | |
| 24 | + with_hypens = library.gsub(/:/, '-') | |
| 25 | + location = "#{'../' * subpath.count('/')}#{with_hypens}/#{with_hypens}-library" | |
| 26 | + link = "<a href=\"#{location}\" class=\"_links-link\">#{library}</span>" | |
| 27 | + | |
| 28 | + # Add the link to the main title, just like how the "Homepage" and "Source code" links appear | |
| 29 | + at_css('.main-content').prepend_child("<p class=\"_links\">#{link}</p>") | |
| 30 | + end | |
| 31 | + | |
| 32 | + # Extract the actual content | |
| 33 | + # We can't use options[:container] here because the entries filter uses the breadcrumbs node | |
| 34 | + @doc = at_css('.main-content') | |
| 35 | + | |
| 36 | + # Move the features (i.e. "read-only, inherited") into the blue header | |
| 37 | + css('.features').each do |node| | |
| 38 | + header = node.xpath('parent::dd/preceding::dt').last | |
| 39 | + header.add_child node unless header.nil? | |
| 40 | + end | |
| 41 | + | |
| 42 | + css('section').each do |node| | |
| 43 | + if node['id'] && node.first_element_child | |
| 44 | + node.first_element_child['id'] ||= node['id'] | |
| 45 | + end | |
| 46 | + | |
| 47 | + node.before(node.children).remove | |
| 48 | + end | |
| 49 | + | |
| 50 | + css('span').each do |node| | |
| 51 | + node.before(node.children).remove | |
| 52 | + end | |
| 53 | + | |
| 54 | + # Make code blocks detectable by Prism | |
| 55 | + css('pre').each do |node| | |
| 56 | + node['data-language'] = 'dart' | |
| 57 | + node.content = node.content | |
| 58 | + end | |
| 59 | + | |
| 60 | + css('.properties', '.property', '.callables', '.callable').remove_attr('class') | |
| 61 | + | |
| 62 | + doc | |
| 63 | + end | |
| 64 | + end | |
| 65 | + end | |
| 66 | +end | |
| @@ -0,0 +1,42 @@ | ||
| 1 | +module Docs | |
| 2 | + class Dart | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + title = at_css('h1.title') | |
| 6 | + if title # v1 | |
| 7 | + name = title.element_children.last.content.strip | |
| 8 | + kind = title.at_css('.kind').content | |
| 9 | + else # v2 | |
| 10 | + title = at_css('.main-content > h1') | |
| 11 | + name = title.content[/(.*)( )/, 1].split(' top-level')[0] | |
| 12 | + kind = title.content[/(.*)( )(.+)/, 3] | |
| 13 | + end | |
| 14 | + | |
| 15 | + breadcrumbs = at_css('.breadcrumbs').css('li:not(.self-crumb) > a') | |
| 16 | + first_part = '' | |
| 17 | + | |
| 18 | + if breadcrumbs.length == 2 && !kind.include?('class') | |
| 19 | + first_part = breadcrumbs[1].content | |
| 20 | + elsif breadcrumbs.length == 3 | |
| 21 | + first_part = breadcrumbs[2].content | |
| 22 | + end | |
| 23 | + | |
| 24 | + separator = '' | |
| 25 | + | |
| 26 | + unless first_part.empty? | |
| 27 | + if kind.include?('class') | |
| 28 | + separator = ':' | |
| 29 | + else | |
| 30 | + separator = '.' | |
| 31 | + end | |
| 32 | + end | |
| 33 | + | |
| 34 | + "#{first_part}#{separator}#{name}" | |
| 35 | + end | |
| 36 | + | |
| 37 | + def get_type | |
| 38 | + at_css('.breadcrumbs > li:nth-child(2)').content.split(' ')[0] | |
| 39 | + end | |
| 40 | + end | |
| 41 | + end | |
| 42 | +end | |
| @@ -26,6 +26,7 @@ module Docs · 25 unmodified lines | ||
| 26 | 26 | 'Geometry' => 'Geometry', |
| 27 | 27 | 'High Resolution Time' => 'Performance', |
| 28 | 28 | 'Intersection' => 'Intersection Observer', |
| 29 | + 'Media Capabilities' => 'Media', | |
| 29 | 30 | 'Media Capture' => 'Media', |
| 30 | 31 | 'Media Session' => 'Media', |
| 31 | 32 | 'Media Source' => 'Media', |
| @@ -99,6 +100,7 @@ module Docs · 67 unmodified lines | ||
| 99 | 100 | 'MediaSession' => 'Media Session', |
| 100 | 101 | 'MediaTrack' => 'Media Streams', |
| 101 | 102 | 'Message' => 'Channel Messaging', |
| 103 | + 'Mutation' => 'DOM', | |
| 102 | 104 | 'NamedNode' => 'Nodes', |
| 103 | 105 | 'Node' => 'Nodes', |
| 104 | 106 | 'Notification' => 'Notification', |
| @@ -116,6 +118,7 @@ module Docs · 11 unmodified lines | ||
| 116 | 118 | 'Shadow' => 'Shadow DOM', |
| 117 | 119 | 'StaticRange' => 'Range', |
| 118 | 120 | 'Streams' => 'Media Streams', |
| 121 | + 'StyleProperty' => 'CSS', | |
| 119 | 122 | 'StyleSheet' => 'CSS', |
| 120 | 123 | 'Stylesheet' => 'CSS', |
| 121 | 124 | 'SVG' => 'SVG', |
| @@ -59,6 +59,7 @@ module Docs · 58 unmodified lines | ||
| 59 | 59 | |
| 60 | 60 | css('pre').each do |node| |
| 61 | 61 | node['data-language'] = 'elixir' |
| 62 | + node.content = node.content | |
| 62 | 63 | end |
| 63 | 64 | end |
| 64 | 65 | end |
| @@ -42,6 +42,11 @@ module Docs · 41 unmodified lines | ||
| 42 | 42 | node.parent.content = node.parent.content |
| 43 | 43 | end |
| 44 | 44 | |
| 45 | + # Fix links to the method reference | |
| 46 | + css('a').each do |node| | |
| 47 | + node['href'] = node['href'].sub('4x/api', 'index') | |
| 48 | + end | |
| 49 | + | |
| 45 | 50 | doc |
| 46 | 51 | end |
| 47 | 52 | end |
| @@ -0,0 +1,27 @@ | ||
| 1 | +module Docs | |
| 2 | + class Graphite | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + # Remove the paragraph icon after all headers | |
| 6 | + css('.headerlink').remove | |
| 7 | + | |
| 8 | + css('dl.function > dt').each do |node| | |
| 9 | + node.content = node.content | |
| 10 | + end | |
| 11 | + | |
| 12 | + css('.section').each do |node| | |
| 13 | + node.before(node.children).remove | |
| 14 | + end | |
| 15 | + | |
| 16 | + css('div[class*="highlight-"]').each do |node| | |
| 17 | + node.content = node.content.strip | |
| 18 | + node.name = 'pre' | |
| 19 | + node['data-language'] = node['class'][/highlight\-(\w+)/, 1] | |
| 20 | + node.remove_attribute('class') | |
| 21 | + end | |
| 22 | + | |
| 23 | + doc | |
| 24 | + end | |
| 25 | + end | |
| 26 | + end | |
| 27 | +end | |
| @@ -0,0 +1,46 @@ | ||
| 1 | +module Docs | |
| 2 | + class Graphite | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + at_css('h1').children[0].to_s | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + get_name | |
| 10 | + end | |
| 11 | + | |
| 12 | + def additional_entries | |
| 13 | + entries = [] | |
| 14 | + | |
| 15 | + # Sections | |
| 16 | + css('.section > .section').each do |node| | |
| 17 | + title = node.at_css('h2, h3') | |
| 18 | + | |
| 19 | + next if title.nil? | |
| 20 | + | |
| 21 | + # Move the id attribute to the title | |
| 22 | + # If this is excluded, the complete section will be highlighted in yellow when someone navigates to it | |
| 23 | + title['id'] = node['id'] | |
| 24 | + node.remove_attribute('id') | |
| 25 | + | |
| 26 | + parent_title_selector = "parent::div[@class='section']/preceding::#{title.name == 'h2' ? 'h1' : 'h2'}" | |
| 27 | + | |
| 28 | + entries << [ | |
| 29 | + title.children[0].to_s, | |
| 30 | + title['id'], | |
| 31 | + title.xpath(parent_title_selector).last.children[0].to_s | |
| 32 | + ] | |
| 33 | + end | |
| 34 | + | |
| 35 | + # Functions | |
| 36 | + css('dl.function > dt').each do |node| | |
| 37 | + name = node.at_css('.descname').content | |
| 38 | + name << '()' | |
| 39 | + entries << [name, node['id'], 'Functions'] | |
| 40 | + end | |
| 41 | + | |
| 42 | + entries | |
| 43 | + end | |
| 44 | + end | |
| 45 | + end | |
| 46 | +end | |
| @@ -0,0 +1,44 @@ | ||
| 1 | +module Docs | |
| 2 | + class Handlebars | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + # Remove the t-shirt shop advertisement | |
| 6 | + css('#callout').remove | |
| 7 | + | |
| 8 | + # The title filter is used to add titles to pages without one, remove original headers | |
| 9 | + css('h1').remove | |
| 10 | + | |
| 11 | + # Remove the link to the issue tracker | |
| 12 | + css('.issue-tracker').remove | |
| 13 | + | |
| 14 | + css('pre').each do |node| | |
| 15 | + # Remove nested nodes inside pre tags | |
| 16 | + node.content = node.content | |
| 17 | + | |
| 18 | + # Add syntax highlighting | |
| 19 | + node['data-language'] = 'html' | |
| 20 | + end | |
| 21 | + | |
| 22 | + # Transform 'Learn More' links to headers in the "Getting Started" part of the homepage | |
| 23 | + # If this step is skipped, that section looks cluttered with 4 sub-sections without any dividers | |
| 24 | + css('#getting-started + .contents a.more-info').each do |node| | |
| 25 | + clone = node.clone | |
| 26 | + | |
| 27 | + # Move it to the top of the sub-section | |
| 28 | + node.parent.prepend_child(clone) | |
| 29 | + | |
| 30 | + # Turn it into a header | |
| 31 | + clone.name = 'h3' | |
| 32 | + | |
| 33 | + # Remove the "Learn More: " part | |
| 34 | + clone.content = clone.content[12..-1] | |
| 35 | + end | |
| 36 | + | |
| 37 | + # Remove class attributes from div elements to reduce file size | |
| 38 | + css('div').remove_attr('class') | |
| 39 | + | |
| 40 | + doc | |
| 41 | + end | |
| 42 | + end | |
| 43 | + end | |
| 44 | +end | |
| @@ -0,0 +1,19 @@ | ||
| 1 | +module Docs | |
| 2 | + class Handlebars | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + subpath[0..-6].titleize | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + name | |
| 10 | + end | |
| 11 | + | |
| 12 | + def additional_entries | |
| 13 | + css('h2, h3').to_a.map do |node| | |
| 14 | + [node.content.strip, node['id'], root_page? ? 'Manual' : nil] | |
| 15 | + end | |
| 16 | + end | |
| 17 | + end | |
| 18 | + end | |
| 19 | +end | |
| @@ -0,0 +1,24 @@ | ||
| 1 | +module Docs | |
| 2 | + class Puppeteer | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + at_css('h1').content = 'Puppeteer Documentation' | |
| 6 | + | |
| 7 | + # None of the elements to remove have classes, so the order of the remove calls is trivial | |
| 8 | + | |
| 9 | + # Remove links to previous versions of the reference | |
| 10 | + at_css('h1 + ul').remove | |
| 11 | + | |
| 12 | + # Remove table of contents | |
| 13 | + at_css('h1 + h5').remove | |
| 14 | + at_css('h1 + ul').remove | |
| 15 | + | |
| 16 | + # Make headers bigger by transforming them into a bigger variant | |
| 17 | + css('h3').each { |node| node.name = 'h2' } | |
| 18 | + css('h4').each { |node| node.name = 'h3' } | |
| 19 | + | |
| 20 | + doc | |
| 21 | + end | |
| 22 | + end | |
| 23 | + end | |
| 24 | +end | |
| @@ -0,0 +1,41 @@ | ||
| 1 | +module Docs | |
| 2 | + class Puppeteer | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + # The entire reference is one big page, so get_name and get_type are not necessary | |
| 5 | + | |
| 6 | + def additional_entries | |
| 7 | + entries = [] | |
| 8 | + | |
| 9 | + css('h3').each do |node| | |
| 10 | + name = node.content.split(': ').last | |
| 11 | + | |
| 12 | + # Find all sub-items (all h4's between the current h3 and the next) | |
| 13 | + current = node.next | |
| 14 | + while !current.nil? && current.name != 'h3' | |
| 15 | + if current.name == 'h4' | |
| 16 | + current_name = current.content | |
| 17 | + | |
| 18 | + # Prepend events with the class name | |
| 19 | + if current_name.start_with?('event: ') | |
| 20 | + current_name = "#{name} event: #{current_name[/'(.*)'/, 1]}" | |
| 21 | + end | |
| 22 | + | |
| 23 | + # Remove arguments from functions | |
| 24 | + if current_name.include?('(') | |
| 25 | + current_name = current_name.split('(')[0] + '()' | |
| 26 | + end | |
| 27 | + | |
| 28 | + entries << [current_name, current['id'], name] | |
| 29 | + end | |
| 30 | + | |
| 31 | + current = current.next | |
| 32 | + end | |
| 33 | + | |
| 34 | + entries << [name, node['id'], name] | |
| 35 | + end | |
| 36 | + | |
| 37 | + entries | |
| 38 | + end | |
| 39 | + end | |
| 40 | + end | |
| 41 | +end | |
| @@ -0,0 +1,102 @@ | ||
| 1 | +module Docs | |
| 2 | + class Pygame | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + @doc = at_css '.body' | |
| 6 | + | |
| 7 | + if root_page? | |
| 8 | + # remove unneeded stuff | |
| 9 | + at_css('.modindex-jumpbox').remove | |
| 10 | + css('[role="navigation"],.pcap, .cap, .footer').remove | |
| 11 | + # table -> list | |
| 12 | + list = at_css('table') | |
| 13 | + list.replace(list.children) | |
| 14 | + list.name = 'ul' | |
| 15 | + css('tr').each do |row| | |
| 16 | + row.name = 'li' | |
| 17 | + row.remove_attribute('class') | |
| 18 | + end | |
| 19 | + at_css('h1').content = 'Pygame' | |
| 20 | + return doc | |
| 21 | + end | |
| 22 | + | |
| 23 | + # remove unwanted stuff | |
| 24 | + # .headerlink => ¶ after links | |
| 25 | + # .toc => table of content | |
| 26 | + # .tooltip-content => tooltips after links to functions | |
| 27 | + css('table.toc.docutils, .headerlink, .tooltip-content').remove | |
| 28 | + | |
| 29 | + # Remove wrapper .section | |
| 30 | + section = at_css('.section') | |
| 31 | + definition = at_css('.definition') | |
| 32 | + definition['id'] = section['id'] | |
| 33 | + section.replace(section.children) | |
| 34 | + | |
| 35 | + # Format code for it be highlighted | |
| 36 | + css('.highlight-default.notranslate').each do |node| | |
| 37 | + pre = node.at_css('pre') | |
| 38 | + node.replace(pre) | |
| 39 | + # gets rid of the already existing syntax highlighting | |
| 40 | + pre.content = pre.content | |
| 41 | + pre['class'] = 'language-python' | |
| 42 | + pre['data-language'] = "python" | |
| 43 | + end | |
| 44 | + | |
| 45 | + # change descriptions of functions/attributes to blockquote | |
| 46 | + css('.line-block').each do |node| | |
| 47 | + node.name = 'blockquote' | |
| 48 | + end | |
| 49 | + | |
| 50 | + # change functions | |
| 51 | + css('.definition').each do |d| | |
| 52 | + | |
| 53 | + # the header is the function/attribute name. It might look something like | |
| 54 | + # this: | |
| 55 | + # pygame.image.load() | |
| 56 | + # It'll end up being something like this: | |
| 57 | + # pygame.image.load(filename) -> Surface | |
| 58 | + # pygame.image.load(fileobj, namehint="") -> Surface | |
| 59 | + | |
| 60 | + header = d.at_css('dt.title') | |
| 61 | + if d['class'].include?('class') or d['class'].include?('module') | |
| 62 | + header.name = 'h1' | |
| 63 | + @section = header.content.strip | |
| 64 | + else | |
| 65 | + header.name = 'h3' | |
| 66 | + end | |
| 67 | + # save the original header | |
| 68 | + initial_header = header.content.strip | |
| 69 | + # save the real name for the entries | |
| 70 | + header['data-name'] = initial_header | |
| 71 | + # empty the header | |
| 72 | + if header.name == 'h3' | |
| 73 | + header.inner_html = '' | |
| 74 | + end | |
| 75 | + # to replace it with the signatures | |
| 76 | + next_el = header.next_element | |
| 77 | + signatures = next_el.css('.signature') | |
| 78 | + signatures.each do |sig| | |
| 79 | + sig.name = 'code' | |
| 80 | + if header.name == 'h3' | |
| 81 | + sig.parent = header | |
| 82 | + # the signature don't contain pygame.module. I think it's better | |
| 83 | + # to display them, as it avoids confusion with methods (have a | |
| 84 | + # look at the pygame.Rect page) | |
| 85 | + if initial_header.start_with?(@section) | |
| 86 | + sig.content = @section + '.' + sig.text | |
| 87 | + end | |
| 88 | + # seperate the signatures on different lines. | |
| 89 | + header.add_child "<br>" | |
| 90 | + end | |
| 91 | + end | |
| 92 | + end | |
| 93 | + | |
| 94 | + css('> dl', '> dl > dd', 'h1 code').each do |node| | |
| 95 | + node.before(node.children).remove | |
| 96 | + end | |
| 97 | + | |
| 98 | + doc | |
| 99 | + end | |
| 100 | + end | |
| 101 | + end | |
| 102 | +end | |
| @@ -0,0 +1,29 @@ | ||
| 1 | +module Docs | |
| 2 | + class Pygame | |
| 3 | + class EntriesFilter < Docs::EntriesFilter | |
| 4 | + def get_name | |
| 5 | + at_css('h1').content.remove('pygame.') | |
| 6 | + end | |
| 7 | + | |
| 8 | + def get_type | |
| 9 | + at_css('h1').content | |
| 10 | + end | |
| 11 | + | |
| 12 | + def additional_entries | |
| 13 | + return [] if root_page? | |
| 14 | + | |
| 15 | + css('h1, h2, h3').each_with_object [] do |node, entries| | |
| 16 | + name = node['id'] || node['data-name'] | |
| 17 | + | |
| 18 | + if node.parent['class'].include?('function') or node.parent['class'].include?('method') | |
| 19 | + name << '()' | |
| 20 | + end | |
| 21 | + | |
| 22 | + name.remove!('pygame.') | |
| 23 | + | |
| 24 | + entries << [name, node['id']] unless name == self.name | |
| 25 | + end | |
| 26 | + end | |
| 27 | + end | |
| 28 | + end | |
| 29 | +end | |
| @@ -15,15 +15,17 @@ module Docs · 14 unmodified lines | ||
| 15 | 15 | |
| 16 | 16 | def other |
| 17 | 17 | css('h1').each do |node| |
| 18 | − node.content = node.content.sub!(/\A[\d\.]+/) do |str| | |
| 18 | + node.content = node.content.sub(/\A[\d\.]+/) do |str| | |
| 19 | 19 | rgx = /\A#{str}/ |
| 20 | 20 | @levelRegexp = @levelRegexp ? Regexp.union(@levelRegexp, rgx) : rgx |
| 21 | 21 | '' |
| 22 | 22 | end |
| 23 | 23 | end |
| 24 | 24 | |
| 25 | − css('h2', 'h3', 'h4').each do |node| | |
| 26 | − node.inner_html = node.inner_html.remove @levelRegexp | |
| 25 | + unless @levelRegexp.nil? | |
| 26 | + css('h2', 'h3', 'h4').each do |node| | |
| 27 | + node.inner_html = node.inner_html.remove @levelRegexp | |
| 28 | + end | |
| 27 | 29 | end |
| 28 | 30 | end |
| 29 | 31 | end |
| @@ -2,16 +2,18 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Python |
| 3 | 3 | class EntriesV3Filter < Docs::EntriesFilter |
| 4 | 4 | REPLACE_TYPES = { |
| 5 | − 'Cryptographic' => 'Cryptography', | |
| 6 | − 'Custom Interpreters' => 'Interpreters', | |
| 7 | − 'Data Compression & Archiving' => 'Data Compression', | |
| 8 | − 'Generic Operating System' => 'Operating System', | |
| 9 | − 'Graphical User Interfaces with Tk' => 'Tk', | |
| 10 | − 'Internet Data Handling' => 'Internet Data', | |
| 11 | − 'Internet Protocols & Support' => 'Internet', | |
| 12 | − 'Interprocess Communication & Networking' => 'Networking', | |
| 13 | − 'Program Frameworks' => 'Frameworks', | |
| 14 | − 'Structured Markup Processing Tools' => 'Structured Markup' } | |
| 5 | + 'contextvars — Context Variables' => 'Context Variables', | |
| 6 | + 'Cryptographic' => 'Cryptography', | |
| 7 | + 'Custom Interpreters' => 'Interpreters', | |
| 8 | + 'Data Compression & Archiving' => 'Data Compression', | |
| 9 | + 'email — An email & MIME handling package' => 'Email', | |
| 10 | + 'Generic Operating System' => 'Operating System', | |
| 11 | + 'Graphical User Interfaces with Tk' => 'Tk', | |
| 12 | + 'Internet Data Handling' => 'Internet Data', | |
| 13 | + 'Internet Protocols & Support' => 'Internet', | |
| 14 | + 'Interprocess Communication & Networking' => 'Networking', | |
| 15 | + 'Program Frameworks' => 'Frameworks', | |
| 16 | + 'Structured Markup Processing Tools' => 'Structured Markup' } | |
| 15 | 17 | |
| 16 | 18 | def get_name |
| 17 | 19 | name = at_css('h1').content |
| @@ -0,0 +1,31 @@ | ||
| 1 | +module Docs | |
| 2 | + class Qt | |
| 3 | + class CleanHtmlFilter < Filter | |
| 4 | + def call | |
| 5 | + # Remove unneeded elements | |
| 6 | + css('.copy-notice, .navigationbar, .headerNavi, .footerNavi, .sidebar, .toc, #ec_toggle', '.landingicons img', 'br').remove | |
| 7 | + | |
| 8 | + # QML property/method header | |
| 9 | + css('.qmlproto').each do |node| | |
| 10 | + id = node.at_css('tr')['id'] | |
| 11 | + node.inner_html = node.at_css('td').inner_html | |
| 12 | + node.name = 'h3' | |
| 13 | + node['id'] = id | |
| 14 | + end | |
| 15 | + | |
| 16 | + css('.main-rounded', '.content', '.line', '.context', '.descr', '.types', '.func', '.table', 'div:not([class])', '.landing', '.col-1', '.heading', '.qmlitem', '.qmldoc', 'div.pre').each do |node| | |
| 17 | + node.before(node.children).remove | |
| 18 | + end | |
| 19 | + | |
| 20 | + css('pre').each do |node| | |
| 21 | + node.content = node.content | |
| 22 | + node['data-language'] = 'cpp' if node['class'].include?('cpp') | |
| 23 | + node['data-language'] = 'qml' if node['class'].include?('qml') | |
| 24 | + node.remove_attribute('class') | |
| 25 | + end | |
| 26 | + | |
| 27 | + doc | |
| 28 | + end | |
| 29 | + end | |
| 30 | + end | |
| 31 | +end | |
| @@ -0,0 +1,141 @@ | ||
| 1 | +# frozen_string_literal: true | |
| 2 | + | |
| 3 | +module Docs | |
| 4 | + class Qt | |
| 5 | + class EntriesFilter < Docs::EntriesFilter | |
| 6 | + def get_name | |
| 7 | + header = at_css('h1.title + .small-subtitle a') || at_css('h1.title') || at_css('.context h2') | |
| 8 | + name = header.content | |
| 9 | + name.sub! %r{ Class$}, ' (class)' | |
| 10 | + name.sub! %r{ QML Type$}, ' (QML type)' | |
| 11 | + name.sub! %r{ QML Basic Type$}, ' (QML basic type)' | |
| 12 | + | |
| 13 | + # Add '(class)' to the class pages where the subtitle name is used (e.g. qset-const-iterator.html) | |
| 14 | + if at_css('h1.title').content.strip.end_with?(' Class') && !name.include?('(class)') | |
| 15 | + name = "#{name} (class) " | |
| 16 | + end | |
| 17 | + | |
| 18 | + name | |
| 19 | + end | |
| 20 | + | |
| 21 | + def get_type | |
| 22 | + breadcrumb = css('#main_title_bar + ul li') | |
| 23 | + category = if breadcrumb.length < 3 | |
| 24 | + then 'Qt'.dup | |
| 25 | + else breadcrumb.at(1).content | |
| 26 | + end | |
| 27 | + | |
| 28 | + if category == 'Qt' | |
| 29 | + return 'Qt Platforms' if name.include?(' for ') || name == 'Qt Platform Abstraction' | |
| 30 | + return 'Qt Quick' if name == 'Qt Quick Test' || name == 'Qt Quick Test Reference Documentation' | |
| 31 | + | |
| 32 | + alwaysInQt = ['Qt Configure Options', 'Qt Image Formats'] | |
| 33 | + category = name if name.start_with?('Qt ') && !alwaysInQt.include?(name) | |
| 34 | + end | |
| 35 | + | |
| 36 | + qtPlatformsTypes = ['Qt Platform Headers', 'Qt Android Extras', 'Qt Mac Extras', 'Qt Windows Extras', 'Qt X11 Extras'] | |
| 37 | + return 'Qt Platforms' if qtPlatformsTypes.include?(category) | |
| 38 | + | |
| 39 | + category.remove!(' Manual') | |
| 40 | + category | |
| 41 | + end | |
| 42 | + | |
| 43 | + def include_default_entry? | |
| 44 | + name != 'All Classes' && name != 'All QML Types' | |
| 45 | + end | |
| 46 | + | |
| 47 | + def additional_entries | |
| 48 | + entries = [] | |
| 49 | + titles = [] | |
| 50 | + | |
| 51 | + className = at_css('h1.title').content.strip.remove(' Class') | |
| 52 | + displayedClassName = className | |
| 53 | + alternativeClassName = at_css('h1.title + .small-subtitle a') | |
| 54 | + displayedClassName = alternativeClassName.content if alternativeClassName | |
| 55 | + | |
| 56 | + # Functions signatures | |
| 57 | + css('h3.fn').each do |node| | |
| 58 | + header = node.clone | |
| 59 | + | |
| 60 | + # Skip typenames | |
| 61 | + next if header.content.strip.start_with?('typename ') | |
| 62 | + | |
| 63 | + # Remove leading <a name=""> | |
| 64 | + header.children.css('a[name]').remove | |
| 65 | + | |
| 66 | + # Remove leading <code> tag (virtual/static/… attributes) | |
| 67 | + code = header.children.first | |
| 68 | + code.remove if code.name == 'code' | |
| 69 | + | |
| 70 | + # Remove leading ‘const’ | |
| 71 | + header.children.first.remove if header.content.strip.start_with?('const ') | |
| 72 | + | |
| 73 | + # Remove return type | |
| 74 | + returnType = header.children.first | |
| 75 | + returnType.remove if returnType['class'] == 'type' | |
| 76 | + | |
| 77 | + title = header.content.strip | |
| 78 | + | |
| 79 | + # Remove leading '&'/'*' | |
| 80 | + title[0] = '' if title[0] == '&' || title[0] == '*' | |
| 81 | + | |
| 82 | + # Ignore operator overloads | |
| 83 | + next if title.start_with?('operator') | |
| 84 | + | |
| 85 | + # Remove function parameters | |
| 86 | + title.sub! %r{\(.*\)}, '()' | |
| 87 | + | |
| 88 | + # Remove template generics | |
| 89 | + title.remove!(%r{^<.*> }) | |
| 90 | + | |
| 91 | + # Remove ‘const’ at the end | |
| 92 | + title.remove!(%r{ const$}) | |
| 93 | + | |
| 94 | + # Enum/typedef formatting | |
| 95 | + title.sub! %r{(enum|typedef) (.*)}, '\2 (\1)' | |
| 96 | + | |
| 97 | + # Remove property type | |
| 98 | + title = "#{displayedClassName}::#{title}" if title.sub!(%r{ : .*$}, '') | |
| 99 | + | |
| 100 | + # Replace the class name by the alternative class name if available | |
| 101 | + title = title.sub(className, displayedClassName) if alternativeClassName | |
| 102 | + | |
| 103 | + unless titles.include?(title) # Remove duplicates (function overloading) | |
| 104 | + entries << [title, header['id']] | |
| 105 | + titles.push title | |
| 106 | + end | |
| 107 | + end | |
| 108 | + | |
| 109 | + # QML properties/functions | |
| 110 | + qmlTypeName = at_css('h1.title').content.remove(' QML Type', '') | |
| 111 | + css('.qmlproto').each do |node| | |
| 112 | + title = node.content.strip | |
| 113 | + id = node.at_css('tr')['id'] | |
| 114 | + | |
| 115 | + # Remove options | |
| 116 | + title.remove!(%r{^\[.*\] }) | |
| 117 | + | |
| 118 | + # Remove function parameters | |
| 119 | + title.sub! %r{\(.*\)}, '()' | |
| 120 | + | |
| 121 | + # Remove property type | |
| 122 | + title.remove!(%r{ : .*$}) | |
| 123 | + | |
| 124 | + # Remove return type | |
| 125 | + title.remove!(%r{.* }) | |
| 126 | + | |
| 127 | + # Remove return type | |
| 128 | + title.remove!(%r{.* }) | |
| 129 | + | |
| 130 | + title = "#{qmlTypeName}.#{title.strip}" | |
| 131 | + unless titles.include?(title) # Remove duplicates (function overloading) | |
| 132 | + entries << [title, id] | |
| 133 | + titles.push(title) | |
| 134 | + end | |
| 135 | + end | |
| 136 | + | |
| 137 | + entries | |
| 138 | + end | |
| 139 | + end | |
| 140 | + end | |
| 141 | +end | |
| @@ -12,7 +12,7 @@ module Docs · 11 unmodified lines | ||
| 12 | 12 | when 'HDEL' then 'Hashes' |
| 13 | 13 | when 'BLPOP' then 'Lists' |
| 14 | 14 | when 'SADD' then 'Sets' |
| 15 | − when 'ZADD' then 'Sorted Sets' | |
| 15 | + when 'BZPOPMAX' then 'Sorted Sets' | |
| 16 | 16 | when 'PSUBSCRIBE' then 'Pub/Sub' |
| 17 | 17 | when 'DISCARD' then 'Transactions' |
| 18 | 18 | when 'EVAL' then 'Scripting' |
| @@ -21,6 +21,7 @@ module Docs · 2 unmodified lines | ||
| 21 | 21 | when 'PFADD' then 'HyperLogLog' |
| 22 | 22 | when 'CLUSTER ADDSLOTS' then 'Cluster' |
| 23 | 23 | when 'GEOADD' then 'Geo' |
| 24 | + when 'XADD' then 'Stream' | |
| 24 | 25 | else 'Miscellaneous' |
| 25 | 26 | end |
| 26 | 27 | end |
| @@ -2,10 +2,8 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Rust |
| 3 | 3 | class CleanHtmlFilter < Filter |
| 4 | 4 | def call |
| 5 | − puts subpath if at_css('#versioninfo') | |
| 6 | − | |
| 7 | 5 | if slug.start_with?('book') || slug.start_with?('reference') |
| 8 | − @doc = at_css('#content') | |
| 6 | + @doc = at_css('#content main') | |
| 9 | 7 | elsif slug == 'error-index' |
| 10 | 8 | css('.error-undescribed').remove |
| 11 | 9 | |
| @@ -29,12 +27,16 @@ module Docs · 17 unmodified lines | ||
| 29 | 27 | |
| 30 | 28 | css('.rusttest', '.test-arrow', 'hr').remove |
| 31 | 29 | |
| 30 | + css('.docblock.attributes').each do |node| | |
| 31 | + node.remove if node.content.include?('#[must_use]') | |
| 32 | + end | |
| 33 | + | |
| 32 | 34 | css('a.header').each do |node| |
| 33 | − node.first_element_child['id'] = node['name'] | |
| 35 | + node.first_element_child['id'] = node['name'] || node['id'] | |
| 34 | 36 | node.before(node.children).remove |
| 35 | 37 | end |
| 36 | 38 | |
| 37 | − css('.docblock > h1').each { |node| node.name = 'h4' } | |
| 39 | + css('.docblock > h1:not(.section-header)').each { |node| node.name = 'h4' } | |
| 38 | 40 | css('h2.section-header').each { |node| node.name = 'h3' } |
| 39 | 41 | css('h1.section-header').each { |node| node.name = 'h2' } |
| 40 | 42 | |
| @@ -44,7 +46,7 @@ module Docs · 3 unmodified lines | ||
| 44 | 46 | end |
| 45 | 47 | end |
| 46 | 48 | |
| 47 | − css('> .impl-items', '> .docblock', 'pre > pre').each do |node| | |
| 49 | + css('> .impl-items', '> .docblock', 'pre > pre', '.tooltiptext', '.tooltip').each do |node| | |
| 48 | 50 | node.before(node.children).remove |
| 49 | 51 | end |
| 50 | 52 | |
| @@ -62,6 +64,35 @@ module Docs · 11 unmodified lines | ||
| 62 | 64 | node['data-language'] = 'rust' if node['class'] && node['class'].include?('rust') |
| 63 | 65 | end |
| 64 | 66 | |
| 67 | + doc.first_element_child.name = 'h1' if doc.first_element_child.name = 'h2' | |
| 68 | + at_css('h1').content = 'Rust Documentation' if root_page? | |
| 69 | + | |
| 70 | + css('.table-display').each do |node| | |
| 71 | + node.css('td').each do |td| | |
| 72 | + node.before(td.children) | |
| 73 | + end | |
| 74 | + node.remove | |
| 75 | + end | |
| 76 | + | |
| 77 | + css('h2 .important-traits', 'h3 .important-traits', 'h4 .important-traits').each do |node| | |
| 78 | + content = node.at_css('.content.hidden .content') | |
| 79 | + node.at_css('.content.hidden').replace(content) if content | |
| 80 | + node.parent.after(node) | |
| 81 | + end | |
| 82 | + | |
| 83 | + css('code.content').each do |node| | |
| 84 | + node.name = 'pre' | |
| 85 | + node.css('.fmt-newline').each do |line| | |
| 86 | + line.inner_html = line.inner_html + "\n" | |
| 87 | + end | |
| 88 | + node.inner_html = node.inner_html.gsub('<br>', "\n") | |
| 89 | + node.content = node.content | |
| 90 | + end | |
| 91 | + | |
| 92 | + css('.since + .srclink').each do |node| | |
| 93 | + node.previous_element.before(node) | |
| 94 | + end | |
| 95 | + | |
| 65 | 96 | doc |
| 66 | 97 | end |
| 67 | 98 | end |
| @@ -42,11 +42,14 @@ module Docs · 41 unmodified lines | ||
| 42 | 42 | entries << [node.content, node['id']] unless node.content.include?('Note:') |
| 43 | 43 | end |
| 44 | 44 | else |
| 45 | − css('#methods + * + div > .method', '#required-methods + div > .method', '#provided-methods + div > .method').map do |node| | |
| 46 | − name = node.at_css('.fnname').content | |
| 47 | − name.prepend "#{self.name}::" | |
| 48 | − [name, node['id']] | |
| 49 | − end | |
| 45 | + css('.method') | |
| 46 | + .select {|node| !node.at_css('.fnname').nil?} | |
| 47 | + .map {|node| | |
| 48 | + name = node.at_css('.fnname').content | |
| 49 | + name.prepend "#{self.name}::" | |
| 50 | + [name, node['id']] | |
| 51 | + } | |
| 52 | + .uniq {|item| item[0]} | |
| 50 | 53 | end |
| 51 | 54 | end |
| 52 | 55 | end |
| @@ -9,6 +9,7 @@ module Docs · 8 unmodified lines | ||
| 9 | 9 | |
| 10 | 10 | def get_type |
| 11 | 11 | return 'Declaration Files' if subpath.include?('declaration-files') |
| 12 | + return 'Project Configuration' if slug == 'handbook/configuring-watch' | |
| 12 | 13 | type = at_css('#main-nav a.active').ancestors('.panel').first.at_css('> a').content |
| 13 | 14 | type = name if type == 'Handbook' |
| 14 | 15 | type |
| @@ -3,7 +3,7 @@ module Docs · 2 unmodified lines | ||
| 3 | 3 | self.name = 'Apache HTTP Server' |
| 4 | 4 | self.slug = 'apache_http_server' |
| 5 | 5 | self.type = 'apache' |
| 6 | − self.release = '2.4.33' | |
| 6 | + self.release = '2.4.34' | |
| 7 | 7 | self.base_url = 'https://httpd.apache.org/docs/2.4/en/' |
| 8 | 8 | self.links = { |
| 9 | 9 | home: 'https://httpd.apache.org/' |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class ApachePig < UrlScraper |
| 3 | 3 | self.name = 'Apache Pig' |
| 4 | 4 | self.slug = 'apache_pig' |
| 5 | − self.type = 'apache_pig' | |
| 5 | + self.type = 'simple' | |
| 6 | 6 | self.links = { |
| 7 | 7 | home: 'https://pig.apache.org/' |
| 8 | 8 | } |
| @@ -0,0 +1,21 @@ | ||
| 1 | +module Docs | |
| 2 | + class Bash < UrlScraper | |
| 3 | + self.type = 'bash' | |
| 4 | + self.release = '4.4' | |
| 5 | + self.base_url = 'https://www.gnu.org/software/bash/manual' | |
| 6 | + self.root_path = '/html_node/index.html' | |
| 7 | + self.links = { | |
| 8 | + home: 'https://www.gnu.org/software/bash/', | |
| 9 | + code: 'http://git.savannah.gnu.org/cgit/bash.git' | |
| 10 | + } | |
| 11 | + | |
| 12 | + html_filters.push 'bash/entries', 'bash/clean_html' | |
| 13 | + | |
| 14 | + options[:only_patterns] = [/\/html_node\//] | |
| 15 | + | |
| 16 | + options[:attribution] = <<-HTML | |
| 17 | + Copyright © 2000, 2001, 2002, 2007, 2008 Free Software Foundation, Inc.<br> | |
| 18 | + Licensed under the GNU Free Documentation License. | |
| 19 | + HTML | |
| 20 | + end | |
| 21 | +end | |
| @@ -16,7 +16,7 @@ module Docs · 15 unmodified lines | ||
| 16 | 16 | HTML |
| 17 | 17 | |
| 18 | 18 | version '4' do |
| 19 | − self.release = '4.1.1' | |
| 19 | + self.release = '4.1.3' | |
| 20 | 20 | self.base_url = 'https://getbootstrap.com/docs/4.1/' |
| 21 | 21 | self.root_path = 'getting-started/introduction/' |
| 22 | 22 | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Bower < UrlScraper |
| 3 | 3 | self.name = 'Bower' |
| 4 | − self.type = 'bower' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '1.8.4' |
| 6 | 6 | self.base_url = 'https://bower.io/docs/' |
| 7 | 7 | self.root_path = 'api' |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Chai < UrlScraper |
| 3 | 3 | self.name = 'Chai' |
| 4 | − self.type = 'chai' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '4.1.0' |
| 6 | 6 | self.base_url = 'http://chaijs.com' |
| 7 | 7 | self.root_path = '/api/' |
| @@ -16,12 +16,22 @@ module Docs · 15 unmodified lines | ||
| 16 | 16 | options[:skip_patterns] = [/\Agenerator/, /\Ainclude/, /\Arelease/] |
| 17 | 17 | |
| 18 | 18 | options[:attribution] = <<-HTML |
| 19 | − © 2000–2017 Kitware, Inc. and Contributors<br> | |
| 19 | + © 2000–2018 Kitware, Inc. and Contributors<br> | |
| 20 | 20 | Licensed under the BSD 3-clause License. |
| 21 | 21 | HTML |
| 22 | 22 | |
| 23 | + version '3.12' do | |
| 24 | + self.release = '3.12.1' | |
| 25 | + self.base_url = 'https://cmake.org/cmake/help/v3.12/' | |
| 26 | + end | |
| 27 | + | |
| 28 | + version '3.11' do | |
| 29 | + self.release = '3.11.4' | |
| 30 | + self.base_url = 'https://cmake.org/cmake/help/v3.11/' | |
| 31 | + end | |
| 32 | + | |
| 23 | 33 | version '3.10' do |
| 24 | − self.release = '3.10.1' | |
| 34 | + self.release = '3.10.3' | |
| 25 | 35 | self.base_url = 'https://cmake.org/cmake/help/v3.10/' |
| 26 | 36 | end |
| 27 | 37 | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Codeceptjs < UrlScraper |
| 3 | 3 | self.name = 'CodeceptJS' |
| 4 | − self.type = 'codeceptjs' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.root_path = 'index.html' |
| 6 | 6 | self.release = '1.3.1' |
| 7 | 7 | self.base_url = 'https://codecept.io/' |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Crystal < UrlScraper |
| 3 | 3 | self.type = 'crystal' |
| 4 | − self.release = '0.25.1' | |
| 4 | + self.release = '0.26.0' | |
| 5 | 5 | self.base_url = 'https://crystal-lang.org/' |
| 6 | 6 | self.root_path = "api/#{release}/index.html" |
| 7 | 7 | self.initial_paths = %w(docs/index.html) |
| @@ -0,0 +1,37 @@ | ||
| 1 | +module Docs | |
| 2 | + class Dart < FileScraper | |
| 3 | + self.type = 'dart' | |
| 4 | + self.root_path = 'index.html' | |
| 5 | + self.links = { | |
| 6 | + home: 'https://www.dartlang.org/', | |
| 7 | + code: 'https://github.com/dart-lang/sdk' | |
| 8 | + } | |
| 9 | + | |
| 10 | + html_filters.push 'dart/entries', 'dart/clean_html' | |
| 11 | + | |
| 12 | + options[:fix_urls] = ->(url) do | |
| 13 | + # localhost/dart-web_audio/..dart-io/dart-io-library.html > localhost/dart-io/dart-io-library.html | |
| 14 | + url.remove!(/[^\/]+\/\.\./) | |
| 15 | + url | |
| 16 | + end | |
| 17 | + | |
| 18 | + options[:attribution] = <<-HTML | |
| 19 | + © 2012 the Dart project authors<br> | |
| 20 | + Licensed under the Creative Commons Attribution-ShareAlike License v4.0. | |
| 21 | + HTML | |
| 22 | + | |
| 23 | + # Download the documentation from https://www.dartlang.org/tools/sdk/archive | |
| 24 | + | |
| 25 | + version '2' do | |
| 26 | + self.release = '2.0.0' | |
| 27 | + self.dir = '/Users/Thibaut/DevDocs/Docs/Dart2' | |
| 28 | + self.base_url = "https://api.dartlang.org/stable/#{release}/" | |
| 29 | + end | |
| 30 | + | |
| 31 | + version '1' do | |
| 32 | + self.release = '1.24.3' | |
| 33 | + self.dir = '/Users/Thibaut/DevDocs/Docs/Dart1' | |
| 34 | + self.base_url = "https://api.dartlang.org/stable/#{release}/" | |
| 35 | + end | |
| 36 | + end | |
| 37 | +end | |
| @@ -34,6 +34,12 @@ module Docs · 33 unmodified lines | ||
| 34 | 34 | Licensed under the BSD License. |
| 35 | 35 | HTML |
| 36 | 36 | |
| 37 | + version '2.1' do | |
| 38 | + self.release = '2.1.0' | |
| 39 | + self.dir = '/Users/Thibaut/DevDocs/Docs/Django21' | |
| 40 | + self.base_url = 'https://docs.djangoproject.com/en/2.1/' | |
| 41 | + end | |
| 42 | + | |
| 37 | 43 | version '2.0' do |
| 38 | 44 | self.release = '2.0.7' |
| 39 | 45 | self.dir = '/Users/Thibaut/DevDocs/Docs/Django20' |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Docker < UrlScraper |
| 3 | − self.type = 'docker' | |
| 3 | + self.type = 'simple' | |
| 4 | 4 | self.links = { |
| 5 | 5 | home: 'https://docker.com/', |
| 6 | 6 | code: 'https://github.com/docker/docker' |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Electron < UrlScraper |
| 3 | − self.type = 'electron' | |
| 3 | + self.type = 'simple' | |
| 4 | 4 | self.base_url = 'https://electronjs.org/docs' |
| 5 | 5 | self.release = '2.0.2' |
| 6 | 6 | self.links = { |
| @@ -33,6 +33,19 @@ module Docs · 32 unmodified lines | ||
| 33 | 33 | "https://elixir-lang.org/getting-started/introduction.html" ] |
| 34 | 34 | end |
| 35 | 35 | |
| 36 | + version '1.7' do | |
| 37 | + self.release = '1.7.3' | |
| 38 | + self.base_urls = [ | |
| 39 | + "https://hexdocs.pm/elixir/#{release}/", | |
| 40 | + "https://hexdocs.pm/eex/#{release}/", | |
| 41 | + "https://hexdocs.pm/ex_unit/#{release}/", | |
| 42 | + "https://hexdocs.pm/iex/#{release}/", | |
| 43 | + "https://hexdocs.pm/logger/#{release}/", | |
| 44 | + "https://hexdocs.pm/mix/#{release}/", | |
| 45 | + 'https://elixir-lang.org/getting-started/' | |
| 46 | + ] | |
| 47 | + end | |
| 48 | + | |
| 36 | 49 | version '1.6' do |
| 37 | 50 | self.release = '1.6.5' |
| 38 | 51 | self.base_urls = [ |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Express < UrlScraper |
| 3 | 3 | self.name = 'Express' |
| 4 | 4 | self.type = 'express' |
| 5 | − self.release = '4.16.1' | |
| 5 | + self.release = '4.16.3' | |
| 6 | 6 | self.base_url = 'http://expressjs.com/en/' |
| 7 | 7 | self.root_path = '4x/api.html' |
| 8 | 8 | self.initial_paths = %w( |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Fish < UrlScraper |
| 3 | 3 | self.name = 'Fish' |
| 4 | − self.type = 'fish' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.root_path = 'index.html' |
| 6 | 6 | self.links = { |
| 7 | 7 | home: 'https://fishshell.com/', |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Flow < UrlScraper |
| 3 | − self.type = 'flow' | |
| 4 | − self.release = '0.75.0' | |
| 3 | + self.type = 'simple' | |
| 4 | + self.release = '0.79.1' | |
| 5 | 5 | self.base_url = 'https://flow.org/en/docs/' |
| 6 | 6 | self.links = { |
| 7 | 7 | home: 'https://flow.org/', |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Gnu < FileScraper |
| 3 | − self.type = 'gnu' | |
| 3 | + self.type = 'simple' | |
| 4 | 4 | self.root_path = 'index.html' |
| 5 | 5 | self.abstract = 'true' |
| 6 | 6 | |
| @@ -0,0 +1,21 @@ | ||
| 1 | +module Docs | |
| 2 | + class Graphite < UrlScraper | |
| 3 | + self.type = 'graphite' | |
| 4 | + self.release = '1.1.3' | |
| 5 | + self.base_url = 'https://graphite.readthedocs.io/en/latest/' | |
| 6 | + self.links = { | |
| 7 | + code: 'https://github.com/graphite-project/graphite-web' | |
| 8 | + } | |
| 9 | + | |
| 10 | + html_filters.push 'graphite/entries', 'graphite/clean_html' | |
| 11 | + | |
| 12 | + options[:container] = '.document > div' | |
| 13 | + options[:skip] = %w(releases.html who-is-using.html composer.html search.html py-modindex.html genindex.html) | |
| 14 | + | |
| 15 | + options[:attribution] = <<-HTML | |
| 16 | + © 2008–2012 Chris Davis<br> | |
| 17 | + © 2011–2016 The Graphite Project<br> | |
| 18 | + Licensed under the Apache License, Version 2.0. | |
| 19 | + HTML | |
| 20 | + end | |
| 21 | +end | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Grunt < UrlScraper |
| 3 | 3 | self.name = 'Grunt' |
| 4 | − self.type = 'grunt' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '1.0.1' |
| 6 | 6 | self.base_url = 'https://gruntjs.com/' |
| 7 | 7 | self.root_path = 'getting-started' |
| @@ -0,0 +1,23 @@ | ||
| 1 | +module Docs | |
| 2 | + class Handlebars < UrlScraper | |
| 3 | + self.name = 'Handlebars.js' | |
| 4 | + self.slug = 'handlebars' | |
| 5 | + self.type = 'simple' | |
| 6 | + self.release = '4.0.12' | |
| 7 | + self.base_url = 'https://handlebarsjs.com/' | |
| 8 | + self.links = { | |
| 9 | + home: 'https://handlebarsjs.com/', | |
| 10 | + code: 'https://github.com/wycats/handlebars.js/' | |
| 11 | + } | |
| 12 | + | |
| 13 | + html_filters.push 'handlebars/entries', 'handlebars/clean_html', 'title' | |
| 14 | + | |
| 15 | + options[:container] = '#contents' | |
| 16 | + options[:root_title] = 'Handlebars.js' | |
| 17 | + | |
| 18 | + options[:attribution] = <<-HTML | |
| 19 | + © 2011–2017 by Yehuda Katz<br> | |
| 20 | + Licensed under the MIT License. | |
| 21 | + HTML | |
| 22 | + end | |
| 23 | +end | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Haxe < UrlScraper |
| 3 | 3 | self.name = 'Haxe' |
| 4 | − self.type = 'haxe' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '3.4.7' |
| 6 | 6 | self.base_url = 'https://api.haxe.org/' |
| 7 | 7 | |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Immutable < UrlScraper |
| 3 | 3 | self.name = 'Immutable.js' |
| 4 | 4 | self.slug = 'immutable' |
| 5 | − self.type = 'immutable' | |
| 5 | + self.type = 'simple' | |
| 6 | 6 | self.release = '3.8.1' |
| 7 | 7 | self.base_url = 'https://facebook.github.io/immutable-js/docs/' |
| 8 | 8 | self.links = { |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Influxdata < UrlScraper |
| 3 | 3 | self.name = 'InfluxData' |
| 4 | − self.type = 'influxdata' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '1.3' |
| 6 | 6 | self.base_url = 'https://docs.influxdata.com/' |
| 7 | 7 | self.links = { |
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Jasmine < UrlScraper |
| 3 | − self.type = 'jasmine' | |
| 4 | − self.release = '3.1.0' | |
| 5 | − self.base_url = 'https://jasmine.github.io/api/3.0/' | |
| 3 | + self.type = 'simple' | |
| 4 | + self.release = '3.2.1' | |
| 5 | + self.base_url = 'https://jasmine.github.io/api/3.2/' | |
| 6 | 6 | self.root_path = 'index.html' |
| 7 | 7 | self.links = { |
| 8 | 8 | home: 'https://jasmine.github.io/', |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Jest < UrlScraper |
| 3 | − self.type = 'jest' | |
| 4 | − self.release = '23.3.0' | |
| 3 | + self.type = 'simple' | |
| 4 | + self.release = '23.5.0' | |
| 5 | 5 | self.base_url = 'https://jestjs.io/docs/en/' |
| 6 | 6 | self.root_path = 'getting-started' |
| 7 | 7 | self.links = { |
| @@ -12,9 +12,29 @@ module Docs · 11 unmodified lines | ||
| 12 | 12 | Licensed under the MIT License. |
| 13 | 13 | HTML |
| 14 | 14 | |
| 15 | + version '1.0' do | |
| 16 | + self.release = '1.0.0' | |
| 17 | + self.base_url = "https://docs.julialang.org/en/v#{release}/" | |
| 18 | + self.type = 'julia' | |
| 19 | + | |
| 20 | + html_filters.push 'julia/entries', 'julia/clean_html' | |
| 21 | + | |
| 22 | + options[:container] = '#docs' | |
| 23 | + end | |
| 24 | + | |
| 25 | + version '0.7' do | |
| 26 | + self.release = '0.7.0' | |
| 27 | + self.base_url = "https://docs.julialang.org/en/v#{release}/" | |
| 28 | + self.type = 'julia' | |
| 29 | + | |
| 30 | + html_filters.push 'julia/entries', 'julia/clean_html' | |
| 31 | + | |
| 32 | + options[:container] = '#docs' | |
| 33 | + end | |
| 34 | + | |
| 15 | 35 | version '0.6' do |
| 16 | 36 | self.release = '0.6.2' |
| 17 | − self.base_url = 'https://docs.julialang.org/en/release-0.6/' | |
| 37 | + self.base_url = "https://docs.julialang.org/en/v#{release}/" | |
| 18 | 38 | self.type = 'julia' |
| 19 | 39 | |
| 20 | 40 | html_filters.push 'julia/entries', 'julia/clean_html' |
| @@ -24,7 +44,7 @@ module Docs · 3 unmodified lines | ||
| 24 | 44 | |
| 25 | 45 | version '0.5' do |
| 26 | 46 | self.release = '0.5.2' |
| 27 | − self.base_url = 'https://docs.julialang.org/en/release-0.5/' | |
| 47 | + self.base_url = "https://docs.julialang.org/en/v#{release}/" | |
| 28 | 48 | self.type = 'sphinx_simple' |
| 29 | 49 | |
| 30 | 50 | html_filters.push 'julia/entries_sphinx', 'julia/clean_html_sphinx', 'sphinx/clean_html' |
| @@ -29,8 +29,21 @@ module Docs · 28 unmodified lines | ||
| 29 | 29 | Laravel is a trademark of Taylor Otwell. |
| 30 | 30 | HTML |
| 31 | 31 | |
| 32 | + version '5.7' do | |
| 33 | + self.release = '5.7.7' | |
| 34 | + self.root_path = '/api/5.7/index.html' | |
| 35 | + self.initial_paths = %w(/docs/5.7/installation /api/5.7/classes.html) | |
| 36 | + | |
| 37 | + options[:only_patterns] = [%r{\A/api/5\.7/}, %r{\A/docs/5\.7/}] | |
| 38 | + | |
| 39 | + options[:fix_urls] = ->(url) do | |
| 40 | + url.sub! %r{#{Regexp.escape(Laravel.base_url)}/docs\/(?!\d)}, "#{Laravel.base_url}/docs/5.7/" | |
| 41 | + url | |
| 42 | + end | |
| 43 | + end | |
| 44 | + | |
| 32 | 45 | version '5.6' do |
| 33 | − self.release = '5.6.12' | |
| 46 | + self.release = '5.6.33' | |
| 34 | 47 | self.root_path = '/api/5.6/index.html' |
| 35 | 48 | self.initial_paths = %w(/docs/5.6/installation /api/5.6/classes.html) |
| 36 | 49 | |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Less < UrlScraper |
| 3 | − self.type = 'less' | |
| 3 | + self.type = 'simple' | |
| 4 | 4 | self.release = '2.7.2' |
| 5 | 5 | self.base_url = 'http://lesscss.org' |
| 6 | 6 | self.root_path = '/features' |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Lodash < UrlScraper |
| 3 | 3 | self.name = 'lodash' |
| 4 | 4 | self.slug = 'lodash' |
| 5 | − self.type = 'lodash' | |
| 5 | + self.type = 'simple' | |
| 6 | 6 | self.links = { |
| 7 | 7 | home: 'https://lodash.com/', |
| 8 | 8 | code: 'https://github.com/lodash/lodash/' |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Marionette < UrlScraper |
| 3 | 3 | self.name = 'Marionette.js' |
| 4 | 4 | self.slug = 'marionette' |
| 5 | − self.type = 'marionette' | |
| 5 | + self.type = 'simple' | |
| 6 | 6 | self.root_path = 'index' |
| 7 | 7 | self.links = { |
| 8 | 8 | home: 'https://marionettejs.com/', |
| @@ -18,6 +18,13 @@ module Docs · 9 unmodified lines | ||
| 18 | 18 | Licensed under the MIT License. |
| 19 | 19 | HTML |
| 20 | 20 | |
| 21 | + version '4' do | |
| 22 | + self.release = '4.0.0' | |
| 23 | + self.base_url = "https://marionettejs.com/docs/v#{release}/" | |
| 24 | + | |
| 25 | + html_filters.push 'marionette/entries_v3' | |
| 26 | + end | |
| 27 | + | |
| 21 | 28 | version '3' do |
| 22 | 29 | self.release = '3.5.1' |
| 23 | 30 | self.base_url = "https://marionettejs.com/docs/v#{release}/" |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Markdown < UrlScraper |
| 3 | 3 | self.name = 'Markdown' |
| 4 | − self.type = 'markdown' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.base_url = 'http://daringfireball.net/projects/markdown/syntax' |
| 6 | 6 | |
| 7 | 7 | html_filters.push 'markdown/clean_html', 'markdown/entries' |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Mocha < UrlScraper |
| 3 | − self.type = 'mocha' | |
| 3 | + self.type = 'simple' | |
| 4 | 4 | self.release = '5.0.1' |
| 5 | 5 | self.base_url = 'https://mochajs.org/' |
| 6 | 6 | self.links = { |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Mongoose < UrlScraper |
| 3 | 3 | self.name = 'Mongoose' |
| 4 | − self.type = 'mongoose' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '4.13.1' |
| 6 | 6 | self.base_url = 'http://mongoosejs.com/docs/' |
| 7 | 7 | self.root_path = 'index.html' |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Nim < UrlScraper |
| 3 | − self.type = 'nim' | |
| 3 | + self.type = 'simple' | |
| 4 | 4 | self.release = '0.18.0' |
| 5 | 5 | self.base_url = 'https://nim-lang.org/docs/' |
| 6 | 6 | self.root_path = 'overview.html' |
| @@ -23,17 +23,17 @@ module Docs · 22 unmodified lines | ||
| 23 | 23 | HTML |
| 24 | 24 | |
| 25 | 25 | version do |
| 26 | − self.release = '10.6.0' | |
| 26 | + self.release = '10.9.0' | |
| 27 | 27 | self.base_url = 'https://nodejs.org/dist/latest-v10.x/docs/api/' |
| 28 | 28 | end |
| 29 | 29 | |
| 30 | 30 | version '8 LTS' do |
| 31 | − self.release = '8.11.2' | |
| 31 | + self.release = '8.11.4' | |
| 32 | 32 | self.base_url = 'https://nodejs.org/dist/latest-v8.x/docs/api/' |
| 33 | 33 | end |
| 34 | 34 | |
| 35 | 35 | version '6 LTS' do |
| 36 | − self.release = '6.14.2' | |
| 36 | + self.release = '6.14.4' | |
| 37 | 37 | self.base_url = 'https://nodejs.org/dist/latest-v6.x/docs/api/' |
| 38 | 38 | end |
| 39 | 39 | |
| @@ -2,7 +2,7 @@ module Docs · 1 unmodified line | ||
| 2 | 2 | class Npm < UrlScraper |
| 3 | 3 | self.name = 'npm' |
| 4 | 4 | self.type = 'npm' |
| 5 | − self.release = '6.1.0' | |
| 5 | + self.release = '6.4.0' | |
| 6 | 6 | self.base_url = 'https://docs.npmjs.com/' |
| 7 | 7 | self.force_gzip = true |
| 8 | 8 | self.links = { |
| @@ -4,7 +4,7 @@ module Docs · 3 unmodified lines | ||
| 4 | 4 | |
| 5 | 5 | self.name = 'PHP' |
| 6 | 6 | self.type = 'php' |
| 7 | − self.release = '7.2.5' | |
| 7 | + self.release = '7.2.9' | |
| 8 | 8 | self.base_url = 'https://secure.php.net/manual/en/' |
| 9 | 9 | self.root_path = 'index.html' |
| 10 | 10 | self.initial_paths = %w( |
| @@ -0,0 +1,18 @@ | ||
| 1 | +module Docs | |
| 2 | + class Puppeteer < Github | |
| 3 | + self.release = '1.8.0' | |
| 4 | + self.base_url = 'https://github.com/GoogleChrome/puppeteer/blob/v1.8.0/docs/api.md' | |
| 5 | + self.links = { | |
| 6 | + code: 'https://github.com/GoogleChrome/puppeteer' | |
| 7 | + } | |
| 8 | + | |
| 9 | + html_filters.push 'puppeteer/entries', 'puppeteer/clean_html' | |
| 10 | + | |
| 11 | + options[:container] = '.markdown-body' | |
| 12 | + | |
| 13 | + options[:attribution] = <<-HTML | |
| 14 | + © 2017 Google Inc<br> | |
| 15 | + Licensed under the Apache License 2.0. | |
| 16 | + HTML | |
| 17 | + end | |
| 18 | +end | |
| @@ -0,0 +1,20 @@ | ||
| 1 | +module Docs | |
| 2 | + class Pygame < UrlScraper | |
| 3 | + self.type = 'simple' | |
| 4 | + self.release = '1.9.4' | |
| 5 | + self.root_path = 'py-modindex.html' | |
| 6 | + self.links = { | |
| 7 | + home: 'https://www.pygame.org/', | |
| 8 | + code: 'https://github.com/pygame/pygame' | |
| 9 | + } | |
| 10 | + | |
| 11 | + html_filters.push 'pygame/clean_html', 'pygame/entries' | |
| 12 | + | |
| 13 | + options[:only_patterns] = [/ref\//] | |
| 14 | + | |
| 15 | + options[:attribution] = <<-HTML | |
| 16 | + © Pygame Developpers.<br> | |
| 17 | + Licensed under the GNU LGPL License version 2.1. | |
| 18 | + HTML | |
| 19 | + end | |
| 20 | +end | |
| @@ -0,0 +1,121 @@ | ||
| 1 | +module Docs | |
| 2 | + class Qt < UrlScraper | |
| 3 | + self.name = 'Qt' | |
| 4 | + self.type = 'qt' | |
| 5 | + self.initial_paths = %w(classes.html qmltypes.html) | |
| 6 | + self.root_path = 'index.html' | |
| 7 | + self.links = { | |
| 8 | + home: 'https://www.qt.io', | |
| 9 | + code: 'https://code.qt.io/cgit/' | |
| 10 | + } | |
| 11 | + | |
| 12 | + html_filters.push 'qt/entries', 'qt/clean_html' | |
| 13 | + | |
| 14 | + options[:container] = '.main' | |
| 15 | + options[:max_image_size] = 156_000 | |
| 16 | + options[:skip_patterns] = [ | |
| 17 | + # License, copyright attributions | |
| 18 | + /3rdparty/, | |
| 19 | + /attribution/, | |
| 20 | + /license/, | |
| 21 | + /licensing/, | |
| 22 | + | |
| 23 | + # Examples, guides, tutorials | |
| 24 | + /example/, | |
| 25 | + /guide$/, | |
| 26 | + /tutorial/, | |
| 27 | + /porting/, | |
| 28 | + /usecase/, | |
| 29 | + /topic/, | |
| 30 | + /^modelview/, | |
| 31 | + /deploy(ing|ment)/, | |
| 32 | + /building/, | |
| 33 | + | |
| 34 | + # Old versions, changelog | |
| 35 | + /obsolete/, | |
| 36 | + /compatibility/, | |
| 37 | + /^whatsnew/, | |
| 38 | + /^newclasses/, | |
| 39 | + | |
| 40 | + # Deprecated modules | |
| 41 | + /(qtopengl|qgl)/, | |
| 42 | + /qt?script/, | |
| 43 | + | |
| 44 | + # Indexes | |
| 45 | + /members/, | |
| 46 | + /module/, | |
| 47 | + /overview/, | |
| 48 | + /^qopenglfunctions/, | |
| 49 | + | |
| 50 | + # Tooling | |
| 51 | + /^(qt)?(linguist|assistant|qdbusviewer)/, | |
| 52 | + ] | |
| 53 | + | |
| 54 | + options[:skip] = [ | |
| 55 | + "qt5-intro.html", | |
| 56 | + "compatmap.html", | |
| 57 | + | |
| 58 | + # Indexes | |
| 59 | + "classes.html", | |
| 60 | + "qtmodules.html", | |
| 61 | + "modules-qml.html", | |
| 62 | + "modules-cpp.html", | |
| 63 | + "functions.html", | |
| 64 | + "namespaces.html", | |
| 65 | + "qmltypes.html", | |
| 66 | + "qt3d-qml.html", | |
| 67 | + "qmlbasictypes.html", | |
| 68 | + "guibooks.html", | |
| 69 | + "annotated.html", | |
| 70 | + "overviews-main.html", | |
| 71 | + "reference-overview.html", | |
| 72 | + | |
| 73 | + # Tutorials | |
| 74 | + "qtvirtualkeyboard-build.html", | |
| 75 | + | |
| 76 | + # Copyright | |
| 77 | + "trademarks.html", | |
| 78 | + "lgpl.html", | |
| 79 | + "bughowto.html", | |
| 80 | + | |
| 81 | + # Changelogs | |
| 82 | + "changes.html", | |
| 83 | + "qtlocation-changes.html", | |
| 84 | + "sourcebreaks.html", | |
| 85 | + | |
| 86 | + # Best practice guides | |
| 87 | + "accessible.html", | |
| 88 | + "accessible-qtquick.html", | |
| 89 | + "sharedlibrary.html", | |
| 90 | + "exceptionsafety.html", | |
| 91 | + "scalability.html", | |
| 92 | + "session.html", | |
| 93 | + "appicon.html", | |
| 94 | + "accelerators.html", | |
| 95 | + | |
| 96 | + # Other | |
| 97 | + "ecmascript.html", | |
| 98 | + "qtremoteobjects-interaction.html", | |
| 99 | + ] | |
| 100 | + | |
| 101 | + options[:attribution] = <<-HTML | |
| 102 | + © The Qt Company Ltd<br> | |
| 103 | + Licensed under the GNU Free Documentation License, Version 1.3. | |
| 104 | + HTML | |
| 105 | + | |
| 106 | + version '5.11' do | |
| 107 | + self.release = '5.11' | |
| 108 | + self.base_url = 'https://doc.qt.io/qt-5/' | |
| 109 | + end | |
| 110 | + | |
| 111 | + version '5.9' do | |
| 112 | + self.release = '5.9' | |
| 113 | + self.base_url = 'https://doc.qt.io/qt-5.9/' | |
| 114 | + end | |
| 115 | + | |
| 116 | + version '5.6' do | |
| 117 | + self.release = '5.6' | |
| 118 | + self.base_url = 'https://doc.qt.io/qt-5.6/' | |
| 119 | + end | |
| 120 | + end | |
| 121 | +end | |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Redis < UrlScraper |
| 3 | 3 | self.type = 'redis' |
| 4 | − self.release = '4.0.9' | |
| 4 | + self.release = '4.0.11' | |
| 5 | 5 | self.base_url = 'https://redis.io/commands' |
| 6 | 6 | self.links = { |
| 7 | 7 | home: 'https://redis.io/', |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Redux < UrlScraper |
| 3 | − self.type = 'redux' | |
| 3 | + self.type = 'simple' | |
| 4 | 4 | self.release = '3.7.2' |
| 5 | 5 | self.base_url = 'http://redux.js.org/docs/' |
| 6 | 6 | self.links = { |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Requirejs < UrlScraper |
| 3 | 3 | self.name = 'RequireJS' |
| 4 | − self.type = 'requirejs' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '2.3.5' |
| 6 | 6 | self.base_url = 'http://requirejs.org/docs/' |
| 7 | 7 | self.links = { |
| @@ -1,9 +1,9 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Rust < UrlScraper |
| 3 | 3 | self.type = 'rust' |
| 4 | − self.release = '1.26.0' | |
| 4 | + self.release = '1.29.1' | |
| 5 | 5 | self.base_url = 'https://doc.rust-lang.org/' |
| 6 | − self.root_path = 'book/first-edition/index.html' | |
| 6 | + self.root_path = 'book/second-edition/index.html' | |
| 7 | 7 | self.initial_paths = %w( |
| 8 | 8 | reference/introduction.html |
| 9 | 9 | collections/index.html |
| @@ -17,13 +17,13 @@ module Docs · 7 unmodified lines | ||
| 17 | 17 | html_filters.push 'rust/entries', 'rust/clean_html' |
| 18 | 18 | |
| 19 | 19 | options[:only_patterns] = [ |
| 20 | − /\Abook\/first-edition\//, | |
| 20 | + /\Abook\/second-edition\//, | |
| 21 | 21 | /\Areference\//, |
| 22 | 22 | /\Acollections\//, |
| 23 | 23 | /\Astd\// ] |
| 24 | 24 | |
| 25 | − options[:skip] = %w(book/first-edition/README.html) | |
| 26 | − options[:skip_patterns] = [/(?<!\.html)\z/] | |
| 25 | + options[:skip] = %w(book/second-edition/README.html) | |
| 26 | + options[:skip_patterns] = [/(?<!\.html)\z/, /\/print\.html/] | |
| 27 | 27 | |
| 28 | 28 | options[:fix_urls] = ->(url) do |
| 29 | 29 | url.sub! %r{(#{Rust.base_url}.+/)\z}, '\1index.html' |
| @@ -1,8 +1,8 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Typescript < UrlScraper |
| 3 | 3 | self.name = 'TypeScript' |
| 4 | − self.type = 'typescript' | |
| 5 | − self.release = '2.9.0' | |
| 4 | + self.type = 'simple' | |
| 5 | + self.release = '3.0.1' | |
| 6 | 6 | self.base_url = 'https://www.typescriptlang.org/docs/' |
| 7 | 7 | self.root_path = 'tutorial.html' |
| 8 | 8 | self.links = { |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Vagrant < UrlScraper |
| 3 | 3 | self.name = 'Vagrant' |
| 4 | − self.type = 'vagrant' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '2.1.1' |
| 6 | 6 | self.base_url = 'https://www.vagrantup.com/docs/' |
| 7 | 7 | self.root_path = 'index.html' |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Vulkan < UrlScraper |
| 3 | 3 | self.name = 'Vulkan' |
| 4 | − self.type = 'vulkan' | |
| 4 | + self.type = 'simple' | |
| 5 | 5 | self.release = '1.0.59' |
| 6 | 6 | self.base_url = 'https://www.khronos.org/registry/vulkan/specs/1.0/' |
| 7 | 7 | self.root_path = 'apispec.html' |
| @@ -4,7 +4,7 @@ module Docs · 3 unmodified lines | ||
| 4 | 4 | self.type = 'webpack' |
| 5 | 5 | |
| 6 | 6 | version do |
| 7 | − self.release = '4.12.0' | |
| 7 | + self.release = '4.16.5' | |
| 8 | 8 | self.base_url = 'https://webpack.js.org/' |
| 9 | 9 | self.root_path = 'guides/' |
| 10 | 10 | self.initial_paths = %w( |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | module Docs |
| 2 | 2 | class Yarn < UrlScraper |
| 3 | − self.type = 'yarn' | |
| 4 | − self.release = '1.7.0' | |
| 3 | + self.type = 'simple' | |
| 4 | + self.release = '1.9.4' | |
| 5 | 5 | self.base_url = 'https://yarnpkg.com/en/docs/' |
| 6 | 6 | self.links = { |
| 7 | 7 | home: 'https://yarnpkg.com/', |
| @@ -175,9 +175,13 @@ class DocsCLI < Thor · 174 unmodified lines | ||
| 175 | 175 | private |
| 176 | 176 | |
| 177 | 177 | def find_docs(names) |
| 178 | − names.map do |name| | |
| 178 | + names.flat_map do |name| | |
| 179 | 179 | name, version = name.split(/@|~/) |
| 180 | − Docs.find(name, version) | |
| 180 | + if version == 'all' | |
| 181 | + Docs.find(name, false).versions | |
| 182 | + else | |
| 183 | + Docs.find(name, version) | |
| 184 | + end | |
| 181 | 185 | end |
| 182 | 186 | end |
| 183 | 187 | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://github.com/odb/official-bash-logo | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://github.com/dart-lang/logos | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://github.com/yahoo/formatjs-site/tree/master/public/img | |
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://github.com/GoogleChromeLabs/pptr.dev/tree/master/src/favicons | |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
| @@ -0,0 +1 @@ | ||
| 1 | +https://commons.wikimedia.org/wiki/File:Qt_logo_2016.svg | |
Binary file not shown.
| @@ -29,6 +29,11 @@ · 28 unmodified lines | ||
| 29 | 29 | "src": "/images/webapp-icon-256.png", |
| 30 | 30 | "sizes": "256x256", |
| 31 | 31 | "type": "image/png" |
| 32 | + }, | |
| 33 | + { | |
| 34 | + "src": "/images/webapp-icon-512.png", | |
| 35 | + "sizes": "512x512", | |
| 36 | + "type": "image/png" | |
| 32 | 37 | } |
| 33 | 38 | ] |
| 34 | 39 | } |
| @@ -11,6 +11,16 @@ class AppTest < MiniTest::Spec · 10 unmodified lines | ||
| 11 | 11 | App |
| 12 | 12 | end |
| 13 | 13 | |
| 14 | + before do | |
| 15 | + current_session.env('HTTPS', 'on') | |
| 16 | + end | |
| 17 | + | |
| 18 | + it 'redirects to HTTPS' do | |
| 19 | + get 'http://example.com/test?q=1', {}, 'HTTPS' => 'off' | |
| 20 | + assert last_response.redirect? | |
| 21 | + assert_equal 'https://example.com/test?q=1', last_response['Location'] | |
| 22 | + end | |
| 23 | + | |
| 14 | 24 | describe "/" do |
| 15 | 25 | it "works" do |
| 16 | 26 | get '/' |
| @@ -20,13 +30,13 @@ class AppTest < MiniTest::Spec · 3 unmodified lines | ||
| 20 | 30 | it "redirects to /#q= when there is a 'q' query param" do |
| 21 | 31 | get '/search', q: 'foo' |
| 22 | 32 | assert last_response.redirect? |
| 23 | − assert_equal 'http://example.org/#q=foo', last_response['Location'] | |
| 33 | + assert_equal 'https://example.org/#q=foo', last_response['Location'] | |
| 24 | 34 | end |
| 25 | 35 | |
| 26 | 36 | it "redirects without the query string" do |
| 27 | 37 | get '/', foo: 'bar' |
| 28 | 38 | assert last_response.redirect? |
| 29 | − assert_equal 'http://example.org/', last_response['Location'] | |
| 39 | + assert_equal 'https://example.org/', last_response['Location'] | |
| 30 | 40 | end |
| 31 | 41 | |
| 32 | 42 | it "sets default size" do |
| @@ -45,6 +55,18 @@ class AppTest < MiniTest::Spec · 12 unmodified lines | ||
| 45 | 55 | get '/' |
| 46 | 56 | assert_includes last_response.body, '<body class="foo">' |
| 47 | 57 | end |
| 58 | + | |
| 59 | + it "sets the <html> theme from cookie" do | |
| 60 | + get '/' | |
| 61 | + assert_match %r{<html [^>]*class="[^\"]*_theme-default}, last_response.body | |
| 62 | + refute_includes last_response.body, '_theme-dark' | |
| 63 | + | |
| 64 | + set_cookie('dark=1') | |
| 65 | + | |
| 66 | + get '/' | |
| 67 | + assert_match %r{<html [^>]*class="[^\"]*_theme-dark}, last_response.body | |
| 68 | + refute_includes last_response.body, '_theme-default' | |
| 69 | + end | |
| 48 | 70 | end |
| 49 | 71 | |
| 50 | 72 | describe "/[static-page]" do |
| @@ -52,7 +74,7 @@ class AppTest < MiniTest::Spec · 1 unmodified line | ||
| 52 | 74 | %w(offline about news help).each do |page| |
| 53 | 75 | get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER |
| 54 | 76 | assert last_response.redirect? |
| 55 | − assert_equal "http://example.org/#/#{page}", last_response['Location'] | |
| 77 | + assert_equal "https://example.org/#/#{page}", last_response['Location'] | |
| 56 | 78 | end |
| 57 | 79 | end |
| 58 | 80 | |
| @@ -61,7 +83,7 @@ class AppTest < MiniTest::Spec · 2 unmodified lines | ||
| 61 | 83 | set_cookie('foo=bar') |
| 62 | 84 | get "/#{page}", {}, 'HTTP_USER_AGENT' => MODERN_BROWSER |
| 63 | 85 | assert last_response.redirect? |
| 64 | − assert_equal 'http://example.org/', last_response['Location'] | |
| 86 | + assert_equal 'https://example.org/', last_response['Location'] | |
| 65 | 87 | assert last_response['Set-Cookie'].start_with?("initial_path=%2F#{page}; path=/; expires=") |
| 66 | 88 | end |
| 67 | 89 | end |
| @@ -71,11 +93,11 @@ class AppTest < MiniTest::Spec · 3 unmodified lines | ||
| 71 | 93 | it "redirects to /#q=" do |
| 72 | 94 | get '/search' |
| 73 | 95 | assert last_response.redirect? |
| 74 | − assert_equal 'http://example.org/#q=', last_response['Location'] | |
| 96 | + assert_equal 'https://example.org/#q=', last_response['Location'] | |
| 75 | 97 | |
| 76 | 98 | get '/search', q: 'foo' |
| 77 | 99 | assert last_response.redirect? |
| 78 | − assert_equal 'http://example.org/#q=foo', last_response['Location'] | |
| 100 | + assert_equal 'https://example.org/#q=foo', last_response['Location'] | |
| 79 | 101 | end |
| 80 | 102 | end |
| 81 | 103 | |
| @@ -148,7 +170,7 @@ class AppTest < MiniTest::Spec · 66 unmodified lines | ||
| 148 | 170 | set_cookie('docs=html~5') |
| 149 | 171 | get '/html~5/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER |
| 150 | 172 | assert last_response.redirect? |
| 151 | − assert_equal 'http://example.org/', last_response['Location'] | |
| 173 | + assert_equal 'https://example.org/', last_response['Location'] | |
| 152 | 174 | assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%7E5%2F; path=/; expires=") |
| 153 | 175 | end |
| 154 | 176 | |
| @@ -161,13 +183,13 @@ class AppTest < MiniTest::Spec · 6 unmodified lines | ||
| 161 | 183 | set_cookie('docs=html~5') |
| 162 | 184 | get '/html/', {}, 'HTTP_USER_AGENT' => MODERN_BROWSER |
| 163 | 185 | assert last_response.redirect? |
| 164 | − assert_equal 'http://example.org/', last_response['Location'] | |
| 186 | + assert_equal 'https://example.org/', last_response['Location'] | |
| 165 | 187 | assert last_response['Set-Cookie'].start_with?("initial_path=%2Fhtml%2F; path=/; expires=") |
| 166 | 188 | end |
| 167 | 189 | |
| 168 | 190 | it "renders when the doc exists and is enabled, and the request is from Googlebot" do |
| 169 | 191 | set_cookie('docs=html') |
| 170 | − get '/html/', {}, 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +http://www.google.com/bot.html)' | |
| 192 | + get '/html/', {}, 'HTTP_USER_AGENT' => 'Mozilla/5.0 (compatible; Googlebot/2.1; +https://www.google.com/bot.html)' | |
| 171 | 193 | assert last_response.ok? |
| 172 | 194 | end |
| 173 | 195 | |
| @@ -187,17 +209,17 @@ class AppTest < MiniTest::Spec · 13 unmodified lines | ||
| 187 | 209 | it "redirects with trailing slash" do |
| 188 | 210 | get '/html' |
| 189 | 211 | assert last_response.redirect? |
| 190 | − assert_equal 'http://example.org/html/', last_response['Location'] | |
| 212 | + assert_equal 'https://example.org/html/', last_response['Location'] | |
| 191 | 213 | |
| 192 | 214 | get '/html', bar: 'baz' |
| 193 | 215 | assert last_response.redirect? |
| 194 | − assert_equal 'http://example.org/html/?bar=baz', last_response['Location'] | |
| 216 | + assert_equal 'https://example.org/html/?bar=baz', last_response['Location'] | |
| 195 | 217 | end |
| 196 | 218 | |
| 197 | 219 | it "redirects old docs" do |
| 198 | 220 | get '/iojs/' |
| 199 | 221 | assert last_response.redirect? |
| 200 | − assert_equal 'http://example.org/node/', last_response['Location'] | |
| 222 | + assert_equal 'https://example.org/node/', last_response['Location'] | |
| 201 | 223 | end |
| 202 | 224 | end |
| 203 | 225 | |
| @@ -232,17 +254,17 @@ class AppTest < MiniTest::Spec · 28 unmodified lines | ||
| 232 | 254 | it "redirects with trailing slash" do |
| 233 | 255 | get '/css-foo' |
| 234 | 256 | assert last_response.redirect? |
| 235 | − assert_equal 'http://example.org/css-foo/', last_response['Location'] | |
| 257 | + assert_equal 'https://example.org/css-foo/', last_response['Location'] | |
| 236 | 258 | |
| 237 | 259 | get '/css-foo', bar: 'baz' |
| 238 | 260 | assert last_response.redirect? |
| 239 | − assert_equal 'http://example.org/css-foo/?bar=baz', last_response['Location'] | |
| 261 | + assert_equal 'https://example.org/css-foo/?bar=baz', last_response['Location'] | |
| 240 | 262 | end |
| 241 | 263 | |
| 242 | 264 | it "redirects old docs" do |
| 243 | 265 | get '/yii1-foo/' |
| 244 | 266 | assert last_response.redirect? |
| 245 | − assert_equal 'http://example.org/yii~1.1-foo/', last_response['Location'] | |
| 267 | + assert_equal 'https://example.org/yii~1.1-foo/', last_response['Location'] | |
| 246 | 268 | end |
| 247 | 269 | end |
| 248 | 270 | |
| @@ -263,17 +285,17 @@ class AppTest < MiniTest::Spec · 14 unmodified lines | ||
| 263 | 285 | it "redirects without trailing slash" do |
| 264 | 286 | get '/css/foo/' |
| 265 | 287 | assert last_response.redirect? |
| 266 | − assert_equal 'http://example.org/css/foo', last_response['Location'] | |
| 288 | + assert_equal 'https://example.org/css/foo', last_response['Location'] | |
| 267 | 289 | |
| 268 | 290 | get '/css/foo/', bar: 'baz' |
| 269 | 291 | assert last_response.redirect? |
| 270 | − assert_equal 'http://example.org/css/foo?bar=baz', last_response['Location'] | |
| 292 | + assert_equal 'https://example.org/css/foo?bar=baz', last_response['Location'] | |
| 271 | 293 | end |
| 272 | 294 | |
| 273 | 295 | it "redirects old docs" do |
| 274 | 296 | get '/python2/foo' |
| 275 | 297 | assert last_response.redirect? |
| 276 | − assert_equal 'http://example.org/python~2.7/foo', last_response['Location'] | |
| 298 | + assert_equal 'https://example.org/python~2.7/foo', last_response['Location'] | |
| 277 | 299 | end |
| 278 | 300 | end |
| 279 | 301 | |
| @@ -281,7 +303,7 @@ class AppTest < MiniTest::Spec · 1 unmodified line | ||
| 281 | 303 | it "returns to the asset path" do |
| 282 | 304 | get '/docs.json' |
| 283 | 305 | assert last_response.redirect? |
| 284 | − assert_equal 'http://example.org/assets/docs.json', last_response['Location'] | |
| 306 | + assert_equal 'https://example.org/assets/docs.json', last_response['Location'] | |
| 285 | 307 | end |
| 286 | 308 | end |
| 287 | 309 | |
| @@ -289,7 +311,7 @@ class AppTest < MiniTest::Spec · 1 unmodified line | ||
| 289 | 311 | it "returns to the asset path" do |
| 290 | 312 | get '/application.js' |
| 291 | 313 | assert last_response.redirect? |
| 292 | − assert_equal 'http://example.org/assets/application.js', last_response['Location'] | |
| 314 | + assert_equal 'https://example.org/assets/application.js', last_response['Location'] | |
| 293 | 315 | end |
| 294 | 316 | end |
| 295 | 317 | |
| @@ -297,7 +319,7 @@ class AppTest < MiniTest::Spec · 1 unmodified line | ||
| 297 | 319 | it "returns to the asset path" do |
| 298 | 320 | get '/application.css' |
| 299 | 321 | assert last_response.redirect? |
| 300 | − assert_equal 'http://example.org/assets/application.css', last_response['Location'] | |
| 322 | + assert_equal 'https://example.org/assets/application.css', last_response['Location'] | |
| 301 | 323 | end |
| 302 | 324 | end |
| 303 | 325 | |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | <!DOCTYPE html> |
| 2 | −<html<%= ' manifest="/manifest.appcache"' if App.production? %> prefix="og: http://ogp.me/ns#" lang="en" class="_booting"> | |
| 2 | +<html<%= ' manifest="/manifest.appcache"' if App.production? %> prefix="og: http://ogp.me/ns#" lang="en" class="_booting _theme-<%= app_theme %>"> | |
| 3 | 3 | <head> |
| 4 | 4 | <meta charset="utf-8"> |
| 5 | 5 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no,shrink-to-fit=no"> |
| @@ -30,7 +30,7 @@ · 24 unmodified lines | ||
| 30 | 30 | <link rel="apple-touch-icon" sizes="152x152" href="<%= App.cdn_origin %>/images/apple-icon-152.png"> |
| 31 | 31 | <link rel="apple-touch-icon" sizes="160x160" href="<%= App.cdn_origin %>/images/apple-icon-160.png"> |
| 32 | 32 | <link rel="mask-icon" href="<%= App.cdn_origin %>/images/webkit-mask-icon.svg" color="#398df0"> |
| 33 | − <link rel="stylesheet" href="<%= main_stylesheet_path %>" data-alt="<%= alternate_stylesheet_path %>"> | |
| 33 | + <%= stylesheet_tag 'application' %> | |
| 34 | 34 | </head> |
| 35 | 35 | <body<%= %( class="#{app_layout}") if app_layout %>> |
| 36 | 36 | <noscript class="_fail">DevDocs requires JavaScript to run.</noscript> |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | <!DOCTYPE html> |
| 2 | −<html lang="en" class="_booting"> | |
| 2 | +<html lang="en" class="_booting _theme-<%= app_theme %>"> | |
| 3 | 3 | <head> |
| 4 | 4 | <meta charset="utf-8"> |
| 5 | 5 | <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no"> |
| @@ -11,7 +11,7 @@ · 5 unmodified lines | ||
| 11 | 11 | <link rel="manifest" href="/manifest.json"> |
| 12 | 12 | <link rel="icon" type="image/x-icon" href="<%= App.cdn_origin %>/favicon.ico"> |
| 13 | 13 | <link rel="search" type="application/opensearchdescription+xml" href="/opensearch.xml" title="Search DevDocs"> |
| 14 | − <link rel="stylesheet" href="<%= main_stylesheet_path %>" data-alt="<%= alternate_stylesheet_path %>"> | |
| 14 | + <%= stylesheet_tag 'application' %> | |
| 15 | 15 | </head> |
| 16 | 16 | <body<%= %( class="#{app_layout}") if app_layout %> data-doc="<%= CGI::escape_html @doc.to_json %>"> |
| 17 | 17 | <noscript class="_fail">DevDocs requires JavaScript to run.</noscript> |
| @@ -10,13 +10,10 @@ · 9 unmodified lines | ||
| 10 | 10 | <h1 class="_fail-title">Your browser is unsupported, sorry.</h1> |
| 11 | 11 | <p class="_fail-text">DevDocs is an API documentation browser which supports the following browsers:</p> |
| 12 | 12 | <ul class="_fail-list"> |
| 13 | − <li>Recent versions of Chrome and Firefox</li> | |
| 14 | − <li>Safari 5.1+</li> | |
| 15 | − <li>Opera 12.1+</li> | |
| 16 | − <li>Internet Explorer 10+</li> | |
| 17 | − <li>iOS 6+</li> | |
| 18 | − <li>Android 4.1+</li> | |
| 19 | − <li>Windows Phone 8+</li> | |
| 13 | + <li>Recent versions of Firefox, Chrome, or Opera</li> | |
| 14 | + <li>Safari 9.1+</li> | |
| 15 | + <li>Edge 16+</li> | |
| 16 | + <li>iOS 10+</li> | |
| 20 | 17 | </ul> |
| 21 | 18 | <p class="_fail-text"> |
| 22 | 19 | If you're unable to upgrade, I apologize. |