Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read the Docs Implementation #246

Merged
merged 10 commits into from
Sep 27, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: 2

submodules:
include: all
recursive: true

build:
os: ubuntu-22.04
tools:
python: "3.11"
jobs:
post_checkout:
# Skip docs build if the commit message contains "skip ci"
- (git --no-pager log --pretty="tformat:%s -- %b" -1 | grep -viq "skip ci") || exit 183
# Skip docs build if there are no changes related to docs
- |
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- docs/ .readthedocs.yaml src/mqt/ .github/contributing* .github/workflows/support*;
then
exit 183;
fi

sphinx:
configuration: docs/conf.py

python:
install:
- method: pip
path: .
extra_requirements:
- docs
Binary file added docs/_static/mqt_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/mqt_light.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
"""Sphinx configuration file."""

from __future__ import annotations

import warnings
from importlib import metadata
from pathlib import Path

ROOT = Path(__file__).parent.parent.resolve()


try:
from mqt.bench import __version__ as version
except ModuleNotFoundError:
try:
version = metadata.version("mqt.bench")
except ModuleNotFoundError:
msg = (
"Package should be installed to produce documentation! "
"Assuming a modern git archive was used for version discovery."
)
warnings.warn(msg, stacklevel=1)

from setuptools_scm import get_version

version = get_version(root=str(ROOT), fallback_root=ROOT)

# Filter git details from version
release = version.split("+")[0]

project = "MQT Bench"
author = "Chair for Design Automation, Technical University of Munich"
language = "en"
project_copyright = "2023, Chair for Design Automation, Technical University of Munich"

extensions = [
"myst_parser",
"sphinx.ext.intersphinx",
"sphinx_design",
"sphinx_copybutton",
"sphinxext.opengraph",
]

source_suffix = [".rst", ".md"]

exclude_patterns = [
"_build",
"**.ipynb_checkpoints",
"Thumbs.db",
".DS_Store",
".env",
".venv",
]

pygments_style = "colorful"

add_module_names = False

modindex_common_prefix = ["mqt.bench."]

intersphinx_mapping = {
"python": ("https://docs.python.org/3", None),
"qiskit": ("https://qiskit.org/documentation/", None),
"mqt": ("https://mqt.readthedocs.io/en/latest/", None),
}
intersphinx_disabled_reftypes = ["*"]

myst_enable_extensions = [
"colon_fence",
"substitution",
"deflist",
]

myst_substitutions = {
"version": version,
}

copybutton_prompt_text = r"(?:\(venv\) )?(?:\[.*\] )?\$ "
copybutton_prompt_is_regexp = True
copybutton_line_continuation_character = "\\"

# -- Options for HTML output -------------------------------------------------
html_theme = "furo"
html_static_path = ["_static"]
html_theme_options = {
"light_logo": "mqt_dark.png",
"dark_logo": "mqt_light.png",
"source_repository": "https://github.com/cda-tum/mqt-bench/",
"source_branch": "main",
"source_directory": "docs/",
"navigation_with_keys": True,
}
7 changes: 7 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# MQT Bench - A MQT tool for Benchmarking Quantum Software Tools

The MQT Bench library forms is part of the quantum software tools developed as part of the _{doc}`Munich Quantum Toolkit (MQT) <mqt:index>`_ by the [Chair for Design Automation](https://www.cda.cit.tum.de/) at the [Technical University of Munich](https://www.tum.de/).

```{include} ../README.md
:start-after: <!-- SPHINX-START -->
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
requires = [
"setuptools>=61",
"setuptools_scm[toml]>=7",
"setuptools_scm>=7",
]
build-backend = "setuptools.build_meta"

Expand Down
Loading