diff --git a/docs/conf.py b/docs/conf.py index 7378e265b..bbcd7e54d 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- from sys import path as sys_path +from os import environ from os.path import abspath from pathlib import Path @@ -53,25 +54,40 @@ # -- Options for HTML output ---------------------------------------------- -if (ROOT / "_theme").is_dir(): - html_theme_path = ["."] - html_theme = "_theme" - html_theme_options = { - "analytics_id": "UA-112393863-1", - "logo_only": True, - "vcs_pageview_mode": "blob", - "style_nav_header_background": "#0c479d", - "home_breadcrumbs": False, - } - html_context = { - "conf_py_path": f"{ROOT.name}/", - "display_github": True, - "github_user": "VUnit", - "github_repo": "vunit", - "github_version": "master/", - } -else: - html_theme = "alabaster" +html_theme = "furo" + +html_css_files = [ + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/fontawesome.min.css", + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/solid.min.css", + "https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/brands.min.css", +] + +html_theme_options = { + "source_repository": "https://github.com/VUnit/vunit", + "source_branch": environ.get("GITHUB_REF_NAME", "master"), + "source_directory": "docs", + "sidebar_hide_name": True, + "footer_icons": [ + { + "name": "Twitter @VUnitFramework", + "url": "https://twitter.com/VUnitFramework", + "html": "", + "class": "fa-solid fa-brands fa-twitter", + }, + { + "name": "Gitter VUnit/vunit", + "url": "https://gitter.im/VUnit/vunit", + "html": "", + "class": "fa-solid fa-brands fa-gitter", + }, + { + "name": "GitHub VUnit/vunit", + "url": "https://github.com/VUnit/vunit", + "html": "", + "class": "fa-solid fa-brands fa-github", + }, + ], +} html_static_path = ["_static"] diff --git a/docs/index.rst b/docs/index.rst index f5d25eb0d..956acd86f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -1,21 +1,11 @@ +VUnit: a test framework for HDL +=============================== -.. centered:: |shieldRepo|_ |shieldPyPI|_ |shieldGitter|_ |shieldTwitter|_ - -.. |shieldRepo| image:: https://img.shields.io/badge/VUnit/vunit-0c479d.svg?longCache=true&style=flat-square&logo=github -.. _shieldRepo: https://github.com/VUnit/vunit +.. centered:: |shieldPyPI|_ .. |shieldPyPI| image:: https://img.shields.io/pypi/v/vunit_hdl?longCache=true&style=flat-square&label=PyPI&logo=PyPI&logoColor=FFF .. _shieldPyPI: https://pypi.org/project/vunit-hdl/ -.. |shieldGitter| image:: https://img.shields.io/gitter/room/VUnit/vunit.svg?longCache=true&style=flat-square&logo=gitter&logoColor=4db797&color=4db797 -.. _shieldGitter: https://gitter.im/VUnit/vunit - -.. |shieldTwitter| image:: https://img.shields.io/twitter/follow/VUnitFramework.svg?longCache=true&style=flat-square&color=1DA1F2&label=%40VUnitFramework&logo=twitter&logoColor=fff -.. _shieldTwitter: https://www.twitter.com/VUnitFramework - -VUnit: a test framework for HDL -=============================== - VUnit is an open source unit testing framework for VHDL/SystemVerilog released under the terms of Mozilla Public License, v. 2.0. It features the functionality needed to realize continuous and automated diff --git a/pyproject.toml b/pyproject.toml index ccd6f90c0..f94bdc461 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ deps= coverage: mypy coverage: Pygments docs: docutils + docs: furo docs: sphinx docs: sphinx-argparse diff --git a/tools/build_docs.py b/tools/build_docs.py index 58072015e..2560ef1eb 100644 --- a/tools/build_docs.py +++ b/tools/build_docs.py @@ -18,22 +18,7 @@ from create_release_notes import create_release_notes -DROOT = Path(__file__).parent.parent / 'docs' - - -def get_theme(path: Path, url: str): - """ - Check if the theme is available locally, retrieve it with curl and tar otherwise - """ - tpath = path / "_theme" - if not tpath.is_dir() or not (tpath / "theme.conf").is_file(): - if not tpath.is_dir(): - tpath.mkdir() - zpath = path / "theme.tgz" - if not zpath.is_file(): - check_call(["curl", "-fsSL", url, "-o", str(zpath)]) - tar_cmd = ["tar", "--strip-components=1", "-C", str(tpath), "-xvzf", str(zpath)] - check_call(tar_cmd) +ROOT = Path(__file__).parent.parent def main(): @@ -41,11 +26,7 @@ def main(): Build documentation/website """ create_release_notes() - copyfile(str(DROOT / '..' / 'LICENSE.rst'), str(DROOT / 'license.rst')) - get_theme( - DROOT, - "https://codeload.github.com/buildthedocs/sphinx.theme/tar.gz/v1" - ) + copyfile(str(ROOT / 'LICENSE.rst'), str(ROOT / 'docs/license.rst')) check_call( [ sys.executable,