Skip to content

Commit

Permalink
Maintain edit this button style and version switcher (#143)
Browse files Browse the repository at this point in the history
* Add edit button

* Add requirement sort pre-commit

* Add styles for version switch hovering

* Update doc/source/conf.py

Co-authored-by: Roberto Pastor Muela <roberto.pastormuela@ansys.com>

Co-authored-by: Roberto Pastor Muela <roberto.pastormuela@ansys.com>
  • Loading branch information
Revathyvenugopal162 and RobPasMue authored Nov 7, 2022
1 parent e8e20aa commit 38dcd06
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ repos:
hooks:
- id: check-merge-conflict
- id: debug-statements
- id: requirements-txt-fixer

# this validates our github workflow files
- repo: https://github.com/python-jsonschema/check-jsonschema
Expand Down
8 changes: 8 additions & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,17 @@
html_logo = ansys_logo_black
html_theme = "ansys_sphinx_theme"

html_context = {
"github_user": "ansys",
"github_repo": "ansys-sphinx-theme",
"github_version": "main",
"doc_path": "doc/source",
}

# specify the location of your github repo
html_theme_options = {
"github_url": "https://github.com/ansys/ansys-sphinx-theme",
"use_edit_page_button": True,
"contact_mail": "pyansys.support@ansys.com",
"additional_breadcrumbs": [
("Ansys Internal Developer Portal", "https://dev.docs.ansys.com"),
Expand Down
2 changes: 1 addition & 1 deletion requirements/requirements_doc.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Sphinx==5.3.0
numpydoc==1.5.0
Sphinx==5.3.0
sphinx-copybutton==0.5.0
sphinx-notfound-page==0.8.3
5 changes: 2 additions & 3 deletions src/ansys_sphinx_theme/static/404.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
:orphan:

Oops!
=====

This is unexpected. The page you are requesting does not exist.

If this page should exist, please contact `{{ theme_contact_mail }} <mailto:{{ theme_contact_mail }}`_.
If this page should exist, please contact `{{ theme_contact_mail }} <{{ theme_contact_mail }}>`_.
10 changes: 10 additions & 0 deletions src/ansys_sphinx_theme/static/css/ansys_sphinx_theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -799,3 +799,13 @@ html[data-theme="dark"] .highlight pre {
#version_switcher_button {
background-color: var(--pst-color-background);
}

.editthispage a {
color: var(--pst-color-text-base);
}

#version_switcher_menu a.list-group-item.active {
background-color: var(--pst-color-background);
border-color: var(--pst-color-border);
color: var(--pst-color-text-base)
}

0 comments on commit 38dcd06

Please sign in to comment.