Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refresh docs/conf.py and rtd/noxfile conf #12

Merged
merged 4 commits into from
Sep 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 49 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
# Manually added parts to .gitignore
# ----------------------------------
#
# the node program scss is used to build .css and .css.map files, due to this we
# end up with node_modules etc.
node_modules
.nodeenv

# .css and .css.map files in this folder are built using scss
src/jupyterhub_sphinx_theme/theme/jupyterhub-sphinx-theme/static/styles/

.vscode


# Python .gitignore from https://github.com/github/gitignore/blob/HEAD/Python.gitignore
# -------------------------------------------------------------------------------------
#
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
Expand All @@ -20,7 +37,6 @@ parts/
sdist/
var/
wheels/
pip-wheel-metadata/
share/python-wheels/
*.egg-info/
.installed.cfg
Expand Down Expand Up @@ -50,6 +66,7 @@ coverage.xml
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
Expand All @@ -72,6 +89,7 @@ instance/
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
Expand All @@ -82,7 +100,9 @@ profile_default/
ipython_config.py

# pyenv
.python-version
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
# .python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
Expand All @@ -91,7 +111,22 @@ ipython_config.py
# install all needed dependencies.
#Pipfile.lock

# PEP 582; used by e.g. github.com/David-OConnor/pyflow
# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/#use-with-ide
.pdm.toml

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
Expand Down Expand Up @@ -128,9 +163,15 @@ dmypy.json
# Pyre type checker
.pyre/

# Sphinx Theme Builder
node_modules
.nodeenv
# pytype static type analyzer
.pytype/

# Dev
.vscode
# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
12 changes: 4 additions & 8 deletions .readthedocs.yml → .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# Configuration on how ReadTheDocs (RTD) builds our documentation
# ref: https://readthedocs.org/projects/2i2c-team-compass/
# ref: https://readthedocs.org/projects/jupyterhub-sphinx-theme/
# ref: https://docs.readthedocs.io/en/stable/config-file/v2.html
#
version: 2

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.9"
python: "3.11"

sphinx:
configuration: docs/conf.py

# Explicitly opt out of trying to build additional formats such as PDF and ePub
formats: []

python:
install:
- method: pip
path: .
extra_requirements:
- docs
Comment on lines -21 to -22
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We nad no such extra requirements

59 changes: 28 additions & 31 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,47 +1,44 @@
# Configuration file for Sphinx to build our documentation to HTML.
#
# Configuration reference: https://www.sphinx-doc.org/en/master/usage/configuration.html
#
from datetime import datetime


# -- Project information -----------------------------------------------------
# ref: https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
#
project = "JupyterHub Sphinx Theme"
copyright = "2022"
copyright = f"2022 - {datetime.now().year}, JupyterHub"
author = "JupyterHub"
main_doc = "index"
version = "0.0.1a"

# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
# -- General Sphinx configuration ---------------------------------------------------
# ref: https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
#
extensions = [
"myst_parser",
"jupyterhub_sphinx_theme",
]
root_doc = "index"
source_suffix = [".rst", ".md"]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
# -- Options for HTML output ----------------------------------------------
# ref: http://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
#
html_theme = "jupyterhub_sphinx_theme"
html_title = "JupyterHub Sphinx Theme"
html_copy_source = True
html_sourcelink_suffix = ""
Comment on lines -30 to -32
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't set these things in other sphinx conf.py files, so I figure we shouldn't here either.

  • html_title gets a value anyhow from the rendered pages
  • html_copy_source is defaulting to True anyhow
  • html_sourcelink_suffix could possibly be relevant to set explicitly to override the default of .txt, but I don't know when and why so I'm assuming this is just a copy/paste legacy config of no purpose for this projects function


# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# theme related configuration
html_theme = "jupyterhub_sphinx_theme"
html_theme_options = {
"icon_links": [ {
"name": "GitHub",
"url": "https://github.com/jupyterhub/jupyterhub-sphinx-theme",
"icon": "fa-brands fa-github",
},]
"icon_links": [
{
"name": "GitHub",
"url": "https://github.com/jupyterhub/jupyterhub-sphinx-theme",
"icon": "fa-brands fa-github",
},
]
}
html_context = {
"github_user": "jupyterhub",
Expand Down
2 changes: 0 additions & 2 deletions docs/requirements.txt

This file was deleted.

3 changes: 1 addition & 2 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
@nox.session
def docs(session):
"""Build the documentation locally. Use `-- live` to run a live server."""
session.install("-e", ".[dev]")
session.install("-r", "docs/requirements.txt")
session.install("-e", ".")

if "live" in session.posargs:
session.run("stb", "serve", "docs")
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# Sphinx theme configuration
#
# ref: https://www.sphinx-doc.org/en/master/development/theming.html
#
[theme]
inherit = pydata_sphinx_theme
stylesheet = styles/jupyterhub-sphinx-theme.css