From dc8d41b94aa49c31849596ea986368c3bb3c29e3 Mon Sep 17 00:00:00 2001 From: Timothy Hunter Date: Mon, 14 Dec 2015 11:39:54 -0800 Subject: [PATCH 1/6] menu --- docs/_layouts/global.html | 34 ++++++---- docs/css/main.css | 134 +++++++++++++++++++++++++++++++++++++- 2 files changed, 155 insertions(+), 13 deletions(-) diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html index 0b5b0cd48af64..1faaf63bdac6a 100755 --- a/docs/_layouts/global.html +++ b/docs/_layouts/global.html @@ -128,19 +128,31 @@ {% if page.url contains "/ml" %} {% include nav-left-wrapper-ml.html nav-mllib=site.data.menu-mllib nav-ml=site.data.menu-ml %} + + +
+ {% if page.displayTitle %} +

{{ page.displayTitle }}

+ {% else %} +

{{ page.title }}

+ {% endif %} + + {{ content }} + +
+ {% else %} +
+ {% if page.displayTitle %} +

{{ page.displayTitle }}

+ {% else %} +

{{ page.title }}

+ {% endif %} + + {{ content }} + +
{% endif %} - -
- {% if page.displayTitle %} -

{{ page.displayTitle }}

- {% else %} -

{{ page.title }}

