[doc] Use RTD theme. (#7346)

This commit is contained in:
Jiaming Yuan 2021-10-20 14:49:19 +08:00 committed by GitHub
parent 376b448015
commit 3b0b74fa94
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
7 changed files with 34 additions and 38 deletions

View File

@ -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;
}
div.literal-block-wrapper.container {
width: 100%;
.highlight {
background: #f1f3f4;
}
.red {
color: red;
.navbar {
background: #ffffff;
}
table {
border: 0;
.navbar-nav {
background: #ffffff;
}
td, th {
padding: 1px 8px 1px 5px;
border-top: 0;
border-bottom: 1px solid #aaa;
border-left: 0;
border-right: 0;
/* side bar */
.wy-nav-side {
background: #f1f3f4;
}
.wy-menu-vertical a {
color: #707070;
}
.wy-side-nav-search div.version {
color: #404040;
}

View File

@ -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.

View File

@ -19,7 +19,6 @@ import sys
import re
import os
import subprocess
import guzzle_sphinx_theme
git_branch = os.getenv('SPHINX_GIT_BRANCH', default=None)
if not git_branch:
@ -33,6 +32,7 @@ if not git_branch:
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(
@ -169,17 +169,13 @@ todo_include_todos = False
# 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']
@ -201,8 +197,7 @@ latex_elements = {
# (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 = {

View File

@ -1,6 +1,6 @@
sphinx>=2.1
mock
guzzle_sphinx_theme
sphinx_rtd_theme
breathe
sh>=1.12.14
matplotlib>=2.1

View File

@ -10,6 +10,6 @@ dependencies:
- matplotlib
- pip:
- breathe
- guzzle_sphinx_theme
- sphinx_rtd_theme
- pydot-ng
- graphviz

View File

@ -35,6 +35,6 @@ dependencies:
- pip:
- shap
- ipython # required by shap at import time.
- guzzle_sphinx_theme
- sphinx_rtd_theme
- datatable
- modin[all]

View File

@ -32,5 +32,5 @@ dependencies:
- boto3
- awscli
- pip:
- guzzle_sphinx_theme
- sphinx_rtd_theme
- datatable