diff --git a/.gitignore b/.gitignore index 8a394a9a..9274e749 100644 --- a/.gitignore +++ b/.gitignore @@ -76,6 +76,7 @@ instance/ # Sphinx documentation docs/_build/ +docs/apidocs/ # PyBuilder .pybuilder/ diff --git a/docs/conf.py b/docs/conf.py index f96b483f..4946a4c2 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -7,10 +7,26 @@ # https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information from datetime import datetime +from pathlib import Path + +import yaml + + +def get_authors(cff_file): + with open(cff_file) as cff_data: + authors = yaml.safe_load(cff_data).get("authors") + return ", ".join( + [f"{a['family-names']}, {a['given-names'][0]}." for a in authors] + ) + + +cff_path = Path(__file__).parent.resolve() / "../CITATION.cff" +author_list = get_authors(cff_file=cff_path) + project = "DeepRVAT" -copyright = f"{datetime.now().year}, Clarke, B., Holtkamp, E., Öztürk, H., Mück, M., Wahlberg, M., Meyer, K., Brechtmann, F., Hölzlwimmer, F. R., Gagneur, J., & Stegle, O" -author = "Clarke, B., Holtkamp, E., Öztürk, H., Mück, M., Wahlberg, M., Meyer, K., Brechtmann, F., Hölzlwimmer, F. R., Gagneur, J., & Stegle, O" +copyright = f"{datetime.now().year}, {author_list}" +author = f"{author_list}" version = "0.1.0" release = version diff --git a/docs/requirements.txt b/docs/requirements.txt index 97d35c58..04217f4b 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -4,3 +4,4 @@ sphinx-autodoc2==0.4.2 astroid==2.15.8 sphinx-copybutton==0.5.2 sphinx-rtd-theme==1.3.0 +PyYAML==6.0.1