- {% endif %} - - {{ content }} - -
diff --git a/docs/css/main.css b/docs/css/main.css index 356b324d6303b..c78d90c47197a 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -39,13 +39,26 @@ margin-left: 10px; } +/* body .container-wrapper { position: absolute; width: 100%; display: flex; } +*/ -body #content { +body .container-wrapper { + background-color: #FFF; + color: #1D1F22; + max-width: 1024px; + margin-top: 10px; + margin-left: auto; + margin-right: auto; + border-radius: 15px; + position: relative; +} + +body #contentREMOVE { position: relative; line-height: 1.6; /* Inspired by Github's wiki style */ @@ -101,6 +114,24 @@ a:hover code { max-width: 914px; } +.content { + z-index: 1; + position: relative; + background-color: #FFF; + padding-left: 15px; + max-width: 914px; + line-height: 1.6; /* Inspired by Github's wiki style */ + background-color: white; +} + +.content-with-sidebar { + z-index: 1; + position: relative; + background-color: #FFF; + padding-left: 15px; + max-width: 914px; +} + .dropdown-menu { /* Remove the default 2px top margin which causes a small gap between the hover trigger area and the popup menu */ @@ -171,15 +202,28 @@ a.anchorjs-link:hover { text-decoration: none; } * The left navigation bar. */ .left-menu-wrapper { +margin-left: 0px; +margin-right: 0px; +background-color: inherit; +border-top-left-radius: 15px; +border-top-width: 0px; +border-left-width: 0px; +border-bottom-width: 0px; +margin-top: 0px; +width: 210px; +float: left; +position: absolute; +/* position: absolute; height: 100%; width: 256px; margin-top: -20px; padding-top: 20px; - background-color: #F0F8FC; + background-color: #F0F8FC;*/ } +/* .left-menu { position: fixed; max-width: 350px; @@ -187,8 +231,94 @@ a.anchorjs-link:hover { text-decoration: none; } padding-right: 10px; width: 256px; } +*/ + +.left-menu { +padding: 0px; +width: 199px; +} .left-menu h3 { margin-left: 10px; line-height: 30px; +} + +/** + * The collapsing button for the navigation bar. + */ +.nav-trigger { + position: fixed; + clip: rect(0, 0, 0, 0); +} + +.nav-trigger + label:after { + content: '»'; +} + +label { + z-index: 10; +} + +label[for="nav-trigger"] { + position: fixed; + margin-left: 0px; + padding-top: 100px;s + z-index: 10; + width: 15px; + height: 80%; + cursor: pointer; + background-size: contain; + background-color: #F6F6F6; + border-radius: 10px 0px 0px 10px; +} + +label[for="nav-trigger"]:hover { + background-color: #D0D0D0; +} + +.nav-trigger:checked + label { + margin-left: 200px; +} + +.nav-trigger:checked + label:after { + content: '«'; +} + +.nav-trigger:checked ~ div.content-with-sidebar { + margin-left: 200px; +} +.nav-trigger + label, div.content-with-sidebar { + transition: left 0.4s; +} + +/** + * Rules to collapse the menu automatically when the screen becomes too thin. + */ + +@media all and (max-width: 780px) { + + div.content-with-sidebar { + margin-left: 200px; + } + .nav-trigger + label:after { + content: '«'; + } + label[for="nav-trigger"] { + margin-left: 200px; + } + + .nav-trigger:checked + label { + margin-left: 0px; + } + .nav-trigger:checked + label:after { + content: '»'; + } + .nav-trigger:checked ~ div.content-with-sidebar { + margin-left: 0px; + } + + div.container-index { + margin-left: -215px; + } + } \ No newline at end of file From 94e82743956bce72f5ca2402be535fced36db24e Mon Sep 17 00:00:00 2001 From: Timothy Hunter Date: Mon, 14 Dec 2015 12:00:50 -0800 Subject: [PATCH 2/6] colors fixed --- docs/css/main.css | 53 +++++++++++++++-------------------------------- docs/js/main.js | 2 +- 2 files changed, 18 insertions(+), 37 deletions(-) diff --git a/docs/css/main.css b/docs/css/main.css index c78d90c47197a..1571643bf20b0 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -128,7 +128,7 @@ a:hover code { z-index: 1; position: relative; background-color: #FFF; - padding-left: 15px; + padding-left: 30px; max-width: 914px; } @@ -202,40 +202,21 @@ a.anchorjs-link:hover { text-decoration: none; } * The left navigation bar. */ .left-menu-wrapper { -margin-left: 0px; -margin-right: 0px; -background-color: inherit; -border-top-left-radius: 15px; -border-top-width: 0px; -border-left-width: 0px; -border-bottom-width: 0px; -margin-top: 0px; -width: 210px; -float: left; -position: absolute; -/* + margin-left: 0px; + margin-right: 0px; + background-color: #F0F8FC; + border-top-width: 0px; + border-left-width: 0px; + border-bottom-width: 0px; + margin-top: 0px; + width: 210px; + float: left; position: absolute; - height: 100%; - - width: 256px; - margin-top: -20px; - padding-top: 20px; - background-color: #F0F8FC;*/ } -/* -.left-menu { - position: fixed; - max-width: 350px; - - padding-right: 10px; - width: 256px; -} -*/ - .left-menu { -padding: 0px; -width: 199px; + padding: 0px; + width: 199px; } .left-menu h3 { @@ -262,18 +243,18 @@ label { label[for="nav-trigger"] { position: fixed; margin-left: 0px; - padding-top: 100px;s - z-index: 10; - width: 15px; + padding-top: 100px; + padding-left: 5px; + width: 10px; height: 80%; cursor: pointer; background-size: contain; - background-color: #F6F6F6; + background-color: #D4F0FF; border-radius: 10px 0px 0px 10px; } label[for="nav-trigger"]:hover { - background-color: #D0D0D0; + background-color: #BEE9FF; } .nav-trigger:checked + label { diff --git a/docs/js/main.js b/docs/js/main.js index f5d66b16f7b21..2329eb8327dd5 100755 --- a/docs/js/main.js +++ b/docs/js/main.js @@ -83,7 +83,7 @@ $(function() { // Display anchor links when hovering over headers. For documentation of the // configuration options, see the AnchorJS documentation. anchors.options = { - placement: 'left' + placement: 'right' }; anchors.add(); From b091b42660ac510ba49ddf0274c779ae1c249b67 Mon Sep 17 00:00:00 2001 From: Timothy Hunter Date: Mon, 14 Dec 2015 12:41:28 -0800 Subject: [PATCH 3/6] add the original author to the notice --- NOTICE | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/NOTICE b/NOTICE index 7f7769f73047f..571f8c2fff7ff 100644 --- a/NOTICE +++ b/NOTICE @@ -606,4 +606,11 @@ Vis.js uses and redistributes the following third-party libraries: - keycharm https://github.com/AlexDM0/keycharm - The MIT License \ No newline at end of file + The MIT License + +=============================================================================== + +The CSS style for the navigation sidebar of the documentation was originally +submitted by Óscar Nájera for the scikit-learn project. The scikit-learn project +is distributed under the 3-Clause BSD license. +=============================================================================== From 6b8e9cf92f6c7a0e6883fa591b7667c127b04fe3 Mon Sep 17 00:00:00 2001 From: Timothy Hunter Date: Tue, 15 Dec 2015 16:36:45 -0800 Subject: [PATCH 4/6] comments from @parano --- docs/_layouts/global.html | 33 +++++++++++++------------ docs/css/main.css | 52 ++++++++++++++------------------------- 2 files changed, 35 insertions(+), 50 deletions(-) diff --git a/docs/_layouts/global.html b/docs/_layouts/global.html index 1faaf63bdac6a..3089474c13385 100755 --- a/docs/_layouts/global.html +++ b/docs/_layouts/global.html @@ -1,3 +1,4 @@ + @@ -127,32 +128,32 @@
{% if page.url contains "/ml" %} - {% include nav-left-wrapper-ml.html nav-mllib=site.data.menu-mllib nav-ml=site.data.menu-ml %} - - + {% include nav-left-wrapper-ml.html nav-mllib=site.data.menu-mllib nav-ml=site.data.menu-ml %} + +
- {% if page.displayTitle %} -

