Skip to content

Commit

Permalink
docs: change theme to 'furo'
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Mar 5, 2023
1 parent 6705a82 commit 8045dcf
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 53 deletions.
54 changes: 35 additions & 19 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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"]

Expand Down
16 changes: 3 additions & 13 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ deps=
coverage: mypy
coverage: Pygments
docs: docutils
docs: furo
docs: sphinx
docs: sphinx-argparse
Expand Down
23 changes: 2 additions & 21 deletions tools/build_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,34 +18,15 @@
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():
"""
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,
Expand Down

0 comments on commit 8045dcf

Please sign in to comment.