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

[doc] Use RTD theme. #7346

Merged
merged 1 commit into from
Oct 20, 2021
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
36 changes: 22 additions & 14 deletions doc/_static/custom.css
Original file line number Diff line number Diff line change
@@ -1,23 +1,31 @@
div.breathe-sectiondef.container {
width: 100%;
@import url('theme.css');

/* Logo background */
.wy-side-nav-search, .wy-side-nav-search img {
background-color: #ffffff !important;
}

.highlight {
background: #f1f3f4;
}

.navbar {
background: #ffffff;
}

div.literal-block-wrapper.container {
width: 100%;
.navbar-nav {
background: #ffffff;
}

.red {
color: red;
/* side bar */
.wy-nav-side {
background: #f1f3f4;
}

table {
border: 0;
.wy-menu-vertical a {
color: #707070;
}

td, th {
padding: 1px 8px 1px 5px;
border-top: 0;
border-bottom: 1px solid #aaa;
border-left: 0;
border-right: 0;
.wy-side-nav-search div.version {
color: #404040;
}
9 changes: 1 addition & 8 deletions doc/build.rst
Original file line number Diff line number Diff line change
Expand Up @@ -522,14 +522,7 @@ XGBoost uses `Sphinx <https://www.sphinx-doc.org/en/stable/>`_ for documentation

* Python dependencies

- sphinx
- breathe
- guzzle_sphinx_theme
- recommonmark
- mock
- sh
- graphviz
- matplotlib
Checkout the ``requirements.txt`` file under ``doc/``

Under ``xgboost/doc`` directory, run ``make <format>`` with ``<format>`` replaced by the format you want. For a list of supported formats, run ``make help`` under the same directory.

Expand Down
19 changes: 7 additions & 12 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
import re
import os
import subprocess
import guzzle_sphinx_theme

git_branch = os.getenv('SPHINX_GIT_BRANCH', default=None)
if not git_branch:
Expand All @@ -33,6 +32,7 @@
else:
git_branch = [git_branch]
print('git_branch = {}'.format(git_branch[0]))

try:
filename, _ = urllib.request.urlretrieve(
'https://s3-us-west-2.amazonaws.com/xgboost-docs/{}.tar.bz2'.format(
Expand Down Expand Up @@ -169,17 +169,13 @@

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme_path = guzzle_sphinx_theme.html_theme_path()
html_theme = 'guzzle_sphinx_theme'
html_theme = "sphinx_rtd_theme"
html_theme_options = {"logo_only": True}

# Register the theme as an extension to generate a sitemap.xml
extensions.append("guzzle_sphinx_theme")

# Guzzle theme options (see theme.conf for more information)
html_theme_options = {
# Set the name of the project to appear in the sidebar
"project_nav_name": "XGBoost"
}
html_logo = "https://raw.githubusercontent.com/dmlc/dmlc.github.io/master/img/logo-m/xgboost.png"

html_css_files = ["css/custom.css"]

html_sidebars = {
'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
Expand All @@ -201,8 +197,7 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, '%s.tex' % project, project,
author, 'manual'),
(master_doc, '%s.tex' % project, project, author, 'manual'),
]

intersphinx_mapping = {
Expand Down
2 changes: 1 addition & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
sphinx>=2.1
mock
guzzle_sphinx_theme
sphinx_rtd_theme
breathe
sh>=1.12.14
matplotlib>=2.1
Expand Down
2 changes: 1 addition & 1 deletion doc/xgboost_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ dependencies:
- matplotlib
- pip:
- breathe
- guzzle_sphinx_theme
- sphinx_rtd_theme
- pydot-ng
- graphviz
2 changes: 1 addition & 1 deletion tests/ci_build/conda_env/cpu_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,6 @@ dependencies:
- pip:
- shap
- ipython # required by shap at import time.
- guzzle_sphinx_theme
- sphinx_rtd_theme
- datatable
- modin[all]
2 changes: 1 addition & 1 deletion tests/ci_build/conda_env/macos_cpu_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ dependencies:
- boto3
- awscli
- pip:
- guzzle_sphinx_theme
- sphinx_rtd_theme
- datatable