From 253596c58d6ad8aa4db01a4fcedd6ae7755de2fa Mon Sep 17 00:00:00 2001 From: Lukas Geiter Date: Thu, 12 Oct 2017 16:04:48 +0200 Subject: [PATCH 1/6] Keep search open on enter without selection --- ...cation-f3ab9e5ff8.js => application-683e1b679e.js} | 2 +- ...tion-9011e2d3f8.css => application-4d315b386e.css} | 2 +- material/base.html | 4 ++-- src/assets/javascripts/application.js | 11 ++++++----- 4 files changed, 10 insertions(+), 9 deletions(-) rename material/assets/javascripts/{application-f3ab9e5ff8.js => application-683e1b679e.js} (99%) rename material/assets/stylesheets/{application-9011e2d3f8.css => application-4d315b386e.css} (99%) diff --git a/material/assets/javascripts/application-f3ab9e5ff8.js b/material/assets/javascripts/application-683e1b679e.js similarity index 99% rename from material/assets/javascripts/application-f3ab9e5ff8.js rename to material/assets/javascripts/application-683e1b679e.js index e965fc576..0c6382f6b 100644 --- a/material/assets/javascripts/application-f3ab9e5ff8.js +++ b/material/assets/javascripts/application-683e1b679e.js @@ -1 +1 @@ -window.app=function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return e[r].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var n={};return t.m=e,t.c=n,t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=35)}([function(e,t,n){"use strict";var r=n(23)("wks"),i=n(14),o=n(1).Symbol,a="function"==typeof o;(e.exports=function(e){return r[e]||(r[e]=a&&o[e]||(a?o:i)("Symbol."+e))}).store=r},function(e,t,n){"use strict";var r=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=r)},function(e,t,n){"use strict";var r=n(10),i=n(25);e.exports=n(5)?function(e,t,n){return r.f(e,t,i(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t,n){"use strict";var r=n(11);e.exports=function(e){if(!r(e))throw TypeError(e+" is not an object!");return e}},function(e,t,n){"use strict";var r=n(1),i=n(2),o=n(6),a=n(14)("src"),s=Function.toString,c=(""+s).split("toString");n(7).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,s){var u="function"==typeof n;u&&(o(n,"name")||i(n,"name",t)),e[t]!==n&&(u&&(o(n,a)||i(n,a,e[t]?""+e[t]:c.join(String(t)))),e===r?e[t]=n:s?e[t]?e[t]=n:i(e,t,n):(delete e[t],i(e,t,n)))})(Function.prototype,"toString",function(){return"function"==typeof this&&this[a]||s.call(this)})},function(e,t,n){"use strict";e.exports=!n(24)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t,n){"use strict";var r={}.hasOwnProperty;e.exports=function(e,t){return r.call(e,t)}},function(e,t,n){"use strict";var r=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=r)},function(e,t,n){"use strict";e.exports={}},function(e,t,n){"use strict";var r={}.toString;e.exports=function(e){return r.call(e).slice(8,-1)}},function(e,t,n){"use strict";var r=n(3),i=n(38),o=n(39),a=Object.defineProperty;t.f=n(5)?Object.defineProperty:function(e,t,n){if(r(e),t=o(t,!0),r(n),i)try{return a(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(e[t]=n.value),e}},function(e,t,n){"use strict";var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};e.exports=function(e){return"object"===(void 0===e?"undefined":r(e))?null!==e:"function"==typeof e}},function(e,t,n){"use strict";var r=n(18);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}}},function(e,t,n){"use strict";var r=n(9),i=n(0)("toStringTag"),o="Arguments"==r(function(){return arguments}()),a=function(e,t){try{return e[t]}catch(e){}};e.exports=function(e){var t,n,s;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=a(t=Object(e),i))?n:o?r(t):"Object"==(s=r(t))&&"function"==typeof t.callee?"Arguments":s}},function(e,t,n){"use strict";var r=0,i=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++r+i).toString(36))}},function(e,t,n){"use strict";var r=n(11),i=n(1).document,o=r(i)&&r(i.createElement);e.exports=function(e){return o?i.createElement(e):{}}},function(e,t,n){"use strict";var r=Math.ceil,i=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?i:r)(e)}},function(e,t,n){"use strict";e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){"use strict";e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t,n){"use strict";var r=n(47),i=n(17);e.exports=function(e){return r(i(e))}},function(e,t,n){"use strict";var r=n(23)("keys"),i=n(14);e.exports=function(e){return r[e]||(r[e]=i(e))}},function(e,t,n){"use strict";var r=n(10).f,i=n(6),o=n(0)("toStringTag");e.exports=function(e,t,n){e&&!i(e=n?e:e.prototype,o)&&r(e,o,{configurable:!0,value:t})}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={createElement:function(e,t){var n=document.createElement(e);t&&Array.prototype.forEach.call(Object.keys(t),function(e){n.setAttribute(e,t[e])});for(var r=arguments.length,i=Array(r>2?r-2:0),o=2;o0?i(r(e),9007199254740991):0}},function(e,t,n){"use strict";e.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(e,t,n){"use strict";e.exports=n(1).document&&document.documentElement},function(e,t,n){"use strict";var r,i,o,a=n(12),s=n(63),c=n(31),u=n(15),l=n(1),f=l.process,h=l.setImmediate,d=l.clearImmediate,p=l.MessageChannel,m=0,y={},v=function(){var e=+this;if(y.hasOwnProperty(e)){var t=y[e];delete y[e],t()}},g=function(e){v.call(e.data)};h&&d||(h=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return y[++m]=function(){s("function"==typeof e?e:Function(e),t)},r(m),m},d=function(e){delete y[e]},"process"==n(9)(f)?r=function(e){f.nextTick(a(v,e,1))}:p?(i=new p,o=i.port2,i.port1.onmessage=g,r=a(o.postMessage,o,1)):l.addEventListener&&"function"==typeof postMessage&&!l.importScripts?(r=function(e){l.postMessage(e+"","*")},l.addEventListener("message",g,!1)):r="onreadystatechange"in u("script")?function(e){c.appendChild(u("script")).onreadystatechange=function(){c.removeChild(this),v.call(e)}}:function(e){setTimeout(a(v,e,1),0)}),e.exports={set:h,clear:d}},function(e,t){(function(t){e.exports=t}).call(t,{})},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}var i=function(){function e(e,t){for(var n=0;n=t.length?{value:void 0,done:!0}:(e=r(t,n),this._i+=e.length,{value:e,done:!1})})},function(e,t,n){"use strict";var r=n(16),i=n(17);e.exports=function(e){return function(t,n){var o,a,s=String(i(t)),c=r(n),u=s.length;return c<0||c>=u?e?"":void 0:(o=s.charCodeAt(c),o<55296||o>56319||c+1===u||(a=s.charCodeAt(c+1))<56320||a>57343?e?s.charAt(c):o:e?s.slice(c,c+2):a-56320+(o-55296<<10)+65536)}}},function(e,t,n){"use strict";var r=n(43),i=n(25),o=n(21),a={};n(2)(a,n(0)("iterator"),function(){return this}),e.exports=function(e,t,n){e.prototype=r(a,{next:i(1,n)}),o(e,t+" Iterator")}},function(e,t,n){"use strict";var r=n(3),i=n(44),o=n(30),a=n(20)("IE_PROTO"),s=function(){},c=function(){var e,t=n(15)("iframe"),r=o.length;for(t.style.display="none",n(31).appendChild(t),t.src="javascript:",e=t.contentWindow.document,e.open(),e.write(" {% endblock %} {% block styles %} - + {% if config.extra.palette %} {% endif %} @@ -153,7 +153,7 @@ {% endblock %} {% block scripts %} - + {% set languages = lang.t("search.languages").split(",") %} {% if languages | length and languages[0] != "" %} {% set path = base_url + "/assets/javascripts/lunr" %} diff --git a/src/assets/javascripts/application.js b/src/assets/javascripts/application.js index 06846c641..3463348a9 100644 --- a/src/assets/javascripts/application.js +++ b/src/assets/javascripts/application.js @@ -290,13 +290,14 @@ function initialize(config) { // eslint-disable-line func-style /* Go to current active/focused link */ const focus = document.querySelector( "[data-md-component=search] [href][data-md-state=active]") - if (focus instanceof HTMLLinkElement) + if (focus instanceof HTMLLinkElement) { window.location = focus.getAttribute("href") - /* Close search */ - toggle.checked = false - toggle.dispatchEvent(new CustomEvent("change")) - query.blur() + /* Close search */ + toggle.checked = false + toggle.dispatchEvent(new CustomEvent("change")) + query.blur() + } } /* Escape: close search */ From 7ca03c017d5c3ad2ff65a5b1e3d04f327db223c4 Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Fri, 13 Oct 2017 09:32:28 -0400 Subject: [PATCH 2/6] Fix a typo and use question admonition --- docs/getting-started.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 6389d03f1..de87f95e9 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -135,7 +135,7 @@ project's `mkdocs.yml`. See the following sections for all available options. ### Changing the color palette -A default is hue is defined for every primary and accent color on Google's +A default hue is defined for every primary and accent color on Google's Material Design [color palette][10], which makes it very easy to change the overall look of the theme. Just set the primary and accent colors using the following variables: @@ -271,7 +271,7 @@ If the repository is hosted in a private environment, the service logo can be set explicitly by setting `extra.repo_icon` to `github`, `gitlab` or `bitbucket`. -!!! warning "Why is there an edit button at the top of every article?" +!!! question "Why is there an edit button at the top of every article?" If the `repo_url` is set to a GitHub or BitBucket repository, and the `repo_name` is set to *GitHub* or *BitBucket* (implied by default), an From 2e728cc9f6849ec328dffda47ce12a1bef0e3fbf Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Sun, 15 Oct 2017 21:54:59 -0400 Subject: [PATCH 3/6] Improve printing of code blocks - Hide clipboard icon - Wrap code and hide the scrollbar --- src/assets/stylesheets/base/_typeset.scss | 5 +++++ src/assets/stylesheets/layout/_clipboard.scss | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/src/assets/stylesheets/base/_typeset.scss b/src/assets/stylesheets/base/_typeset.scss index 7c4f6b415..dc4c6dde9 100644 --- a/src/assets/stylesheets/base/_typeset.scss +++ b/src/assets/stylesheets/base/_typeset.scss @@ -166,6 +166,11 @@ kbd { background-color: $md-code-background; color: $md-code-color; font-size: 85%; + + // Wrap text and hide scollbars + @media print { + white-space: pre-wrap; + } } // Inline code blocks, correct relative ems for smaller font size diff --git a/src/assets/stylesheets/layout/_clipboard.scss b/src/assets/stylesheets/layout/_clipboard.scss index bc21a952d..73b29d8bb 100644 --- a/src/assets/stylesheets/layout/_clipboard.scss +++ b/src/assets/stylesheets/layout/_clipboard.scss @@ -38,6 +38,11 @@ // Hack: put everything on the GPU to omit flickering backface-visibility: hidden; + // Hide for print + @media print { + display: none; + } + // Icon &::before { @extend %md-icon; From b955abab6ea79b6552dcf1937bae58e86df4761d Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Mon, 16 Oct 2017 13:13:05 -0400 Subject: [PATCH 4/6] Removed deprecated Markdown config format in docs * Remove deprecated Markdown config format in docs. Support for including Markdown extension configs in the extension name has been [deprecated][1] and will not work in any future released of Python-Markdown. MkDocs has offered full support for defining extension configs [since version 0.13][2] and everyone should be using that format. [1]: https://pythonhosted.org/Markdown/release-2.6.html#extension-configuration-as-part-of-extension-name-deprecated [2]: http://www.mkdocs.org/about/release-notes/#other-changes-and-additions-to-version-0130 * Update codehilite Markdown config * Update TOC Markdown configs * Update pymdown Markdown configs --- docs/extensions/codehilite.md | 3 ++- docs/extensions/permalinks.md | 6 ++++-- docs/extensions/pymdown.md | 6 ++++-- docs/getting-started.md | 12 ++++++++---- 4 files changed, 18 insertions(+), 9 deletions(-) diff --git a/docs/extensions/codehilite.md b/docs/extensions/codehilite.md index 195585d9d..dd4cdabf3 100644 --- a/docs/extensions/codehilite.md +++ b/docs/extensions/codehilite.md @@ -115,7 +115,8 @@ Line numbers can be added by enabling the `linenums` flag in your `mkdocs.yml`: ``` yaml markdown_extensions: - - codehilite(linenums=true) + - codehilite: + linenums:true ``` Example: diff --git a/docs/extensions/permalinks.md b/docs/extensions/permalinks.md index 3269c834d..d34475129 100644 --- a/docs/extensions/permalinks.md +++ b/docs/extensions/permalinks.md @@ -13,7 +13,8 @@ To enable permalinks, add the following to your `mkdocs.yml`: ``` yaml markdown_extensions: - - toc(permalink=true) + - toc: + permalink: true ``` This will add a link containing the paragraph symbol `¶` at the end of each @@ -23,7 +24,8 @@ permalink, a string can be passed, e.g.: ``` markdown markdown_extensions: - - toc(permalink=Link) + - toc: + permalink: Link ``` ## Usage diff --git a/docs/extensions/pymdown.md b/docs/extensions/pymdown.md index ef66fa3fe..baa4f1481 100644 --- a/docs/extensions/pymdown.md +++ b/docs/extensions/pymdown.md @@ -21,7 +21,8 @@ package are recommended to be used together with the Material theme: ``` yaml markdown_extensions: - pymdownx.arithmatex - - pymdownx.betterem(smart_enable=all) + - pymdownx.betterem: + smart_enable: all - pymdownx.caret - pymdownx.critic - pymdownx.details @@ -32,7 +33,8 @@ markdown_extensions: - pymdownx.mark - pymdownx.smartsymbols - pymdownx.superfences - - pymdownx.tasklist(custom_checkbox=true) + - pymdownx.tasklist: + custom_checkbox: true - pymdownx.tilde ``` diff --git a/docs/getting-started.md b/docs/getting-started.md index de87f95e9..35ecd8922 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -486,8 +486,10 @@ but highly recommended, so they should be switched on at all times: ``` yaml markdown_extensions: - admonition - - codehilite(guess_lang=false) - - toc(permalink=true) + - codehilite: + guess_lang: false + - toc: + permalink: true ``` For more information, see the following list of extensions supported by the @@ -554,6 +556,8 @@ google_analytics: # Extensions markdown_extensions: - admonition - - codehilite(guess_lang=false) - - toc(permalink=true) + - codehilite: + guess_lang: false + - toc: + permalink: true ``` From 6ee58d8b15076cf9e080120f8d3f5aaeb754f2aa Mon Sep 17 00:00:00 2001 From: "greenkeeper[bot]" Date: Fri, 13 Oct 2017 20:56:22 +0000 Subject: [PATCH 5/6] chore(package): update flow-bin to version 0.57.1 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5ca1ba00b..2be1881d1 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,7 @@ "eslint": "^4.3.0", "expose-loader": "^0.7.3", "fastclick": "^1.0.6", - "flow-bin": "^0.56.0", + "flow-bin": "^0.57.1", "flow-jsdoc": "^0.3.0", "git-hooks": "^1.1.8", "gulp": "^3.9.1", From 91aacd5493f769629c8b1f1cf2963c3b1741911b Mon Sep 17 00:00:00 2001 From: Jonas Fonseca Date: Wed, 18 Oct 2017 12:14:09 -0400 Subject: [PATCH 6/6] Fix typo in site search section --- docs/getting-started.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started.md b/docs/getting-started.md index 35ecd8922..a02d39c2f 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -439,7 +439,7 @@ Norwegian `no`, Swedish `sv` and Turkish `tr`. !!! warning "Only specify the languages you really need" - Be aware that including suppport for other languages increases the general + Be aware that including support for other languages increases the general JavaScript payload by around 20kb (without gzip) and by another 15-30kb per language.