Skip to content

Commit 1e9ced5

Browse files
authored
docs: Improve documentation layout (#2587)
1 parent d334b0d commit 1e9ced5

File tree

7 files changed

+54
-25
lines changed

7 files changed

+54
-25
lines changed

docs/build.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ rm -rf comet-0.10
3131
python3 generate-versions.py
3232

3333
# Remove overview pages (this used to be part of the user guide but is now a top level page)
34-
rm temp/user-guide/0.9/overview.md
35-
rm temp/user-guide/0.8/overview.md
34+
rm temp/user-guide/0.9/overview.md 2> /dev/null
35+
rm temp/user-guide/0.8/overview.md 2> /dev/null
3636

3737
make SOURCEDIR=`pwd`/temp html

docs/requirements.txt

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,10 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
sphinx
18+
setuptools
19+
sphinx>=7.0,<8.0
1920
sphinx-reredirects
20-
pydata-sphinx-theme==0.8.0
21-
myst-parser
21+
pydata-sphinx-theme>=0.15.0,<0.16.0
22+
myst-parser>=2.0,<4.0
2223
maturin
2324
jinja2

docs/source/_static/theme_overrides.css

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,36 @@
2929
--pst-color-h2: var(--color-text-base);
3030
/* Use softer blue from bootstrap's default info color */
3131
--pst-color-info: 23, 162, 184;
32-
--pst-header-height: 0px;
32+
--pst-content-max-width: 100%; /* center column */
33+
--pst-font-size-base: 0.9rem;
3334
}
3435

36+
/* --- remove the right (secondary) sidebar entirely --- */
37+
.bd-sidebar-secondary { display: none !important; }
38+
39+
/* Some versions still reserve the grid column for it — collapse it */
40+
.bd-main {
41+
/* left sidebar + content only */
42+
grid-template-columns: 20rem minmax(0, 1fr) !important;
43+
}
44+
45+
/* --- make the left (primary) sidebar small --- */
46+
.bd-sidebar-primary {
47+
width: 20rem !important;
48+
flex: 0 0 20rem !important;
49+
}
50+
51+
/* Optional: make its text a bit tighter */
52+
.bd-sidebar-primary .bd-sidebar {
53+
font-size: 0.9rem;
54+
}
55+
56+
/* --- let the center content use all remaining width --- */
57+
.bd-content, .bd-article-container {
58+
max-width: none !important; /* remove internal cap */
59+
}
60+
61+
3562
code {
3663
color: rgb(215, 70, 51);
3764
}

docs/source/_templates/docs-sidebar.html

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,9 @@
1717
under the License.
1818
-->
1919

20-
<form class="bd-search d-flex align-items-center" action="{{ pathto('search') }}" method="get">
21-
<i class="icon fas fa-search"></i>
22-
<input type="search" class="form-control" name="q" id="search-input" placeholder="{{ theme_search_bar_text }}" aria-label="{{ theme_search_bar_text }}" autocomplete="off" >
23-
</form>
24-
2520
<nav class="bd-links" id="bd-docs-nav" aria-label="Main navigation">
2621
<div class="bd-toc-item active">
27-
{% if "python/api" in pagename or "python/generated" in pagename %}
28-
{{ generate_nav_html("sidebar", startdepth=0, maxdepth=3, collapse=False, includehidden=True, titles_only=True) }}
29-
{% else %}
30-
{{ generate_nav_html("sidebar", startdepth=0, maxdepth=4, collapse=False, includehidden=True, titles_only=True) }}
31-
{% endif %}
22+
{{ toctree(maxdepth=4, collapse=True, includehidden=True, titles_only=True) }}
3223
</div>
3324

3425
<a class="navbar-brand" href="{{ pathto(master_doc) }}">

docs/source/_templates/layout.html

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@
1919

2020
{% extends "pydata_sphinx_theme/layout.html" %}
2121

22-
{# Silence the navbar #}
23-
{% block docs_navbar %}
24-
{% endblock %}
25-
2622
<!--
2723
Custom footer
2824
-->

docs/source/conf.py

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,24 @@
8686
html_theme = 'pydata_sphinx_theme'
8787

8888
html_theme_options = {
89-
"use_edit_page_button": True,
89+
"use_edit_page_button": False,
90+
"secondary_sidebar_items": [],
91+
"collapse_navigation": True,
92+
"navbar_start": [],
93+
"navbar_center": ["navbar-nav"],
94+
"navbar_end": ["navbar-icon-links", "theme-switcher"],
95+
"icon_links": [
96+
{
97+
"name": "GitHub",
98+
"url": "https://github.com/apache/datafusion-comet",
99+
"icon": "fa-brands fa-github",
100+
},
101+
],
102+
90103
}
91104

92105
html_context = {
106+
"default_mode": "light",
93107
"github_user": "apache",
94108
"github_repo": "datafusion-comet",
95109
"github_version": "main",

docs/source/index.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,10 @@ as a native runtime to achieve improvement in terms of query efficiency and quer
4949
:caption: User Guides:
5050
:hidden:
5151

52-
Comet 0.12.0-SNAPSHOT <user-guide/latest/index>
53-
Comet 0.10.x <user-guide/0.10/index>
54-
Comet 0.9.x <user-guide/0.9/index>
55-
Comet 0.8.x <user-guide/0.8/index>
52+
0.12.0-SNAPSHOT <user-guide/latest/index>
53+
0.10.x <user-guide/0.10/index>
54+
0.9.x <user-guide/0.9/index>
55+
0.8.x <user-guide/0.8/index>
5656

5757
.. _toc.contributor-guide-links:
5858
.. toctree::

0 commit comments

Comments
 (0)