Skip to content

Commit 4ecc59e

Browse files
committed
Update apidoc for Sphinx 7. Relates to #4085
1 parent 8d457bb commit 4ecc59e

File tree

6 files changed

+64
-29
lines changed

6 files changed

+64
-29
lines changed

doc/apidoc/Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ help:
2929
# docstrings. The first path is the one to process, the following ones
3030
# are excluded from the search.
3131
rm -rf _build generated
32-
sphinx-apidoc -M -o generated ../../packages/python/plotly/plotly ../../packages/python/plotly/plotly/validators ../../packages/python/plotly/plotly/tests ../../packages/python/plotly/plotly/matplotlylib/ ../../packages/python/plotly/plotly/offline ../../packages/python/plotly/plotly/api
32+
sphinx-apidoc -M -o generated ../../packages/python/plotly/plotly ../../packages/python/plotly/plotly/validators ../../packages/python/plotly/plotly/tests ../../packages/python/plotly/plotly/matplotlylib/ ../../packages/python/plotly/plotly/offline ../../packages/python/plotly/plotly/api ../../packages/python/plotly/plotly/plotly
3333
# Run sphinx-build to build html pages from the rst pages
3434
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
3535
git checkout -- ../../packages/python/plotly/plotly/graph_objs
@@ -42,4 +42,4 @@ help:
4242
sed -i 's/graph_objs/graph_objects/g' _build/html/*.inv
4343
sed -i 's/graph_objs/graph_objects/g' _build/html/*.js
4444
sed -i 's/graph_objs/graph_objects/g' _build/html/generated/*.html
45-
sed -i 's/graph_objs/graph_objects/g' _build/html/generated/generated/*.html
45+
# sed -i 's/graph_objs/graph_objects/g' _build/html/generated/generated/*.html
+1
Loading

doc/apidoc/_static/plotly-style.css

+32-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
padding-top: 8px;
2828
}
2929

30-
code {
30+
.rst-content code.literal {
3131
color: #2c3e50 !important;
3232
}
3333

@@ -97,10 +97,41 @@ h6 {
9797
font-weight: 500;
9898
}
9999

100+
.wy-nav-side {
101+
background-color: #0e1012;
102+
}
103+
104+
.wy-side-nav-search {
105+
background-color: #0e1012 !important;
106+
}
107+
108+
/*
109+
100110
a {
101111
color: #506784 !important;
102112
}
103113
104114
a:hover {
105115
color: #0d67bf !important;
106116
}
117+
118+
*/
119+
120+
a.icon img.logo {
121+
margin-top: 0 !important ;
122+
}
123+
124+
.wy-side-nav-search .wy-dropdown > a img.logo, .wy-side-nav-search > a img.logo {
125+
width: 275px;
126+
}
127+
128+
.wy-table-responsive table td {
129+
white-space: normal;
130+
}
131+
132+
/* https://github.com/readthedocs/sphinx_rtd_theme/issues/468 */
133+
/* adds scrollbar to sidenav */
134+
.wy-side-scroll {
135+
width: auto;
136+
overflow-y: auto;
137+
}

doc/apidoc/_templates/class_figure.rst

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
:mod:`{{module}}`.{{objname}}
2-
{{ underline }}==============
2+
{{ underline }}=========================================================
33

44

55
.. currentmodule:: {{ module }}
66

77
.. autosummary::
8-
:toctree: generated/
9-
108
Figure
119

1210
Figure.show

doc/apidoc/conf.py

+21-23
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,11 @@
1212
#
1313
import os
1414
import sys
15-
import sphinx_bootstrap_theme
16-
17-
# sys.path.insert(0, os.path.abspath("../packages/python/plotly"))
18-
1915

2016
# -- Project information -----------------------------------------------------
2117

2218
project = ""
23-
copyright = "2022, Plotly"
19+
copyright = "2024, Plotly"
2420
author = "Plotly"
2521

2622
# The short X.Y version
@@ -63,13 +59,6 @@
6359
# The master toctree document.
6460
master_doc = "index"
6561

66-
# The language for content autogenerated by Sphinx. Refer to documentation
67-
# for a list of supported languages.
68-
#
69-
# This is also used if you do content translation via gettext catalogs.
70-
# Usually you set "language" from the command line for these cases.
71-
language = None
72-
7362
# List of patterns, relative to source directory, that match files and
7463
# directories to ignore when looking for source files.
7564
# This pattern also affects html_static_path and html_extra_path.
@@ -85,18 +74,21 @@
8574
# The theme to use for HTML and HTML Help pages. See the documentation for
8675
# a list of builtin themes.
8776
#
88-
html_theme = "bootstrap"
89-
html_theme_path = sphinx_bootstrap_theme.get_html_theme_path()
9077

91-
html_logo = "_static/logo.png"
78+
html_theme = "sphinx_rtd_theme"
79+
html_logo = "_static/graphing_library.svg"
80+
html_show_sourcelink = False
81+
82+
# -- If dark mode option wanted. Needs pip install sphinx-rtd-dark-mode
83+
# extensions.append("sphinx_rtd_dark_mode")
84+
# default_dark_mode = False
85+
9286
# Theme options are theme-specific and customize the look and feel of a theme
9387
# further. For a list of options available for each theme, see the
9488
# documentation.
9589
#
9690
html_theme_options = {
97-
"analytics_id": "UA-39373211-1", # not supported by this theme
98-
"bootswatch_theme": "flatly",
99-
"source_link_position": "no",
91+
"analytics_id": "UA-39373211-1", # supported by rtd theme. Not by bootstrap?
10092
}
10193

10294
# Add any paths that contain custom static files (such as style sheets) here,
@@ -111,9 +103,14 @@
111103
# defined by theme itself. Builtin themes are using these templates by
112104
# default: ``['localtoc.html', 'relations.html', 'sourcelink.html',
113105
# 'searchbox.html']``.
114-
#
115106
# html_sidebars = {}
116107

108+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-html_sidebars
109+
# This doesn't seem to get us anywhere
110+
# html_sidebars = {
111+
# '**': ['globaltoc.html', 'sourcelink.html', 'searchbox.html'],
112+
# }
113+
117114
html_favicon = "_static/favicon.ico"
118115

119116
# -- Options for HTMLHelp output ---------------------------------------------
@@ -171,7 +168,6 @@
171168
)
172169
]
173170

174-
175171
# -- Options for Epub output -------------------------------------------------
176172

177173
# Bibliographic Dublin Core info.
@@ -202,6 +198,8 @@
202198
# If true, `todo` and `todoList` produce output, else they produce nothing.
203199
todo_include_todos = True
204200

205-
206-
def setup(app):
207-
app.add_stylesheet("plotly-style.css") # also can be a full URL
201+
# Adding the bootstrap theme makes little difference - rules in the RTD theme are usually more specific
202+
html_css_files = [
203+
# "https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css",
204+
"plotly-style.css"
205+
]

doc/apidoc/requirements.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Any version of pandas, it just allows plotly express to be imported
2+
pandas
3+
black
4+
sphinx==7.3.7
5+
sphinx-rtd-theme==2.0.0
6+
tenacity
7+
# Do not include plotly here, get it from code

0 commit comments

Comments
 (0)