Skip to content
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

Pydata Sphinx Theme with RAPIDS customization #541

Open
wants to merge 16 commits into
base: branch-23.10
Choose a base branch
from
Open
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
Binary file added docs/source/_static/RAPIDS-logo-sm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
109 changes: 109 additions & 0 deletions docs/source/_static/custom.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
/* RAPIDS Custom Docs css */
/* https://pydata-sphinx-theme.readthedocs.io/en/stable/user_guide/styling.html#custom-css */

body {
margin: 0;
padding: 0;
}

/* RAPIDS custom colors primary */

html[data-theme="light"] {
--pst-color-primary: #7306ff;
--pst-color-secondary: #984dfb;
--pst-color-info: #ffb500;
--pst-color-danger: #d216d2;
--pst-color-target: #37c9dd;
}

html[data-theme="dark"] {
--pst-color-primary: #7306ff;
--pst-color-secondary: #984dfb;
--pst-color-info: #ffb500;
--pst-color-danger: #d216d2;
--pst-color-target: #37c9dd;
}

/* PyData Overrides */

/* NavBar */
.bd-header {
height: 56px;
background-color: #7400ff !important;
box-shadow: 0px 3px 2px rgba(0, 0, 0, 0.2);
}

.bd-header .navbar-nav li a.nav-link, .bd-header .navbar-nav .dropdown button {
color: white;
font-weight: bold;
}

.bd-header .navbar-nav>.active>.nav-link {
color: #b49fd6 !important;
padding-left: 0.8rem;
padding-right: 0.8rem;
}

.bd-header .navbar-nav li a.nav-link:focus, .bd-header .navbar-nav li a.nav-link:hover {
color: #b49fd6 !important;
}

.navbar-brand, .navbar-brand:hover {
padding: 0.6em 0;
text-decoration: none;
}

.navbar-brand p {
color: white;
font-weight: bold;
}

button.btn.version-switcher__button {
color: white;
margin-bottom: unset;
}

.version-switcher__menu {
background-color: rgb(139 47 255);
border-width: 0;
border-top-right-radius: 0;
border-top-left-radius:0;
box-shadow: 0 4px 4px rgb(10 10 10 / 20%);
}

.version-switcher__menu a.list-group-item:hover {
background-color: rgb(139 47 255);
color: #b49fd6 !important;
}

.dropdown-menu[data-bs-popper]{
margin-top: 0.7rem;
}

.version-switcher__menu a.list-group-item {
color: white;
background-color: inherit;
}

.search-button, .theme-switch-button span, .navbar-icon-links i.fa-square-twitter:before {
color: #ebebeb;
}

.bd-header .navbar-nav .dropdown .dropdown-menu {
background-color: rgb(139 47 255);
margin: 0.6rem;
border-width: 0;
min-width: 12rem;
border-top-right-radius: 0;
border-top-left-radius:0;
box-shadow: 0 4px 4px rgb(10 10 10 / 20%);
}

.bd-header label.sidebar-toggle {
color: white;
}

/* Body Text */
nav.bd-links p.bd-links__title {
color: rgb(48, 48, 48);
}
Binary file removed docs/source/_static/rapids_logo.png
Binary file not shown.
67 changes: 47 additions & 20 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# Copyright (c) 2019-2023, NVIDIA CORPORATION.
import pydata_sphinx_theme

# -- Project information -----------------------------------------------------
project = "cuxfilter"
Expand Down Expand Up @@ -50,32 +51,58 @@
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]


# -- Options for HTML output -------------------------------------------------
# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
html_theme = "pydata_sphinx_theme"
html_logo = "_static/rapids_logo.png"
html_static_path = ["_static"]
# source_suffix = ['.rst', '.md']
source_suffix = {".rst": "restructuredtext"}

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# Removes sidebar

# Output file base name for HTML help builder. Default is 'pydoc'
#
htmlhelp_basename = "cuxfilterdoc"

html_sidebars = {"user_guide/index": []}
# -- Options for HTML output -------------------------------------------------

# PyData Theme Options RAPIDS style
# https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html

html_theme = "pydata_sphinx_theme"
html_logo= "_static/RAPIDS-logo-sm.png"
html_static_path = ["_static"]
html_css_files = ['custom.css'] # temp, link out to theme github eventually

html_theme_options = {
"external_links": [],
"icon_links": [],
"github_url": "https://github.com/rapidsai/cuxfilter",
"twitter_url": "https://twitter.com/rapidsai",
"show_toc_level": 1,
"navbar_align": "right",
"logo": {
"text": project,
"link": "https://rapids.ai/"
},
"external_links": [
{"name": "GitHub", "url": f"https://github.com/rapidsai/{project}"},
{"name": "Ecosystem", "url": "https://rapids.ai/ecosystem"},
{"name": "Learn More", "url": "https://rapids.ai/learn-more"},
{"name": "News", "url": "https://rapids.ai/news"},
{"name": "User Guides", "url": "https://rapids.ai/user-guides"},
{"name": "API Docs", "url": "https://rapids.ai/api-docs"},
{"name": "Install", "url": "https://rapids.ai/install"}
],
"header_links_before_dropdown": 2, # note: change based on number of top level directories
"show_toc_level": 2,
"navbar_align": "left",
"navbar_start": ["navbar-logo", "version-switcher"],
"navbar_center": ["navbar-nav"],
"navbar_end": ["theme-switcher.html","navbar-icon-links.html"],
"switcher": {
"version_match": version,
"json_url": f"https://raw.githubusercontent.com/rapidsai/sphinx-theme/main/_static/versions/{project}-doc-versions.json" #theme github source
}
}


def setup(app):
app.add_css_file("https://docs.rapids.ai/assets/css/custom.css")
app.add_js_file(
"https://docs.rapids.ai/assets/js/custom.js", loading_method="defer"
)
Loading