[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 { @import url('theme.css');
width: 100%;
/* Logo background */
.wy-side-nav-search, .wy-side-nav-search img {
background-color: #ffffff !important;
} }
div.literal-block-wrapper.container { .highlight {
width: 100%; background: #f1f3f4;
} }
.red { .navbar {
color: red; background: #ffffff;
} }
table { .navbar-nav {
border: 0; background: #ffffff;
} }
td, th { /* side bar */
padding: 1px 8px 1px 5px; .wy-nav-side {
border-top: 0; background: #f1f3f4;
border-bottom: 1px solid #aaa; }
border-left: 0;
border-right: 0; .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 * Python dependencies
- sphinx Checkout the ``requirements.txt`` file under ``doc/``
- breathe
- guzzle_sphinx_theme
- recommonmark
- mock
- sh
- graphviz
- matplotlib
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. 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 re
import os import os
import subprocess import subprocess
import guzzle_sphinx_theme
git_branch = os.getenv('SPHINX_GIT_BRANCH', default=None) git_branch = os.getenv('SPHINX_GIT_BRANCH', default=None)
if not git_branch: if not git_branch:
@ -33,6 +32,7 @@ if not git_branch:
else: else:
git_branch = [git_branch] git_branch = [git_branch]
print('git_branch = {}'.format(git_branch[0])) print('git_branch = {}'.format(git_branch[0]))
try: try:
filename, _ = urllib.request.urlretrieve( filename, _ = urllib.request.urlretrieve(
'https://s3-us-west-2.amazonaws.com/xgboost-docs/{}.tar.bz2'.format( '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 # The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. # a list of builtin themes.
html_theme_path = guzzle_sphinx_theme.html_theme_path() html_theme = "sphinx_rtd_theme"
html_theme = 'guzzle_sphinx_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_logo = "https://raw.githubusercontent.com/dmlc/dmlc.github.io/master/img/logo-m/xgboost.png"
html_theme_options = {
# Set the name of the project to appear in the sidebar html_css_files = ["css/custom.css"]
"project_nav_name": "XGBoost"
}
html_sidebars = { html_sidebars = {
'**': ['logo-text.html', 'globaltoc.html', 'searchbox.html'] '**': ['logo-text.html', 'globaltoc.html', 'searchbox.html']
@ -201,8 +197,7 @@ latex_elements = {
# (source start file, target name, title, # (source start file, target name, title,
# author, documentclass [howto, manual, or own class]). # author, documentclass [howto, manual, or own class]).
latex_documents = [ latex_documents = [
(master_doc, '%s.tex' % project, project, (master_doc, '%s.tex' % project, project, author, 'manual'),
author, 'manual'),
] ]
intersphinx_mapping = { intersphinx_mapping = {

View File

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

View File

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

View File

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

View File

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