Skip to content

Commit

Permalink
Update refcomp table with citations
Browse files Browse the repository at this point in the history
  • Loading branch information
morganjwilliams committed Nov 1, 2024
1 parent 4afa3eb commit dfd4ced
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 27 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,11 +313,37 @@ def reset_mpl(gallery_conf, fname):
comps = []
for r in reservoirs:
comps += [n for n in refs if refs[n].reservoir == r]

refcomps = (
" <dl>"
+ "\n ".join(["<dt>{}</dt><dd>{}</dd>".format(n, refs[n]) for n in comps])
+ "\n ".join(
[
"<dt>{}</dt><dd>{}</dd>".format(
n,
" ".join(
[str(refs[n])]
+ (
["<br><b>Citation</b>: " + refs[n].citation]
if refs[n].citation
else []
)
+ (
[
"<br><b>doi</b>: <a href='https://dx.doi.org/{}'>{}</a>".format(
refs[n].doi, refs[n].doi
)
]
if refs[n].doi
else []
)
),
)
for n in comps
]
)
+ "</dl>"
)
print(refcomps)
rst_prolog = """
.. |br| raw:: html
Expand Down
2 changes: 2 additions & 0 deletions docs/source/docutils.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[parsers]
line_length_limit=1_000_000

0 comments on commit dfd4ced

Please sign in to comment.