Skip to content

sphinx & theme update fixes #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 20 commits into from
Jun 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions doc/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/* PYDATA THEME */
html[data-theme="dark"] img:not(.only-dark):not(.dark-light) {
filter: brightness(1) contrast(1) !important;
}

html[data-theme="dark"] .bd-content img:not(.only-dark):not(.dark-light) {
background: none !important;
border-radius: 0;
}

html[data-theme="light"] {
--pst-color-primary: #0063BC;
}

html[data-theme="dark"] {
--pst-color-primary: #0092ff;
}

/* BOOTSTRAP */
.card {
background: none !important;
}
Binary file modified doc/_static/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/_static/logo_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions doc/_templates/logo.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
<p class="logo" style="text-align:center;"><a href="{{ pathto(master_doc)|e }}">
<img class="logo" src="{{ pathto('logo.png', 1)|e }}" alt="Logo" width="65%" height="65%">
</a></p>

<script type="text/javascript">
// Change the logo depending on the theme
var logo = document.querySelector('img.logo');
var observer = new MutationObserver(function(mutations) {
const dark = document.documentElement.dataset.theme == 'dark';
if (dark) {
logo.src = "{{ pathto('logo_dark.png', 1)|e }}";
} else {
logo.src = "{{ pathto('logo.png', 1)|e }}";
}
});
observer.observe(document.documentElement, {attributes: true, attributeFilter: ['data-theme']});
</script>
59 changes: 3 additions & 56 deletions doc/_templates/sidebar-doubleml-workflow.html
Original file line number Diff line number Diff line change
@@ -1,58 +1,5 @@
<style>

.toc-entry {
list-style: none;
margin-left: 0em;
min-height: 50px;
border-left: 2px solid rgba(var(--pst-color-text-base), 1);
padding: 0 0 50px 0px;
position: relative;
}
.toc-entry:last-child{
border-left: 0;
left: 2px;
}

.toc-entry::after{
border-left: 0;
position: absolute;
left: -8px;
top: 0px;
content: " ";
border: 2px solid rgba(255, 255, 255, 1);
border-radius: 500%;
background: rgba(var(--pst-color-toc-link-active), 1);
height: 15px;
width: 15px;
}

.toc-entry:hover::after {
background: rgba(var(--pst-color-link-hover), 1);
transition: all 200ms ease-in-out;
}

.toc-entry > .nav-link {
position: relative;
font-size: small;
font-weight: 600;
text-align: left;
margin: 0;
top: -5px;
color: rgba(var(--pst-color-text-base), 1);
}

.toc-entry > .nav-link.active {
color: rgba(255, 255, 255, 1);
font-size: medium;
background-color: rgba(var(--pst-color-toc-link-active), 1);
border-bottom-right-radius: 20px;
border-top-right-radius: 20px;
border-left: 0;
margin-left: 2px;
padding-right: 15px;
top: -7px;
transition: background-color 200ms ease-in-out, color 200ms ease-in-out, border 200ms ease-in-out, font-size 200ms ease-in-out;
}

.toc-entry {
padding-top: 0.5em;
}
</style>

2 changes: 2 additions & 0 deletions doc/api/api.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
.. _python_api:

API reference
=============

Expand Down
48 changes: 32 additions & 16 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
'nbsphinx',
'sphinx_gallery.load_style',
'sphinx_copybutton',
'sphinx_panels',
'sphinx_design',
'jupyter_sphinx',
]

Expand Down Expand Up @@ -72,10 +72,11 @@
html_theme_options = {
'github_url': 'https://github.com/DoubleML/doubleml-for-py',
'navigation_with_keys': False,
"header_links_before_dropdown": 6,
}

# html_logo = '../img/logo.png'
html_extra_path = ['../img/logo.png']
html_extra_path = ['../img/logo.png', '../img/logo_dark.png']
html_favicon = '../img/favicon.ico'

html_sidebars = {'**': ['logo.html',
Expand All @@ -93,6 +94,7 @@
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_css_files = ['css/custom.css']

# -- Extension configuration -------------------------------------------------

Expand Down Expand Up @@ -125,20 +127,34 @@
}

linkcheck_ignore = [
'https://doi.org/10.1093/ectj/utaa001', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1111/ectj.12097', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.2307/2171802', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.2307/1912705', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1093/ectj/utaa027', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1111/rssb.12026', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1111/rssa.12623', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1146/annurev-economics-012315-015826', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1109/TIT.2014.2343629', # Valid DOI, Causes 418 Client Error: unknown for url:...
'https://doi.org/10.1093/ectj/utaa001', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1111/0034-6527.00321', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1016/j.jeconom.2020.06.003', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1080/07350015.2021.1895815', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1198/jbes.2010.07136', # Valid DOI; Causes 403 Client Error: Forbidden for url:...
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1093/ectj/utaa001',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1111/ectj.12097',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.2307/2171802',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.2307/1912705',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1093/ectj/utaa027',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1111/rssb.12026',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1111/rssa.12623',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1146/annurev-economics-012315-015826',
# Valid DOI, Causes 418 Client Error: unknown for url:...
'https://doi.org/10.1109/TIT.2014.2343629',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1093/ectj/utaa001',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1111/0034-6527.00321',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1016/j.jeconom.2020.06.003',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1080/07350015.2021.1895815',
# Valid DOI; Causes 403 Client Error: Forbidden for url:...
'https://doi.org/10.1198/jbes.2010.07136',
]

# To execute R code via jupyter-execute one needs to install the R kernel for jupyter
Expand Down
723 changes: 666 additions & 57 deletions doc/examples/R_double_ml_pension.ipynb

Large diffs are not rendered by default.

Loading