Skip to content

Commit

Permalink
Revert "Move theme settings to a custom sphinx theme (#41)"
Browse files Browse the repository at this point in the history
This reverts commit 955105a.
  • Loading branch information
saadrahim authored Mar 30, 2023
1 parent 955105a commit 8a19ff1
Show file tree
Hide file tree
Showing 70 changed files with 46 additions and 56 deletions.
3 changes: 3 additions & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/_build
/_doxygen
/_images
/_static
/_templates
3 changes: 0 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,3 @@ requires-python = ">=3.8"
api_reference = [
"doxysphinx>=3.2.1,<4"
]

[project.entry-points."sphinx.html_themes"]
rocm_docs_theme = "rocm_docs.theme"
43 changes: 40 additions & 3 deletions src/rocm_docs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,15 @@ class ROCmDocs:
"external_toc_exclude_missing",
"intersphinx_mapping",
"intersphinx_disabled_domains",
"templates_path",
"epub_show_urls",
"exclude_patterns",
"html_theme",
"html_title",
"html_static_path",
"html_css_files",
"html_js_files",
"html_extra_path",
"html_theme_options",
"html_show_sphinx",
"html_favicon",
Expand Down Expand Up @@ -75,7 +80,11 @@ def __init__(
self.exclude_patterns: List[str]
self.html_theme: str
self.html_title: str
self.html_theme_options: Dict[str, Union[str, bool, List[str]]] = {}
self.html_static_path: List[str]
self.html_css_files: List[str]
self.html_js_files: List[str]
self.html_extra_path: List[str]
self.html_theme_options: Dict[str, Union[str, bool, List[str]]]
self.html_show_sphinx: bool
self.html_favicon: str
self.numfig: bool
Expand Down Expand Up @@ -260,6 +269,7 @@ def setup(self) -> None:
" readable."
)
format_toc(self._docs_folder)
url, branch, edit_page = get_branch(self._docs_folder)

self.external_toc_path = "./.sphinx/_toc.yml"
self.external_toc_exclude_missing = False
Expand All @@ -272,6 +282,9 @@ def setup(self) -> None:
}
self.intersphinx_disabled_domains = ["std"]

# Other configuration
self.templates_path = ["_templates"]

# -- Options foself.r EPUB output
self.epub_show_urls = "footnote"

Expand All @@ -285,8 +298,32 @@ def setup(self) -> None:
# The theme to use for HTML and HTML Help pages. See the documentation
# for a list of builtin themes.
#
self.html_theme = "rocm_docs_theme"
self.html_theme = "sphinx_book_theme"
self.html_title = self._project_name
self.html_static_path = ["_static"]
self.html_css_files = [
"custom.css",
"rocm_header.css",
"rocm_footer.css",
"fonts.css",
]
self.html_js_files = ["code_word_breaks.js"]
self.html_extra_path = ["_images"]
self.html_theme_options = {
"home_page_in_toc": False,
"use_edit_page_button": edit_page,
"repository_url": url,
"repository_branch": branch,
"path_to_docs": get_path_to_docs(),
"show_navbar_depth": "0",
"body_max_width": "none",
"show_toc_level": "0",
"article_header_start": [
"toggle-primary-sidebar.html",
"breadcrumbs.html",
],
"navbar_center": ["components/left-side-menu.html"],
}

self.html_show_sphinx = False
self.html_favicon = "https://www.amd.com/themes/custom/amd/favicon.ico"
Expand All @@ -296,7 +333,7 @@ def setup(self) -> None:
self.copy_files()

def disable_main_doc_link(self):
self.html_theme_options["link_main_doc"] = False
self.html_theme_options.pop("navbar_center")

def copy_files(self):
"""Insert additional files into workspace."""
Expand Down
File renamed without changes
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{% extends "sphinx_book_theme/layout.html" %}
{% extends "!layout.html" %}

{%- block footer %}
{%- include "sections/footer.html" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
</div>

<div id="rdc-watermark-container">
<img id="rdc-watermark" src="{{ pathto('_static/images/rdc-watermark.svg',1) }}" alt="DRAFT watermark"/>
<img id="rdc-watermark" src="{{ pathto('rdc-watermark.svg',1) }}" alt="DRAFT watermark"/>
</div>
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<div class="rocm-header">
<div class="rocm-header-buttons">
<a href="https://www.amd.com" class="rocm-header-link">
<img id="amd-logo" alt="Advanced Micro Devices, Inc." src="{{ pathto('_static/images/rocm-logo.png',1) }}"></img>
<img id="amd-logo" alt="Advanced Micro Devices, Inc." src="{{ pathto('rocm-logo.png',1) }}"></img>
<div class="glow-wrap">
<i class="glow"></i>
</div>
Expand Down
5 changes: 0 additions & 5 deletions src/rocm_docs/rocm_docs_theme/theme.conf

This file was deleted.

42 changes: 0 additions & 42 deletions src/rocm_docs/theme.py

This file was deleted.

0 comments on commit 8a19ff1

Please sign in to comment.