{{ page.displayTitle }}

- {% else %} -

{{ page.title }}

- {% endif %} + {% if page.displayTitle %} +

{{ page.displayTitle }}

+ {% else %} +

{{ page.title }}

+ {% endif %} - {{ content }} + {{ content }} -
+
{% else %}
- {% if page.displayTitle %} + {% if page.displayTitle %}

{{ page.displayTitle }}

- {% else %} + {% else %}

{{ page.title }}

- {% endif %} + {% endif %} - {{ content }} + {{ content }} -
+ {% endif %} - + diff --git a/docs/css/main.css b/docs/css/main.css index 1571643bf20b0..6c4cb8fa76e5b 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -39,14 +39,6 @@ margin-left: 10px; } -/* -body .container-wrapper { - position: absolute; - width: 100%; - display: flex; -} -*/ - body .container-wrapper { background-color: #FFF; color: #1D1F22; @@ -58,14 +50,6 @@ body .container-wrapper { position: relative; } -body #contentREMOVE { - position: relative; - - line-height: 1.6; /* Inspired by Github's wiki style */ - background-color: white; - padding-left: 15px; -} - .title { font-size: 32px; } @@ -228,12 +212,12 @@ a.anchorjs-link:hover { text-decoration: none; } * The collapsing button for the navigation bar. */ .nav-trigger { - position: fixed; - clip: rect(0, 0, 0, 0); + position: fixed; + clip: rect(0, 0, 0, 0); } .nav-trigger + label:after { - content: '»'; + content: '»'; } label { @@ -241,35 +225,35 @@ label { } label[for="nav-trigger"] { - position: fixed; - margin-left: 0px; - padding-top: 100px; - padding-left: 5px; - width: 10px; - height: 80%; - cursor: pointer; - background-size: contain; - background-color: #D4F0FF; - border-radius: 10px 0px 0px 10px; + position: fixed; + margin-left: 0px; + padding-top: 100px; + padding-left: 5px; + width: 10px; + height: 80%; + cursor: pointer; + background-size: contain; + background-color: #D4F0FF; } label[for="nav-trigger"]:hover { - background-color: #BEE9FF; + background-color: #BEE9FF; } .nav-trigger:checked + label { - margin-left: 200px; + margin-left: 200px; } .nav-trigger:checked + label:after { - content: '«'; + content: '«'; } .nav-trigger:checked ~ div.content-with-sidebar { - margin-left: 200px; + margin-left: 200px; } + .nav-trigger + label, div.content-with-sidebar { - transition: left 0.4s; + transition: left 0.4s; } /** From 464dcb55c494d498e719c097bbac0d837d26e5ec Mon Sep 17 00:00:00 2001 From: Timothy Hunter Date: Tue, 15 Dec 2015 16:40:50 -0800 Subject: [PATCH 5/6] changes --- docs/css/main.css | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/css/main.css b/docs/css/main.css index 6c4cb8fa76e5b..5b7ca3c62de03 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -102,18 +102,20 @@ a:hover code { z-index: 1; position: relative; background-color: #FFF; - padding-left: 15px; max-width: 914px; line-height: 1.6; /* Inspired by Github's wiki style */ background-color: white; + padding-left: 15px; } .content-with-sidebar { z-index: 1; position: relative; background-color: #FFF; + max-width: 914px; + line-height: 1.6; /* Inspired by Github's wiki style */ + background-color: white; padding-left: 30px; - max-width: 914px; } .dropdown-menu { From 19b92a21ecd157ad834cef81caf206cd26a84a45 Mon Sep 17 00:00:00 2001 From: Timothy Hunter Date: Tue, 15 Dec 2015 17:43:42 -0800 Subject: [PATCH 6/6] duplicate css code --- docs/css/main.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/css/main.css b/docs/css/main.css index 5b7ca3c62de03..175e8004fca0e 100755 --- a/docs/css/main.css +++ b/docs/css/main.css @@ -104,7 +104,6 @@ a:hover code { background-color: #FFF; max-width: 914px; line-height: 1.6; /* Inspired by Github's wiki style */ - background-color: white; padding-left: 15px; } @@ -114,7 +113,6 @@ a:hover code { background-color: #FFF; max-width: 914px; line-height: 1.6; /* Inspired by Github's wiki style */ - background-color: white; padding-left: 30px; }