From c6848a60e4910a382ae68407a1dd94d8105dd24b Mon Sep 17 00:00:00 2001 From: Deepansh Srivastava Date: Fri, 26 Feb 2021 13:11:57 -0500 Subject: [PATCH 1/3] docs style update. --- .pre-commit-config.yaml | 21 +++-- docs/_static/style.css | 172 ++++++++++++++++++------------------ docs/_templates/layout.html | 4 +- docs/conf.py | 79 ++++------------- docs/requirements.rst | 4 +- environment-dev.yml | 4 +- requirements-dev.txt | 4 +- 7 files changed, 121 insertions(+), 167 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 65f8f84de..6d50c516b 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,28 +1,26 @@ default_language_version: - python: python3.7 + python: python default_stages: [commit, push, manual] repos: - repo: https://github.com/ambv/black - rev: stable + rev: 20.8b1 hooks: - id: black name: black entry: black - language_version: python3.7 require_serial: true types: [python] files: \.pyi?$ - repo: https://github.com/asottile/blacken-docs - rev: v1.0.0 + rev: v1.9.2 hooks: - id: blacken-docs additional_dependencies: [black==19.3b0] language: python - language_version: python3.7 - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v1.2.3 + rev: v3.4.0 hooks: - id: check-yaml language: python @@ -32,8 +30,6 @@ repos: language: python - id: check-docstring-first language: python - - id: flake8 - language: python - id: end-of-file-fixer language: python exclude: docs/notebooks/ @@ -46,8 +42,15 @@ repos: entry: debug-statement-hook language: python types: [python] + + - repo: https://gitlab.com/pycqa/flake8 + rev: "6de8252c035844f1e679f509b5f37340b44d5c39" + hooks: + - id: flake8 + language: python + - repo: https://github.com/asottile/reorder_python_imports - rev: v1.4.0 + rev: v2.4.0 hooks: - id: reorder-python-imports name: Reorder python imports diff --git a/docs/_static/style.css b/docs/_static/style.css index ab7a20c5e..6dae3fb6e 100755 --- a/docs/_static/style.css +++ b/docs/_static/style.css @@ -113,6 +113,12 @@ img.sphx-glr-single-img:hover, padding-right: 3.5em; } +table thead, +table tbody, +table caption, +table colgroup { + width: 100%; +} table caption:hover { position: relative; color: gray; @@ -148,7 +154,7 @@ table caption:hover { width: auto; } .highlighttable .code { - max-width: 100%; + width: 100%; } .highlighttable .linenos { width: auto; @@ -179,30 +185,30 @@ table caption:hover { box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.7); } -#content-wrapper { +/* #content-wrapper { margin-left: var(--max-sidebar-width); box-sizing: border-box; width: calc(100% - var(--max-sidebar-width)); min-height: 100%; padding-bottom: 0; margin-bottom: 0; -} +} */ /* sidebar */ -#sidebar-wrapper { - position: fixed; - top: 3.5em; - bottom: 0; - left: 0; - height: calc(100% - 3.5em); - width: var(--max-sidebar-width); - padding: 0; - background-color: #333333; - overflow-x: hidden; - overflow-y: hidden; - z-index: 50; -} - +/* #sidebar-wrapper { */ +/* position: fixed; */ +/* top: 3.5em; */ +/* bottom: 0; */ +/* left: 0; */ +/* height: calc(100% - 3.5em); */ +/* width: var(--max-sidebar-width); */ +/* padding: 0; */ +/* background-color: #333333; */ +/* overflow-x: hidden; */ +/* overflow-y: hidden; */ +/* z-index: 50; */ +/* } */ +/* .sidebar.hidden-xs { position: relative; overflow-x: hidden; @@ -210,32 +216,39 @@ table caption:hover { width: calc(100% + 16px); height: calc(100% - 2em); padding-top: 1em; - /* margin-bottom: 2em; */ box-sizing: border-box; padding-bottom: 0.5em; +} */ +.bd-sidebar { + background: #f1f1f1; } +.bd-sidebar .logo { + filter: invert(1); + max-width: 100%; + height: auto; +} /* logo */ -.sidebar > .logo { +/* .sidebar > .logo { margin: auto; - /* padding: 1em; */ + padding: 1em; padding-right: 16px; width: 100%; max-width: 275px; padding-bottom: 1em; padding-top: 1em; - /* padding-left: 0.5em; - padding-right: 1.5em; */ -} + padding-left: 0.5em; + padding-right: 1.5em; + background-color: #333333; +} */ /* searchbar */ -#searchbox > h3, +/* #searchbox > h3, #searchbox > p { display: none; -} +} */ -#searchbox { - /* box-sizing: border-box; */ +/* #searchbox { display: flex; justify-content: space-around; padding-right: 16px; @@ -246,14 +259,14 @@ table caption:hover { width: 30vw; padding-left: 24px; padding-right: 24px; -} -.sidebar.hidden-xs > h3 { +} */ +/* .sidebar.hidden-xs > h3 { display: none; -} -.toctree-wrapper.compound > p.caption { +} */ +/* .toctree-wrapper.compound > p.caption { display: none; -} -.sidebar.hidden-xs > p.caption { +} */ +/* .sidebar.hidden-xs > p.caption { padding-left: 24px; padding-top: 2px; padding-bottom: 2px; @@ -261,38 +274,39 @@ table caption:hover { font-weight: 400; color: #6e6e6e; margin: 10px 0 0; -} -.sidebar.hidden-xs > ul { +} */ +/* .sidebar.hidden-xs > ul { padding: 0; } .sidebar.hidden-xs > ul:last-child { padding-bottom: 1em; margin-bottom: 1em; -} - -.sidebar.hidden-xs > h3 > a, -.sidebar.hidden-xs > div > h3 { +} */ +/* .bd-sidebar.hidden-xs > h3 > a, +.bd-sidebar.hidden-xs > div > h3 { display: block; padding-left: 24px; color: white; text-decoration: none; -} -.sidebar > ul > li > a > code { +} */ +/* .bd-links p { color: white; } -.sidebar > ul > li.current > a > code { - color: #c7254e; +.bd-links ul li { + color: #d3d3d3; } -.sidebar > ul > li:hover { - background-color: rgb(66, 66, 66); +.bd-links ul li.current { + color: white; } +.bd-links ul li:hover { + background-color: #777777; +} */ -.sidebar > ul > li.current, -.sidebar > ul > li.current:hover { +/* .bd-sidebar > ul > li.current, +.bd-sidebar > ul > li.current:hover { background-color: rgb(255, 255, 255); } - -.sidebar > ul > li > a { +.bd-sidebar > ul > li > a { display: block; padding-top: 0.15em; padding-bottom: 0.15em; @@ -302,32 +316,22 @@ table caption:hover { text-decoration: none; cursor: pointer; } - -/* selected list item header */ -.sidebar > ul > li.current > a { +.bd-sidebar > ul > li.current > a { color: black; font-weight: 500; } - -/* selected list item's sub-list */ -.sidebar > ul > li.current > ul { +.bd-sidebar > ul > li.current > ul { padding: 0; } - -/* selected list item's sub-list items */ -.sidebar > ul > li.current > ul > li { +.bd-sidebar > ul > li.current > ul > li { list-style: none; background-color: rgb(235, 235, 235); color: gray; } - -/* selected list item's sub-list's item on hover */ -.sidebar > ul > li.current > ul > li:hover { +.bd-sidebar > ul > li.current > ul > li:hover { background-color: rgb(214, 214, 214); } - -/* selected list item's sub-list's item a tags */ -.sidebar > ul > li.current > ul > li > a { +.bd-sidebar > ul > li.current > ul > li > a { display: block; padding-left: 48px; padding-right: 48px; @@ -337,11 +341,10 @@ table caption:hover { text-decoration: none; cursor: pointer; } -/* selected list item's sub-list's item selected a tags */ -.sidebar > ul > li.current > ul > li > a.current { +.bd-sidebar > ul > li.current > ul > li > a.current { color: black; font-weight: 500; -} +} */ ul.this-page-menu { padding-left: 0; @@ -358,22 +361,19 @@ ul.this-page-menu a { /* footer */ footer { - margin-left: calc(var(--max-sidebar-width) + 0.6em); + /* margin-left: calc(var(--max-sidebar-width) + 0.6em); */ box-sizing: border-box; - min-height: 100%; - /* width: calc(75% - 0.35em); */ - width: calc(100% - var(--max-sidebar-width) - 0.55em); - max-width: 900px; - padding-left: 2em; - padding-right: 2em; - padding-top: 1.5em; - padding-bottom: 2.25em; + /* min-height: 100%; */ + /* width: calc(100% - var(--max-sidebar-width) - 0.55em); */ + /* margin-left: -1.1em; + padding-right: 1.1em; */ + padding-bottom: 0.1em; color: whitesmoke; background-color: #333333; box-shadow: 0 0 30px 0 rgb(128, 128, 128, 0.3); } -footer .flex { +/* footer .flex { width: 100%; display: flex; justify-content: space-between; @@ -389,7 +389,7 @@ footer a:visited { footer a:hover, footer a:active { color: rgb(255, 205, 164); -} +} */ table:not([class]):not([id]) { display: flex; @@ -449,11 +449,11 @@ tr td { max-width: 992px; } - footer { + /* footer { width: calc(100vw - 2em); margin-left: 0; max-width: 992px; - } + } */ #content-wrapper { margin: 0; width: 100%; @@ -464,19 +464,19 @@ tr td { max-width: 992px; } - #sidebar-wrapper { + /* #sidebar-wrapper { display: none; - } + } */ } @media screen and (max-width: 650px) { - #content-wrapper { + /* #content-wrapper { padding: 0; - } - footer { + } */ + /* footer { margin-left: -15px; width: calc(100% + 30px); - } + } */ table:not([class]):not([id]) { width: 100%; } diff --git a/docs/_templates/layout.html b/docs/_templates/layout.html index fd228adc7..bd6073dbb 100644 --- a/docs/_templates/layout.html +++ b/docs/_templates/layout.html @@ -12,7 +12,7 @@ {%- block footer %}