From f697e0543a28f4b3d8e7c44cf739469bdda51e6e Mon Sep 17 00:00:00 2001 From: autodocs Date: Thu, 7 Sep 2017 05:20:32 +0000 Subject: [PATCH] build based on d19aa0c --- latest/assets/arrow.svg | 63 +++++++++++++ latest/assets/documenter.css | 166 ++++++++++++++++++++++++++++++++--- latest/assets/documenter.js | 90 ++++++++++++++++--- latest/contributing.html | 132 +--------------------------- latest/index.html | 90 +------------------ latest/search.html | 77 +--------------- latest/siteinfo.js | 1 + 7 files changed, 299 insertions(+), 320 deletions(-) create mode 100644 latest/assets/arrow.svg create mode 100644 latest/siteinfo.js diff --git a/latest/assets/arrow.svg b/latest/assets/arrow.svg new file mode 100644 index 00000000..ee2798d3 --- /dev/null +++ b/latest/assets/arrow.svg @@ -0,0 +1,63 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/latest/assets/documenter.css b/latest/assets/documenter.css index 223d44d0..b8514efd 100644 --- a/latest/assets/documenter.css +++ b/latest/assets/documenter.css @@ -21,7 +21,12 @@ body, input { } pre, code { - font-family: 'Ubuntu Mono', Monaco, courier, monospace; + font-family: 'Roboto Mono', Monaco, courier, monospace; + font-size: 0.90em; +} + +pre code { + font-size: 1em; } a { @@ -144,6 +149,42 @@ nav.toc .logo { nav.toc h1 { text-align: center; + margin-top: .57em; + margin-bottom: 0; +} + +nav.toc select { + display: block; + height: 2em; + padding: 0 1.6em 0 1em; + min-width: 7em; + max-width: 90%; + max-width: calc(100% - 5em); + margin: 0 auto; + font-size: .83em; + border: 1px solid #c9c9c9; + border-radius: 1em; + + /* TODO: doesn't seem to be centered on Safari */ + text-align: center; + text-align-last: center; + + appearance: none; + -moz-appearance: none; + -webkit-appearance: none; + + background: white url("arrow.svg"); + background-size: 1.155em; + background-repeat: no-repeat; + background-position: right; +} + +nav.toc select:hover { + border: 1px solid #a0a0a0; +} + +nav.toc select option { + text-align: center; } nav.toc input { @@ -151,20 +192,11 @@ nav.toc input { height: 2em; width: 90%; width: calc(100% - 5em); - margin: 0 auto; + margin: 1.2em auto; padding: 0 1em; border: 1px solid #c9c9c9; border-radius: 1em; - font-size: smaller; -} - -nav.toc select { - display: block; - height: 2em; - width: calc(100% - 3em); - margin: 5px auto; - font-size: smaller; - text-align: center; + font-size: .83em; } nav.toc > ul * { @@ -172,7 +204,7 @@ nav.toc > ul * { } nav.toc ul { - color: #b3b3b3; + color: #404040; padding: 0; list-style: none; } @@ -183,6 +215,7 @@ nav.toc ul .toctext { } nav.toc ul a:hover { + color: #fcfcfc; background-color: #4e4a4a; } @@ -196,7 +229,6 @@ nav.toc ul.internal a:hover { } nav.toc ul.internal { - color: gray; background-color: #e3e3e3; box-shadow: inset -14px 0px 5px -12px rgb(210,210,210); list-style: none; @@ -246,6 +278,10 @@ article { article > header {} +article > header div#topbar { + display: none; +} + article > header nav ul { display: inline-block; list-style: none; @@ -401,3 +437,105 @@ article section.docstring a.source-link { background-color: transparent; padding: 0; } + +@media only screen and (max-width: 768px) { + nav.toc { + position: fixed; + overflow-y: scroll; + width: 16em; + left: -16em; + -webkit-overflow-scrolling: touch; + -webkit-transition-property: left; /* Safari */ + -webkit-transition-duration: 0.3s; /* Safari */ + transition-property: left; + transition-duration: 0.3s; + -webkit-transition-timing-function: ease-out; /* Safari */ + transition-timing-function: ease-out; + z-index: 2; + } + + nav.toc.show { + left: 0; + } + + article { + margin-left: 0; + padding: 3em 0.9em 0 0.9em; /* top right bottom left */ + overflow-wrap: break-word; + } + + article > header { + position: fixed; + left: 0; + z-index: 1; + } + + article > header nav, hr { + display: none; + } + + article > header div#topbar { + display: block; /* is mobile */ + position: fixed; + width: 100%; + height: 1.5em; + padding-top: 1em; + padding-bottom: 1em; + background-color: #fcfcfc; + box-shadow: 0 1px 3px rgba(0,0,0,.26); + top: 0; + -webkit-transition-property: top; /* Safari */ + -webkit-transition-duration: 0.3s; /* Safari */ + transition-property: top; + transition-duration: 0.3s; + } + + article > header div#topbar.headroom--unpinned.headroom--not-top.headroom--not-bottom { + top: -4em; + -webkit-transition-property: top; /* Safari */ + -webkit-transition-duration: 0.7s; /* Safari */ + transition-property: top; + transition-duration: 0.7s; + } + + article > header div#topbar span { + position: fixed; + width: 80%; + height: 1.5em; + margin-top: -0.1em; + margin-left: 0.9em; + font-size: 1.2em; + overflow: hidden; + } + + article > header div#topbar a.fa-bars { + float: right; + padding: 0.6em; + margin-top: -0.6em; + margin-right: 0.3em; + font-size: 1.5em; + } + + article > header div#topbar a.fa-bars:visited { + color: #3091d1; + } + + article table { + overflow-x: auto; + display: block; + } + + article div.MathJax_Display { + overflow: scroll; + } + + article span.MathJax { + overflow: hidden; + } +} + +@media only screen and (max-width: 320px) { + body { + font-size: 15px; + } +} diff --git a/latest/assets/documenter.js b/latest/assets/documenter.js index c86aec02..5d31622f 100644 --- a/latest/assets/documenter.js +++ b/latest/assets/documenter.js @@ -7,17 +7,20 @@ requirejs.config({ paths: { - 'jquery': 'https://code.jquery.com/jquery-3.1.0.js?', + 'jquery': 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.1.1/jquery.min', 'jqueryui': 'https://cdnjs.cloudflare.com/ajax/libs/jqueryui/1.12.0/jquery-ui.min', - 'mathjax': 'https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS_HTML', - 'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/highlight.min', - 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.5.0/languages/julia.min', + 'headroom': 'https://cdnjs.cloudflare.com/ajax/libs/headroom/0.9.3/headroom.min', + 'mathjax': 'https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS_HTML', + 'highlight': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min', + 'highlight-julia': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/julia.min', + 'highlight-julia-repl': 'https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/languages/julia-repl.min', }, shim: { 'mathjax' : { exports: "MathJax" }, - 'highlight-julia': ['highlight'] + 'highlight-julia': ['highlight'], + 'highlight-julia-repl': ['highlight'], } }); @@ -50,16 +53,77 @@ require(['mathjax'], function(MathJax) { }); }) -require(['jquery', 'highlight', 'highlight-julia'], function($, hljs) { +require(['jquery', 'highlight', 'highlight-julia', 'highlight-julia-repl'], function($, hljs) { $(document).ready(function() { - if (typeof DOC_VERSIONS !== 'undefined') { - var version_selector = $("#version-selector"); - DOC_VERSIONS.forEach(function(each) { - var option = $(""); - version_selector.append(option); - }); - } hljs.initHighlighting(); }) }) + +// update the version selector with info from the siteinfo.js and ../versions.js files +require(['jquery'], function($) { + $(document).ready(function() { + var version_selector = $("#version-selector"); + + // add the current version to the selector based on siteinfo.js, but only if the selector is empty + if (typeof DOCUMENTER_CURRENT_VERSION !== 'undefined' && $('#version-selector > option').length == 0) { + var option = $(""); + version_selector.append(option); + } + + if (typeof DOC_VERSIONS !== 'undefined') { + var existing_versions = $('#version-selector > option'); + var existing_versions_texts = existing_versions.map(function(i,x){return x.text}); + DOC_VERSIONS.forEach(function(each) { + var version_url = documenterBaseURL + "/../" + each; + var existing_id = $.inArray(each, existing_versions_texts); + // if not already in the version selector, add it as a new option, + // otherwise update the old option with the URL and enable it + if (existing_id == -1) { + var option = $(""); + version_selector.append(option); + } else { + var option = existing_versions[existing_id]; + option.value = version_url; + option.disabled = false; + } + }); + } + + // only show the version selector if the selector has been populated + if ($('#version-selector > option').length > 0) { + version_selector.css("visibility", "visible"); + } + }) + +}) + +// mobile +require(['jquery', 'headroom'], function($, Headroom) { + $(document).ready(function() { + var navtoc = $("nav.toc"); + $("nav.toc li.current a.toctext").click(function() { + navtoc.toggleClass('show'); + }); + $("article > header div#topbar a.fa-bars").click(function(ev) { + ev.preventDefault(); + navtoc.toggleClass('show'); + if (navtoc.hasClass('show')) { + var title = $("article > header div#topbar span").text(); + $("nav.toc ul li a:contains('" + title + "')").focus(); + } + }); + $("article#docs").bind('click', function(ev) { + if ($(ev.target).is('div#topbar a.fa-bars')) { + return; + } + if (navtoc.hasClass('show')) { + navtoc.removeClass('show'); + } + }); + if ($("article > header div#topbar").css('display') == 'block') { + var headroom = new Headroom(document.querySelector("article > header div#topbar"), {"tolerance": {"up": 10, "down": 10}}); + headroom.init(); + } + }) +}) diff --git a/latest/contributing.html b/latest/contributing.html index be4e7d89..05835e9f 100644 --- a/latest/contributing.html +++ b/latest/contributing.html @@ -1,137 +1,9 @@ - - - - - -Contributing & Help · Flux - - - - - - - - - - - - - - -
-
- -
-
-

- -Contributing - -

-

-If you need help, please ask on the - -Julia forum - -, the - -slack - - (channel #machine-learning), or Flux's - -Gitter - -. -

-

-Right now, the best way to help out is to try out the examples and report any issues or missing features as you find them. The second best way is to help us spread the word, perhaps by - -starring the repo - -. -

-

-If you're interested in hacking on Flux, most of the - -code - - is pretty straightforward. Adding new - -layer definitions - - or cost functions is simple using the Flux DSL itself, and things like data utilities and training processes are all plain Julia code. The -compiler - directory is a bit more involved and is documented in - -internals - -, but most changes won't need to touch that. -

-

-If you get stuck or need anything, let us know! -

- -
- - +

Contributing & Help

Contributing

If you need help, please ask on the Julia forum, the slack (channel #machine-learning), or Flux's Gitter.

Right now, the best way to help out is to try out the examples and report any issues or missing features as you find them. The second best way is to help us spread the word, perhaps by starring the repo.

If you're interested in hacking on Flux, most of the code is pretty straightforward. Adding new layer definitions or cost functions is simple using the Flux DSL itself, and things like data utilities and training processes are all plain Julia code. The compiler directory is a bit more involved and is documented in internals, but most changes won't need to touch that.

If you get stuck or need anything, let us know!

diff --git a/latest/index.html b/latest/index.html index 3f869a82..b4d25c4a 100644 --- a/latest/index.html +++ b/latest/index.html @@ -1,95 +1,9 @@ - - - - - -Home · Flux - - - - - - - - - - - - - - -
-
- -
-
-

- -Flux - -

- -
- - +

Home

Flux

diff --git a/latest/search.html b/latest/search.html index a973459e..2334f457 100644 --- a/latest/search.html +++ b/latest/search.html @@ -1,82 +1,9 @@ - - - - - -Search · Flux - - - - - - - - - - - - - - -
-
- -
-
-

-Search -

-

-Number of results: - -loading... - -

- -
- - - - +

Search

Search

Number of results: loading...

diff --git a/latest/siteinfo.js b/latest/siteinfo.js new file mode 100644 index 00000000..ecacf6d1 --- /dev/null +++ b/latest/siteinfo.js @@ -0,0 +1 @@ +var DOCUMENTER_CURRENT_VERSION = "latest";