Skip to content

Commit

Permalink
Update RTD theme and add jsPsych tab (#439)
Browse files Browse the repository at this point in the history
* remove forked rtd theme
* customize the layout template sidebartitle block with the tabbed nav html from sphinx-rtd-theme-frameplayer repo
* remove tab margin-right to get them to fit inside the nav menu
* update requirements
* change project title from Lookit to CHS/Lookit
  • Loading branch information
becky-gilbert authored Nov 14, 2024
1 parent e773305 commit ec30244
Show file tree
Hide file tree
Showing 6 changed files with 90 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion docs/_themes
Submodule _themes deleted from 06894f
36 changes: 28 additions & 8 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,42 @@
alabaster==0.7.12
attrs==23.1.0
Babel==2.9.1
certifi==2024.7.4
chardet==4.0.0
charset-normalizer==3.3.2
commonmark==0.8.1
docutils==0.17.1
docutils==0.20.1
future==0.18.2
idna==3.7
imagesize==1.2.0
Jinja2==2.11.3
MarkupSafe==1.1.1
packaging==20.9
Pygments==2.9.0
imagesize==1.4.1
importlib-resources==6.1.1
importlib_metadata==8.5.0
Jinja2==3.1.4
jsonschema==4.20.0
jsonschema-specifications==2023.11.1
MarkupSafe==2.1.5
packaging==24.2
pip-review==1.3.0
pkgutil_resolve_name==1.3.10
Pygments==2.18.0
pyparsing==2.4.7
pytz==2021.1
recommonmark==0.5.0
referencing==0.31.0
requests==2.32.2
rpds-py==0.13.1
six==1.16.0
snowballstemmer==2.1.0
Sphinx==1.8.5
sphinxcontrib-serializinghtml==1.1.4
Sphinx==7.1.2
sphinx-rtd-theme==3.0.1
sphinxcontrib-applehelp==1.0.4
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.1
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
sphinxcontrib-websupport==1.2.4
sphobjinv==2.3.1
urllib3==1.26.19
zipp==3.20.2
2 changes: 1 addition & 1 deletion docs/source/_static/css/lookit.css
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ nav#toggle-lookit-frameplayer li {
border: thin solid whitesmoke;
padding: 10px 10px .5em 12px;
border-width: 1px 1px 0px 1px;
margin: 0 10px 0 0;
margin: 0;
border-radius: 20px 8px 0px 0px;
background-color: #343131;
}
Expand Down
59 changes: 59 additions & 0 deletions docs/source/_templates/layout.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{%- extends "!layout.html" %}

{% block sidebartitle %}

{# From the sphinx-rtd-theme layout: https://github.com/simonw/sphinx_rtd_theme/blob/master/sphinx_rtd_theme/layout.html #}

{% if logo and theme_logo_only %}
<a href="{{ theme_logo_url or pathto(master_doc) }}">
{% else %}
<a href="{{ theme_logo_url or pathto(master_doc) }}" class="icon icon-home"> {{ project }}
{% endif %}

{% if logo %}
{# Not strictly valid HTML, but it's the only way to display/scale
it properly, without weird scripting or heaps of work
#}
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
{% endif %}
</a>

{% if theme_display_version %}
{%- set nav_version = version %}
{% if READTHEDOCS and current_version %}
{%- set nav_version = current_version %}
{% endif %}
{% if nav_version %}
<div class="version">
{{ nav_version }}
</div>
{% endif %}
{% endif %}

{% include "searchbox.html" %}

{# From Kim's forked RTD theme: https://github.com/kimberscott/sphinx-rtd-theme-frameplayer #}
<div id="toggle-tab-container" style="position: relative;">
<nav id="toggle-lookit-frameplayer">
<ul>
<li id="selected">
{% if logo and theme_logo_only %}
<a href="{{ pathto(master_doc) }}">
{% else %}
<a href="{{ pathto(master_doc) }}" class="icon icon-home"> CHS
{% endif %}
{% if logo %}
{# Not strictly valid HTML, but it's the only way to display/scale
it properly, without weird scripting or heaps of work
#}
<img src="{{ pathto('_static/' + logo, 1) }}" class="logo" alt="{{ _('Logo') }}"/>
{% endif %}
</a>
</li>
<li><a href="https://lookit.readthedocs.io/projects/frameplayer/" class="fa fa-puzzle-piece"> Lookit EFP </a></li>
<li><a href="https://lookit.readthedocs.io/projects/chs-jspsych/" class="fa fa-puzzle-piece"> jsPsych </a></li>
</ul>
</nav>
</div>

{% endblock %}
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@
master_doc = 'index'

# General information about the project.
project = 'Lookit'
project = 'CHS/Lookit'
copyright = '2017, Center for Open Science and MIT'
author = 'Center for Open Science, MIT'

Expand Down Expand Up @@ -89,7 +89,7 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = "sphinx_rtd_theme"
html_theme_path = ["../_themes"]
#html_theme_path = ["../_themes"]

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand Down

0 comments on commit ec30244

Please sign in to comment.