|
71 | 71 | "page_sidebar_items": ["postcard", "page-toc", "edit-this-page"],
|
72 | 72 | }
|
73 | 73 | version = os.environ.get("READTHEDOCS_VERSION", "")
|
74 |
| -version = version if "-" in version else "main" |
| 74 | +version = version if "." in version else "main" |
| 75 | +doi_code = os.environ.get("DOI_READTHEDOCS", "10.5281/zenodo.5654871") |
75 | 76 | html_context = {
|
76 | 77 | "github_url": "https://github.com",
|
77 | 78 | "github_user": "pymc-devs",
|
78 | 79 | "github_repo": "pymc-examples",
|
79 | 80 | "github_version": version,
|
80 | 81 | "doc_path": "examples/",
|
81 | 82 | "sandbox_repo": f"pymc-devs/pymc-sandbox/{version}",
|
82 |
| - "doi_url": "https://doi.org/10.5281/zenodo.5654871", |
83 |
| - "doi_code": "10.5281/zenodo.5654871", |
| 83 | + "doi_url": f"https://doi.org/{doi_code}", |
| 84 | + "doi_code": doi_code, |
84 | 85 | }
|
85 | 86 |
|
86 | 87 |
|
|
117 | 118 |
|
118 | 119 | # MyST config
|
119 | 120 | myst_enable_extensions = ["colon_fence", "deflist", "dollarmath", "amsmath", "substitution"]
|
| 121 | +citation_code = f""" |
| 122 | +```bibtex |
| 123 | +@incollection{{citekey, |
| 124 | + author = "<notebook authors, see above>" |
| 125 | + title = "<notebook title>", |
| 126 | + editor = "PyMC Team", |
| 127 | + booktitle = "PyMC examples", |
| 128 | + doi = "{doi_code}" |
| 129 | +}} |
| 130 | +``` |
| 131 | +""" |
| 132 | + |
| 133 | + |
120 | 134 | myst_substitutions = {
|
121 | 135 | "pip_dependencies": "{{ extra_dependencies }}",
|
122 | 136 | "conda_dependencies": "{{ extra_dependencies }}",
|
123 | 137 | "extra_install_notes": "",
|
| 138 | + "citation_code": citation_code, |
124 | 139 | }
|
125 | 140 | jupyter_execute_notebooks = "off"
|
126 | 141 |
|
|
0 commit comments