diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 000000000..8e41df2cf --- /dev/null +++ b/.gitmodules @@ -0,0 +1,4 @@ +[submodule "hugr-py/docs/quantinuum-sphinx"] + path = hugr-py/docs/quantinuum-sphinx + url = https://github.com/CQCL/quantinuum-sphinx.git + branch = dist diff --git a/hugr-py/docs/_static/custom.css b/hugr-py/docs/_static/custom.css deleted file mode 100644 index ce78012b3..000000000 --- a/hugr-py/docs/_static/custom.css +++ /dev/null @@ -1,38 +0,0 @@ -.wy-side-nav-search, -.wy-nav-top { - background: #5A46BE; -} - -.wy-grid-for-nav, -.wy-body-for-nav, -.wy-nav-side, -.wy-side-scroll, -.wy-menu, -.wy-menu-vertical { - background-color: #FFFFFF; -} - -.wy-menu-vertical a:hover { - background-color: #d9d9d9; -} - -.btn-link:visited, -.btn-link, -a:visited, -.a.reference.external, -.a.reference.internal, -.wy-menu-vertical a, -.wy-menu-vertical li, -.wy-menu-vertical ul, -.span.pre, -.sig-param, -.std.std-ref, - - -html[data-theme=light] { - --pst-color-inline-code: rgb(199, 37, 78) !important; -} - -.sig-name { - font-size: 1.25rem; -} diff --git a/hugr-py/docs/_static/nav-config.js b/hugr-py/docs/_static/nav-config.js new file mode 100644 index 000000000..30226f01a --- /dev/null +++ b/hugr-py/docs/_static/nav-config.js @@ -0,0 +1,13 @@ +const navConfig = { + "navTextLinks": [ + + ], + "navProductName": 'Hugr', + "navIconLinks": [ + { + "title": 'Github', + "href": "https://github.com/CQCL/hugr/", + "iconImageURL": "/_static/assets/github.svg", + }, + ], +} diff --git a/hugr-py/docs/api-docs/conf.py b/hugr-py/docs/api-docs/conf.py index ceace6b8d..74be1ac44 100644 --- a/hugr-py/docs/api-docs/conf.py +++ b/hugr-py/docs/api-docs/conf.py @@ -16,36 +16,17 @@ "sphinx_multiversion", ] -html_theme = "sphinx_book_theme" - +html_theme = "furo" html_title = "HUGR python package API documentation." +html_theme_options = {} -html_theme_options = { - "repository_url": "https://github.com/CQCL/hugr", - "use_repository_button": True, - "navigation_with_keys": True, - "logo": { - "image_light": "_static/Quantinuum_logo_black.png", - "image_dark": "_static/Quantinuum_logo_white.png", - }, -} -html_static_path = ["../_static"] -html_css_files = ["custom.css"] +templates_path = ["_templates", "../quantinuum-sphinx/_templates"] +html_static_path = ['../_static', '../quantinuum-sphinx/_static'] autosummary_generate = True -templates_path = ["_templates"] exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", "conftest.py"] -html_sidebars = { - "**": [ - "navbar-logo.html", - "icon-links.html", - "search-button-field.html", - "sbt-sidebar-nav.html", - "versioning.html", - ], -} smv_branch_whitelist = "main" smv_tag_whitelist = r"^hugr-py-.*$" diff --git a/hugr-py/docs/quantinuum-sphinx b/hugr-py/docs/quantinuum-sphinx new file mode 160000 index 000000000..544cf64c0 --- /dev/null +++ b/hugr-py/docs/quantinuum-sphinx @@ -0,0 +1 @@ +Subproject commit 544cf64c042062bbef5c6aecd448cc86058e98d1 diff --git a/hugr-py/poetry.lock b/hugr-py/poetry.lock index 555981053..e7ed13911 100644 --- a/hugr-py/poetry.lock +++ b/hugr-py/poetry.lock @@ -1,22 +1,4 @@ -# This file is automatically @generated by Poetry 1.8.2 and should not be changed by hand. - -[[package]] -name = "accessible-pygments" -version = "0.0.5" -description = "A collection of accessible pygments styles" -optional = false -python-versions = ">=3.9" -files = [ - {file = "accessible_pygments-0.0.5-py3-none-any.whl", hash = "sha256:88ae3211e68a1d0b011504b2ffc1691feafce124b845bd072ab6f9f66f34d4b7"}, - {file = "accessible_pygments-0.0.5.tar.gz", hash = "sha256:40918d3e6a2b619ad424cb91e556bd3bd8865443d9f22f1dcdf79e33c8046872"}, -] - -[package.dependencies] -pygments = ">=1.5" - -[package.extras] -dev = ["pillow", "pkginfo (>=1.10)", "playwright", "pre-commit", "setuptools", "twine (>=5.0)"] -tests = ["hypothesis", "pytest"] +# This file is automatically @generated by Poetry 1.6.1 and should not be changed by hand. [[package]] name = "alabaster" @@ -207,6 +189,23 @@ files = [ {file = "docutils-0.21.2.tar.gz", hash = "sha256:3a6b18732edf182daa3cd12775bbb338cf5691468f91eeeb109deff6ebfa986f"}, ] +[[package]] +name = "furo" +version = "2024.5.6" +description = "A clean customisable Sphinx documentation theme." +optional = false +python-versions = ">=3.8" +files = [ + {file = "furo-2024.5.6-py3-none-any.whl", hash = "sha256:490a00d08c0a37ecc90de03ae9227e8eb5d6f7f750edf9807f398a2bdf2358de"}, + {file = "furo-2024.5.6.tar.gz", hash = "sha256:81f205a6605ebccbb883350432b4831c0196dd3d1bc92f61e1f459045b3d2b0b"}, +] + +[package.dependencies] +beautifulsoup4 = "*" +pygments = ">=2.7" +sphinx = ">=6.0,<8.0" +sphinx-basic-ng = ">=1.0.0.beta2" + [[package]] name = "idna" version = "3.7" @@ -436,34 +435,6 @@ files = [ [package.dependencies] typing-extensions = ">=4.6.0,<4.7.0 || >4.7.0" -[[package]] -name = "pydata-sphinx-theme" -version = "0.15.4" -description = "Bootstrap-based Sphinx theme from the PyData community" -optional = false -python-versions = ">=3.9" -files = [ - {file = "pydata_sphinx_theme-0.15.4-py3-none-any.whl", hash = "sha256:2136ad0e9500d0949f96167e63f3e298620040aea8f9c74621959eda5d4cf8e6"}, - {file = "pydata_sphinx_theme-0.15.4.tar.gz", hash = "sha256:7762ec0ac59df3acecf49fd2f889e1b4565dbce8b88b2e29ee06fdd90645a06d"}, -] - -[package.dependencies] -accessible-pygments = "*" -Babel = "*" -beautifulsoup4 = "*" -docutils = "!=0.17.0" -packaging = "*" -pygments = ">=2.7" -sphinx = ">=5" -typing-extensions = "*" - -[package.extras] -a11y = ["pytest-playwright"] -dev = ["pandoc", "pre-commit", "pydata-sphinx-theme[doc,test]", "pyyaml", "sphinx-theme-builder[cli]", "tox"] -doc = ["ablog (>=0.11.8)", "colorama", "graphviz", "ipykernel", "ipyleaflet", "ipywidgets", "jupyter_sphinx", "jupyterlite-sphinx", "linkify-it-py", "matplotlib", "myst-parser", "nbsphinx", "numpy", "numpydoc", "pandas", "plotly", "rich", "sphinx-autoapi (>=3.0.0)", "sphinx-copybutton", "sphinx-design", "sphinx-favicon (>=1.0.1)", "sphinx-sitemap", "sphinx-togglebutton", "sphinxcontrib-youtube (>=1.4.1)", "sphinxext-rediraffe", "xarray"] -i18n = ["Babel", "jinja2"] -test = ["pytest", "pytest-cov", "pytest-regressions", "sphinx[test]"] - [[package]] name = "pygments" version = "2.18.0" @@ -557,24 +528,21 @@ lint = ["flake8 (>=3.5.0)", "importlib_metadata", "mypy (==1.9.0)", "pytest (>=6 test = ["cython (>=3.0)", "defusedxml (>=0.7.1)", "pytest (>=6.0)", "setuptools (>=67.0)"] [[package]] -name = "sphinx-book-theme" -version = "1.1.3" -description = "A clean book theme for scientific explanations and documentation with Sphinx" +name = "sphinx-basic-ng" +version = "1.0.0b2" +description = "A modern skeleton for Sphinx themes." optional = false -python-versions = ">=3.9" +python-versions = ">=3.7" files = [ - {file = "sphinx_book_theme-1.1.3-py3-none-any.whl", hash = "sha256:a554a9a7ac3881979a87a2b10f633aa2a5706e72218a10f71be38b3c9e831ae9"}, - {file = "sphinx_book_theme-1.1.3.tar.gz", hash = "sha256:1f25483b1846cb3d353a6bc61b3b45b031f4acf845665d7da90e01ae0aef5b4d"}, + {file = "sphinx_basic_ng-1.0.0b2-py3-none-any.whl", hash = "sha256:eb09aedbabfb650607e9b4b68c9d240b90b1e1be221d6ad71d61c52e29f7932b"}, + {file = "sphinx_basic_ng-1.0.0b2.tar.gz", hash = "sha256:9ec55a47c90c8c002b5960c57492ec3021f5193cb26cebc2dc4ea226848651c9"}, ] [package.dependencies] -pydata-sphinx-theme = ">=0.15.2" -sphinx = ">=5" +sphinx = ">=4.0" [package.extras] -code-style = ["pre-commit"] -doc = ["ablog", "folium", "ipywidgets", "matplotlib", "myst-nb", "nbclient", "numpy", "numpydoc", "pandas", "plotly", "sphinx-copybutton", "sphinx-design", "sphinx-examples", "sphinx-tabs", "sphinx-thebe", "sphinx-togglebutton", "sphinxcontrib-bibtex", "sphinxcontrib-youtube", "sphinxext-opengraph"] -test = ["beautifulsoup4", "coverage", "defusedxml", "myst-nb", "pytest", "pytest-cov", "pytest-regressions", "sphinx_thebe"] +docs = ["furo", "ipython", "myst-parser", "sphinx-copybutton", "sphinx-inline-tabs"] [[package]] name = "sphinx-multiversion" @@ -726,4 +694,4 @@ zstd = ["zstandard (>=0.18.0)"] [metadata] lock-version = "2.0" python-versions = ">=3.10" -content-hash = "c0e0f4ebdc6d0b9e2b6e71841109ee1a47f42d850aa5621c5723006a9dd9d99a" +content-hash = "cd505e0854cd5ce8f30055505d5e234c5f971859b845883673fb5e7f084b71bb" diff --git a/hugr-py/pyproject.toml b/hugr-py/pyproject.toml index b37b24b40..06b3f2400 100644 --- a/hugr-py/pyproject.toml +++ b/hugr-py/pyproject.toml @@ -32,8 +32,8 @@ optional = true [tool.poetry.group.docs.dependencies] sphinx = "^7.2.6" -sphinx-book-theme = "^1.1.2" sphinx-multiversion = "^0.2.4" +furo = "^2024.5.6" [build-system] requires = ["poetry-core"]