diff --git a/MANIFEST.in b/MANIFEST.in index ec5843d1..5451d3b9 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,5 +1,3 @@ -include qiskit_sphinx_theme/theme.conf -include qiskit_sphinx_theme/*.html -include qiskit_sphinx_theme/static/css/*.css -include qiskit_sphinx_theme/static/js/*.js -include qiskit_sphinx_theme/static/images/*.* +recursive-include qiskit_sphinx_theme *.html +recursive-include qiskit_sphinx_theme theme.conf +graft qiskit_sphinx_theme/pytorch_base/static diff --git a/qiskit_sphinx_theme/__init__.py b/qiskit_sphinx_theme/__init__.py index f7cb1523..2bcf8fce 100644 --- a/qiskit_sphinx_theme/__init__.py +++ b/qiskit_sphinx_theme/__init__.py @@ -1,13 +1,17 @@ -"""Pytorch Sphinx theme. +"""Pytorch Sphinx theme.""" -""" -from os import path +from pathlib import Path from warnings import warn __version__ = '1.11.0rc1' __version_full__ = __version__ +def _get_theme_absolute_path(folder_name: str) -> str: + path = Path(__file__).parent / folder_name + return str(path.resolve()) + + def get_html_theme_path(): """Return the absolute path to this package. @@ -23,13 +27,10 @@ def get_html_theme_path(): stacklevel=2, category=DeprecationWarning, ) - cur_dir = path.abspath(path.dirname(path.dirname(__file__))) - return cur_dir + return _get_theme_absolute_path("pytorch_base") # See https://www.sphinx-doc.org/en/master/development/theming.html def setup(app): - app.add_html_theme('qiskit_sphinx_theme', path.abspath(path.dirname(__file__))) - - # return explicit parallel safe + app.add_html_theme("qiskit_sphinx_theme", _get_theme_absolute_path("pytorch_base")) return {'parallel_read_safe': True, 'parallel_write_safe': True} diff --git a/qiskit_sphinx_theme/breadcrumbs.html b/qiskit_sphinx_theme/pytorch_base/breadcrumbs.html similarity index 100% rename from qiskit_sphinx_theme/breadcrumbs.html rename to qiskit_sphinx_theme/pytorch_base/breadcrumbs.html diff --git a/qiskit_sphinx_theme/footer.html b/qiskit_sphinx_theme/pytorch_base/footer.html similarity index 100% rename from qiskit_sphinx_theme/footer.html rename to qiskit_sphinx_theme/pytorch_base/footer.html diff --git a/qiskit_sphinx_theme/languages.html b/qiskit_sphinx_theme/pytorch_base/languages.html similarity index 100% rename from qiskit_sphinx_theme/languages.html rename to qiskit_sphinx_theme/pytorch_base/languages.html diff --git a/qiskit_sphinx_theme/layout.html b/qiskit_sphinx_theme/pytorch_base/layout.html similarity index 100% rename from qiskit_sphinx_theme/layout.html rename to qiskit_sphinx_theme/pytorch_base/layout.html diff --git a/qiskit_sphinx_theme/layout_old.html b/qiskit_sphinx_theme/pytorch_base/layout_old.html similarity index 100% rename from qiskit_sphinx_theme/layout_old.html rename to qiskit_sphinx_theme/pytorch_base/layout_old.html diff --git a/qiskit_sphinx_theme/search.html b/qiskit_sphinx_theme/pytorch_base/search.html similarity index 100% rename from qiskit_sphinx_theme/search.html rename to qiskit_sphinx_theme/pytorch_base/search.html diff --git a/qiskit_sphinx_theme/searchbox.html b/qiskit_sphinx_theme/pytorch_base/searchbox.html similarity index 100% rename from qiskit_sphinx_theme/searchbox.html rename to qiskit_sphinx_theme/pytorch_base/searchbox.html diff --git a/qiskit_sphinx_theme/sidebar.html b/qiskit_sphinx_theme/pytorch_base/sidebar.html similarity index 100% rename from qiskit_sphinx_theme/sidebar.html rename to qiskit_sphinx_theme/pytorch_base/sidebar.html diff --git a/qiskit_sphinx_theme/static/css/theme.css b/qiskit_sphinx_theme/pytorch_base/static/css/theme.css similarity index 100% rename from qiskit_sphinx_theme/static/css/theme.css rename to qiskit_sphinx_theme/pytorch_base/static/css/theme.css diff --git a/qiskit_sphinx_theme/static/images/chevron-down-grey.svg b/qiskit_sphinx_theme/pytorch_base/static/images/chevron-down-grey.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/chevron-down-grey.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/chevron-down-grey.svg diff --git a/qiskit_sphinx_theme/static/images/chevron-right-white.svg b/qiskit_sphinx_theme/pytorch_base/static/images/chevron-right-white.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/chevron-right-white.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/chevron-right-white.svg diff --git a/qiskit_sphinx_theme/static/images/icon-close.svg b/qiskit_sphinx_theme/pytorch_base/static/images/icon-close.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/icon-close.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/icon-close.svg diff --git a/qiskit_sphinx_theme/static/images/icon-menu-dots-dark.svg b/qiskit_sphinx_theme/pytorch_base/static/images/icon-menu-dots-dark.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/icon-menu-dots-dark.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/icon-menu-dots-dark.svg diff --git a/qiskit_sphinx_theme/static/images/launch.svg b/qiskit_sphinx_theme/pytorch_base/static/images/launch.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/launch.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/launch.svg diff --git a/qiskit_sphinx_theme/static/images/logo-facebook-dark.svg b/qiskit_sphinx_theme/pytorch_base/static/images/logo-facebook-dark.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/logo-facebook-dark.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/logo-facebook-dark.svg diff --git a/qiskit_sphinx_theme/static/images/logo-icon.svg b/qiskit_sphinx_theme/pytorch_base/static/images/logo-icon.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/logo-icon.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/logo-icon.svg diff --git a/qiskit_sphinx_theme/static/images/logo-twitter-dark.svg b/qiskit_sphinx_theme/pytorch_base/static/images/logo-twitter-dark.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/logo-twitter-dark.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/logo-twitter-dark.svg diff --git a/qiskit_sphinx_theme/static/images/logo-youtube-dark.svg b/qiskit_sphinx_theme/pytorch_base/static/images/logo-youtube-dark.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/logo-youtube-dark.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/logo-youtube-dark.svg diff --git a/qiskit_sphinx_theme/static/images/logo.svg b/qiskit_sphinx_theme/pytorch_base/static/images/logo.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/logo.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/logo.svg diff --git a/qiskit_sphinx_theme/static/images/logo_wordmark.svg b/qiskit_sphinx_theme/pytorch_base/static/images/logo_wordmark.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/logo_wordmark.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/logo_wordmark.svg diff --git a/qiskit_sphinx_theme/static/images/qiskit-chevron-down.svg b/qiskit_sphinx_theme/pytorch_base/static/images/qiskit-chevron-down.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/qiskit-chevron-down.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/qiskit-chevron-down.svg diff --git a/qiskit_sphinx_theme/static/images/qiskit-chevron-up.svg b/qiskit_sphinx_theme/pytorch_base/static/images/qiskit-chevron-up.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/qiskit-chevron-up.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/qiskit-chevron-up.svg diff --git a/qiskit_sphinx_theme/static/images/search-icon.svg b/qiskit_sphinx_theme/pytorch_base/static/images/search-icon.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/search-icon.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/search-icon.svg diff --git a/qiskit_sphinx_theme/static/images/view-page-source-icon.svg b/qiskit_sphinx_theme/pytorch_base/static/images/view-page-source-icon.svg similarity index 100% rename from qiskit_sphinx_theme/static/images/view-page-source-icon.svg rename to qiskit_sphinx_theme/pytorch_base/static/images/view-page-source-icon.svg diff --git a/qiskit_sphinx_theme/static/js/modernizr.min.js b/qiskit_sphinx_theme/pytorch_base/static/js/modernizr.min.js similarity index 100% rename from qiskit_sphinx_theme/static/js/modernizr.min.js rename to qiskit_sphinx_theme/pytorch_base/static/js/modernizr.min.js diff --git a/qiskit_sphinx_theme/static/js/theme.js b/qiskit_sphinx_theme/pytorch_base/static/js/theme.js similarity index 100% rename from qiskit_sphinx_theme/static/js/theme.js rename to qiskit_sphinx_theme/pytorch_base/static/js/theme.js diff --git a/qiskit_sphinx_theme/theme.conf b/qiskit_sphinx_theme/pytorch_base/theme.conf similarity index 100% rename from qiskit_sphinx_theme/theme.conf rename to qiskit_sphinx_theme/pytorch_base/theme.conf diff --git a/setup.py b/setup.py index 350ae95c..42676337 100644 --- a/setup.py +++ b/setup.py @@ -1,4 +1,4 @@ -from setuptools import setup +from setuptools import find_namespace_packages, setup setup( name='qiskit_sphinx_theme', @@ -7,12 +7,7 @@ author_email="hello@qiskit.org", url="https://github.com/Qiskit/qiskit_sphinx_theme", description="A Sphinx theme for Qiskit that is based on the Pytorch Sphinx theme.", - packages=[ - "qiskit_sphinx_theme", - "qiskit_sphinx_theme.static.css", - "qiskit_sphinx_theme.static.images", - "qiskit_sphinx_theme.static.js", - ], + packages=find_namespace_packages(include=["qiskit_sphinx_theme*"]), include_package_data=True, entry_points={ 'sphinx.html_themes': [