Skip to content
This repository has been archived by the owner on Sep 25, 2023. It is now read-only.

Commit

Permalink
Use PyData Sphinx Theme for Generated Documentation (#436)
Browse files Browse the repository at this point in the history
Resolves #435.

- Updated conda environments to install `pydata-sphinx-theme`
- Updated `docs/source/conf.py` to use new theme
- Following the lead of cuDF, added RAPIDS logo and purple styling in `params.css`

Authors:
  - colton (https://github.com/cmpadden)

Approvers:
  - AJ Schmidt (https://github.com/ajschmidt8)

URL: #436
  • Loading branch information
cmpadden authored Nov 3, 2021
1 parent 6e1145d commit 8d0f511
Show file tree
Hide file tree
Showing 8 changed files with 74 additions and 15 deletions.
3 changes: 2 additions & 1 deletion conda/environments/cusignal_airt.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ dependencies:
- pytest
- pytest-benchmark
- sphinx
- sphinx_rtd_theme
- pydata-sphinx-theme
- sphinx-copybutton
- numpydoc
- ipython
- pip
Expand Down
3 changes: 2 additions & 1 deletion conda/environments/cusignal_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ dependencies:
- pytest-benchmark
- cupy>=9.0.0
- sphinx
- sphinx_rtd_theme
- pydata-sphinx-theme
- sphinx-copybutton
- numpydoc
- ipython
3 changes: 2 additions & 1 deletion conda/environments/cusignal_full.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ dependencies:
- cugraph
- pandas
- sphinx
- sphinx_rtd_theme
- pydata-sphinx-theme
- sphinx-copybutton
- numpydoc
- ipython
3 changes: 2 additions & 1 deletion conda/environments/cusignal_jetson_base.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ dependencies:
- pytest
- pytest-benchmark
- sphinx
- sphinx_rtd_theme
- pydata-sphinx-theme
- sphinx-copybutton
- numpydoc
- ipython
- pip
Expand Down
5 changes: 3 additions & 2 deletions docs/requirement.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
sphinx
sphinx_rtd_theme
pydata-sphinx-theme
sphinx-copybutton
numpydoc
ipython
ipython
Binary file added docs/source/_static/RAPIDS-logo-purple.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
49 changes: 46 additions & 3 deletions docs/source/_static/params.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,50 @@
* which is not showing up in our theme.
*/
.classifier:before {
font-style: normal;
margin: 0.5em;
content: ":";
font-style: normal;
margin: 0.5em;
content: ":";
}

/* Fix for text wrap in sphinx tables:
* https://rackerlabs.github.io/docs-rackspace/tools/rtd-tables.html
*/
@media screen and (min-width: 767px) {
.wy-table-responsive table td {
/* !important prevents the common CSS stylesheets from overriding
this as on RTD they are loaded after this stylesheet */
white-space: normal !important;
}

.wy-table-responsive {
overflow: visible !important;
}
}

table.io-supported-types-table {
text-align: center;
}

table.io-supported-types-table thead {
text-align: center !important;
}

:root {
--pst-color-active-navigation: 114, 83, 237;
--pst-color-navbar-link: 77, 77, 77;
--pst-color-navbar-link-hover: var(--pst-color-active-navigation);
--pst-color-navbar-link-active: var(--pst-color-active-navigation);
--pst-color-sidebar-link: 77, 77, 77;
--pst-color-sidebar-link-hover: var(--pst-color-active-navigation);
--pst-color-sidebar-link-active: var(--pst-color-active-navigation);
--pst-color-sidebar-expander-background-hover: 244, 244, 244;
--pst-color-sidebar-caption: 77, 77, 77;
--pst-color-toc-link: 119, 117, 122;
--pst-color-toc-link-hover: var(--pst-color-active-navigation);
--pst-color-toc-link-active: var(--pst-color-active-navigation);
}

.special-table td,
.special-table th {
border: 1px solid #dee2e6;
}
23 changes: 17 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,14 @@
'sphinx.ext.intersphinx',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx_copybutton',
'numpydoc',
'IPython.sphinxext.ipython_console_highlighting',
'IPython.sphinxext.ipython_directive',
]

copybutton_prompt_text = ">>> "
autosummary_generate = True
ipython_mplbackend = 'str'

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -94,7 +97,8 @@
# a list of builtin themes.
#

html_theme = 'sphinx_rtd_theme'
html_theme = 'pydata_sphinx_theme'
html_logo = "_static/RAPIDS-logo-purple.png"

# on_rtd is whether we are on readthedocs.org
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
Expand All @@ -103,16 +107,22 @@
# only import and set the theme if we're building docs locally
# otherwise, readthedocs.org uses their theme by default,
# so no need to specify it
import sphinx_rtd_theme
html_theme = 'sphinx_rtd_theme'
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]
import pydata_sphinx_theme
html_theme = 'pydata_sphinx_theme'
html_theme_path = pydata_sphinx_theme.get_html_theme_path()


# 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
# documentation.
#
# html_theme_options = {}
html_theme_options = {
"external_links": [],
"github_url": "https://github.com/rapidsai/cusignal",
"twitter_url": "https://twitter.com/rapidsai",
"show_toc_level": 1,
"navbar_align": "right",
}

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
Expand Down Expand Up @@ -182,8 +192,9 @@


# Config numpydoc
numpydoc_show_inherited_class_members = False
numpydoc_show_inherited_class_members = True
numpydoc_class_members_toctree = False
numpydoc_attributes_as_param_list = False


def setup(app):
Expand Down

0 comments on commit 8d0f511

Please sign in to comment.