Skip to content

sphinx material #512

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

Merged
merged 1 commit into from
Feb 15, 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
2 changes: 1 addition & 1 deletion .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
run: timeout 10s poetry run pip --version || rm -rf .venv

- name: Install dependencies
run: poetry install
run: poetry install -E docs

- name: Build documentation
run: |
Expand Down
4 changes: 3 additions & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@ sphinx:
formats: all

python:
version: 3.7
version: 3.8
install:
- method: pip
path: .
extra_requirements:
- docs
49 changes: 48 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"sphinx.ext.intersphinx",
"sphinx.ext.coverage",
"sphinx.ext.viewcode",
"sphinx_immaterial",
]

# Add any paths that contain templates here, relative to this directory.
Expand All @@ -53,9 +54,55 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = "sphinx_rtd_theme"
html_theme = "sphinx_immaterial"

# 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 = []

# Set link name generated in the top bar.
html_title = "openapi-core"

# Material theme options (see theme.conf for more information)
html_theme_options = {
# Set you GA account ID to enable tracking
# 'google_analytics_account': 'UA-XXXXX',
# Specify a base_url used to generate sitemap.xml. If not
# specified, then no sitemap will be built.
#'base_url': 'https://project.github.io/project',
# Set the color and the accent color
# Set the repo location to get a badge with stats
"repo_url": "https://github.com/p1c2u/openapi-core/",
"repo_name": "openapi-core",
"repo_type": "github",
"icon": {
"repo": "fontawesome/brands/github-alt",
"edit": "material/file-edit-outline",
},
"palette": [
{
"media": "(prefers-color-scheme: dark)",
"scheme": "slate",
"primary": "lime",
"accent": "amber",
"scheme": "slate",
"toggle": {
"icon": "material/toggle-switch",
"name": "Switch to light mode",
},
},
{
"media": "(prefers-color-scheme: light)",
"scheme": "default",
"primary": "lime",
"accent": "amber",
"toggle": {
"icon": "material/toggle-switch-off-outline",
"name": "Switch to dark mode",
},
},
],
# If False, expand all TOC entries
"globaltoc_collapse": False,
}
140 changes: 99 additions & 41 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 7 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,11 @@ werkzeug = "*"
typing-extensions = "^4.3.0"
jsonschema-spec = "^0.1.1"
backports-cached-property = {version = "^1.0.2", python = "<3.8" }
sphinx = {version = "^5.3.0", optional = true}
sphinx-immaterial = {version = "^0.11.0", optional = true}

[tool.poetry.extras]
docs = ["sphinx", "sphinx-immaterial"]
django = ["django"]
falcon = ["falcon"]
flask = ["flask"]
Expand All @@ -86,14 +89,16 @@ pytest = "^7"
pytest-flake8 = "*"
pytest-cov = "*"
responses = "*"
sphinx = "^5.3.0"
sphinx-rtd-theme = "^1.2.0"
strict-rfc3339 = "^0.7"
webob = "*"
mypy = "^1.0"
starlette = "^0.25.0"
httpx = "^0.23.3"

[tool.poetry.group.docs.dependencies]
sphinx = "^5.3.0"
sphinx-immaterial = "^0.11.0"

[tool.pytest.ini_options]
addopts = """
--capture=no
Expand Down