Skip to content

Commit

Permalink
Create author list dynamically in docs (#94)
Browse files Browse the repository at this point in the history
* Create autorlist dynamically

* Update requirements.txt

* Get version using modern api

* Revert version
  • Loading branch information
endast authored May 21, 2024
1 parent 8bddce6 commit aa5c87a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ instance/

# Sphinx documentation
docs/_build/
docs/apidocs/

# PyBuilder
.pybuilder/
Expand Down
20 changes: 18 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit aa5c87a

Please sign in to comment.