Skip to content

Commit 21072dc

Browse files
authored
Merge pull request #267 from choldgraf/theme-update
Update configuration for PyData Sphinx Theme
2 parents 34144e4 + 59464b3 commit 21072dc

File tree

7 files changed

+73
-108
lines changed

7 files changed

+73
-108
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,28 @@ Binder is maintained by the [Binder team](https://github.com/jupyterhub/team-com
2323

2424

2525
The JupyterHub team also maintains analysis of binder data including [billing data](https://github.com/jupyterhub/binder-billing) and [activity data](https://github.com/jupyterhub/binder-data).
26+
27+
## Build the documentation
28+
29+
This documentation is built with [the Sphinx Documentation engine]().
30+
The easiest way to build the documentation is with [the tool `nox`](https://nox.thea.codes/en/stable/).
31+
`nox` is kind-of like a Makefile, it is a way to automatically install environments and run commands locally.
32+
To build this documentation with `nox`, run:
33+
34+
```bash
35+
pip install nox
36+
nox -s docs
37+
```
38+
39+
or to launch a live server that re-builds and re-loads pages as you save files:
40+
41+
```bash
42+
nox -s docs-live
43+
```
44+
45+
Alternatively, you may build the documentation directly with Sphinx:
46+
47+
```bash
48+
pip install -r doc/doc-requirements.txt
49+
sphinx-build -b html doc doc/_build
50+
```

doc/_static/custom.css

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,14 @@ div.sphinxsidebarwrapper ul {
4141
/* Badges on front page */
4242
div.badges img {
4343
float: left;
44-
padding-right: .5em;
44+
margin-right: .5em;
4545
}
4646

4747
/* Logo */
48-
img.logo{
49-
padding: 0.2em;
48+
img.logo__image {
49+
padding: 0.25rem;
50+
}
51+
52+
p.logo__title {
53+
font-size: 1.25em;
5054
}

doc/_static/images/logo-dark.png

8.91 KB
Loading

doc/_static/images/logo.png

-8.9 KB
Loading

doc/conf.py

Lines changed: 10 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,7 @@
11
#!/usr/bin/env python3
22
# -*- coding: utf-8 -*-
33

4-
import os
5-
import os.path as op
6-
from pathlib import Path
7-
import requests
8-
94
# -- General configuration ------------------------------------------------
10-
11-
# If your documentation needs a minimal Sphinx version, state it here.
12-
#
13-
# needs_sphinx = '1.0'
14-
15-
# Add any Sphinx extension module names here, as strings. They can be
16-
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
17-
# ones.
185
extensions = [
196
"sphinx_copybutton",
207
"myst_parser",
@@ -32,18 +19,12 @@
3219
source_suffix = [".rst", ".md"]
3320

3421
# The master toctree document.
35-
master_doc = "index"
22+
main_doc = "index"
3623

3724
# General information about the project.
3825
project = "Binder"
39-
copyright = "2017, The Binder Team"
26+
copyright = "2022, The Binder Team"
4027
author = "The Binder Team"
41-
42-
# The version info for the project you're documenting, acts as replacement for
43-
# |version| and |release|, also used in various other places throughout the
44-
# built documents.
45-
#
46-
# The short X.Y version.
4728
version = "0.1b"
4829
# The full version, including alpha/beta/rc tags.
4930
release = "0.1b"
@@ -52,35 +33,12 @@
5233
"r2d": ("https://repo2docker.readthedocs.io/en/latest/", None),
5334
"tc": ("https://jupyterhub-team-compass.readthedocs.io/en/latest/", None),
5435
}
55-
56-
# The language for content autogenerated by Sphinx. Refer to documentation
57-
# for a list of supported languages.
58-
#
59-
# This is also used if you do content translation via gettext catalogs.
60-
# Usually you set "language" from the command line for these cases.
61-
language = None
62-
63-
# List of patterns, relative to source directory, that match files and
64-
# directories to ignore when looking for source files.
65-
# This patterns also effect to html_static_path and html_extra_path
6636
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
67-
68-
# The name of the Pygments (syntax highlighting) style to use.
6937
pygments_style = "sphinx"
7038

71-
# If true, `todo` and `todoList` produce output, else they produce nothing.
72-
todo_include_todos = False
73-
74-
# Binder Logo
75-
html_logo = "_static/images/logo.png"
76-
html_favicon = "_static/images/favicon.png"
77-
7839
# -- Options for HTML output ----------------------------------------------
79-
80-
# The theme to use for HTML and HTML Help pages. See the documentation for
81-
# a list of builtin themes.
82-
#
8340
html_theme = "pydata_sphinx_theme"
41+
html_favicon = "_static/images/favicon.png"
8442

8543
# Theme options are theme-specific and customize the look and feel of a theme
8644
# further. For a list of options available for each theme, see the
@@ -98,8 +56,13 @@
9856
"icon": "_static/favicon.png",
9957
"type": "local",
10058
}
101-
],
102-
"navbar_end": ["navbar-icon-links", "support-button"],
59+
],
60+
"navbar_align": "left",
61+
"navbar_end": ["theme-switcher", "navbar-icon-links", "support-button"],
62+
"logo": {
63+
"image_light": "images/logo.png",
64+
"image_dark": "images/logo-dark.png",
65+
}
10366
}
10467

10568
html_context = {
@@ -113,10 +76,6 @@
11376
html_sidebars = {
11477
"index": [], # Remove sidebars on landing page to save space
11578
}
116-
117-
# Add any paths that contain custom static files (such as style sheets) here,
118-
# relative to this directory. They are copied after the builtin static files,
119-
# so a file named "default.css" will overwrite the builtin "default.css".
12079
html_static_path = ["_static"]
12180
html_css_files = ["custom.css"]
12281

@@ -141,60 +100,6 @@
141100
"deflist",
142101
]
143102

144-
# -- Options for HTMLHelp output ------------------------------------------
145-
146-
# Output file base name for HTML help builder.
147-
htmlhelp_basename = "Binderdoc"
148-
149-
# -- Options for LaTeX output ---------------------------------------------
150-
151-
latex_elements = {
152-
# The paper size ('letterpaper' or 'a4paper').
153-
#
154-
# 'papersize': 'letterpaper',
155-
# The font size ('10pt', '11pt' or '12pt').
156-
#
157-
# 'pointsize': '10pt',
158-
# Additional stuff for the LaTeX preamble.
159-
#
160-
# 'preamble': '',
161-
# Latex figure (float) alignment
162-
#
163-
# 'figure_align': 'htbp',
164-
}
165-
166-
# Grouping the document tree into LaTeX files. List of tuples
167-
# (source start file, target name, title,
168-
# author, documentclass [howto, manual, or own class]).
169-
latex_documents = [
170-
(master_doc, "Binder.tex", "Binder Documentation", "The Binder Team", "manual"),
171-
]
172-
173-
174-
# -- Options for manual page output ---------------------------------------
175-
176-
# One entry per manual page. List of tuples
177-
# (source start file, name, description, authors, manual section).
178-
man_pages = [(master_doc, "binder", "Binder Documentation", [author], 1)]
179-
180-
181-
# -- Options for Texinfo output -------------------------------------------
182-
183-
# Grouping the document tree into Texinfo files. List of tuples
184-
# (source start file, target name, title, author,
185-
# dir menu entry, description, category)
186-
texinfo_documents = [
187-
(
188-
master_doc,
189-
"Binder",
190-
"Binder Documentation",
191-
author,
192-
"Binder",
193-
"One line description of project.",
194-
"Miscellaneous",
195-
),
196-
]
197-
198103
# -- Scripts --------------------------------------------------------------
199104
from subprocess import run
200105
import shlex

doc/index.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
theme_html_remove_secondary_sidebar:
3+
---
14
(binder-docs)=
25
# Binder Documentation
36

noxfile.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
"""A nox configuration file so that we can build the documentation easily with nox.
2+
- see the README.md for information about nox.
3+
- ref: https://nox.thea.codes/en/stable/
4+
"""
5+
import nox
6+
from pathlib import Path
7+
8+
nox.options.reuse_existing_virtualenvs = True
9+
10+
11+
@nox.session
12+
def docs(session):
13+
session.install("-r", "doc/doc-requirements.txt")
14+
session.run("sphinx-build", "-b=html", "doc/", "doc/_build/html")
15+
16+
17+
@nox.session(name="docs-live")
18+
def docs_live(session):
19+
session.install("-r", "doc/doc-requirements.txt")
20+
session.install("sphinx-autobuild")
21+
session.run(
22+
"sphinx-autobuild",
23+
"--re-ignore",
24+
"doc/_data*",
25+
"-b=html",
26+
"doc/",
27+
"doc/_build/html",
28+
)

0 commit comments

Comments
 (0)