From f0b56af2463efb298601e8460c55ef66012ab6de Mon Sep 17 00:00:00 2001 From: Steve Wilkes Date: Sat, 1 Dec 2018 15:21:50 +0000 Subject: [PATCH] Minifying js and css, updating styles --- docs/src/css/styles.css | 8 ++++++-- docs/src/css/styles.min.css | 1 + docs/src/scripts/docs.js | 13 +++++++------ docs/src/scripts/docs.min.js | 1 + mkdocs.yml | 4 ++-- 5 files changed, 17 insertions(+), 10 deletions(-) create mode 100644 docs/src/css/styles.min.css create mode 100644 docs/src/scripts/docs.min.js diff --git a/docs/src/css/styles.css b/docs/src/css/styles.css index b0a7029d0..452233b07 100644 --- a/docs/src/css/styles.css +++ b/docs/src/css/styles.css @@ -53,6 +53,10 @@ li.current { border-bottom: 1px solid #010101; } -.hljs-type, .hljs-keyword, .hljs-title { - font-weight: normal; +.hljs-type, .hljs-keyword, .hljs-title, .hljs-meta-string, .hljs-meta { + font-weight: normal !important; +} + +.hljs-meta { + color: #4EC9B0; } diff --git a/docs/src/css/styles.min.css b/docs/src/css/styles.min.css new file mode 100644 index 000000000..1ff85e603 --- /dev/null +++ b/docs/src/css/styles.min.css @@ -0,0 +1 @@ +body{font:400 11pt 'Segoe UI',Calibri,Arial,sans-serif!important}h1,h2,h3,h4,input[type=submit]{font-family:'Segoe UI Light',Calibri,Arial,sans-serif!important;margin:0 0 .5em}h1{font-size:2.5em}h2{font-size:2em}h3{font-size:1.6em}h4{font-size:1.2em;margin-left:.7em}li code,p code,pre code{font-size:11pt}li code,p code{border:none;padding:2px 0;color:#000}span.caption-text{color:#dcdcdc;background:#1e1e1e}p a code{text-decoration:underline}.wy-menu-vertical li.current a{color:#1e1e1e}li.current{border-top:1px solid #010101;border-bottom:1px solid #010101}.hljs-keyword,.hljs-meta,.hljs-meta-string,.hljs-title,.hljs-type{font-weight:400!important}.hljs-meta{color:#4EC9B0} \ No newline at end of file diff --git a/docs/src/scripts/docs.js b/docs/src/scripts/docs.js index 700d9e3fa..8261aa084 100644 --- a/docs/src/scripts/docs.js +++ b/docs/src/scripts/docs.js @@ -1,12 +1,13 @@ -$(document).ready(function () { +$(function () { var hlCode = document.querySelectorAll('pre code.cs'), - i, + i, l, hlLength = hlCode.length, - mapperRegex = new RegExp('\\bMapper\\b', 'g'), - typeRegex = new RegExp('(new\\W+|class |<)([A-Z][^&\\\( ]+)( |{|\\\(|>)', 'g'), - genericTypeRegex = new RegExp('(IDictionary|Dictionary|IEnumerable|IReadOnlyCollection|Collection|List)<', 'g'), + mapperRegex = /\bMapper\b/g, + typeRegex = /(new<\/span>\W+|class<\/span> |public<\/span>\W+|: |<)([A-Z][^& \(\[\]]+)( |{|\(|\[\]>|>)/g, + genericTypeRegex = /(I{0,1}Dictionary|IEnumerable|IReadOnlyCollection|I{0,1}Collection|I{0,1}List)</g, observer = new MutationObserver(function (mutations) { - for (var mutation of mutations) { + for (i = 0, l = mutations.length; i < l; ++i) { + var mutation = mutations[i]; if (mutation.attributeName === 'class') { var innerHTML = mutation.target.innerHTML .replace(mapperRegex, 'Mapper') diff --git a/docs/src/scripts/docs.min.js b/docs/src/scripts/docs.min.js new file mode 100644 index 000000000..4963897cb --- /dev/null +++ b/docs/src/scripts/docs.min.js @@ -0,0 +1 @@ +$(function () { var e, a, s = document.querySelectorAll("pre code.cs"), t = s.length, l = /\bMapper\b/g, n = /(\[|new<\/span>\W+|class<\/span> |public<\/span>\W+|: |<)([A-Z][^& \(\[\]]+)(\]| |{|\(|\[\]>|>)/g, r = /(I{0,1}Dictionary|IEnumerable|IReadOnlyCollection|I{0,1}Collection|I{0,1}List)</g, p = new MutationObserver(function (s) { for (e = 0, a = s.length; e < a; ++e) { var t = s[e]; if ("class" === t.attributeName) { var p = t.target.innerHTML.replace(l, 'Mapper').replace(n, '$1$2$3').replace(r, '$1<'); t.target.innerHTML = p } } }), c = { attributes: !0 }; for (e = 0; e < t; ++e)p.observe(s[e], c) }); \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index 6bf9a53fa..b9a4b4da0 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -8,10 +8,10 @@ site_dir: 'docs/site' extra_css: - https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.13.1/styles/vs2015.min.css - - css/styles.css + - css/styles.min.css extra_javascript: - - scripts/docs.js + - scripts/docs.min.js nav: - General Use: