Skip to content

Commit

Permalink
Double use of citation name
Browse files Browse the repository at this point in the history
Based on #8320 and doxygen/doxygen#11157 creating an assertion for builds from scratch when a citation name is used multiple times.
(doxygen cannot catch these here as they are directly written into html code).
  • Loading branch information
albert-github committed Sep 27, 2024
1 parent 68a28b6 commit 558af4b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Documentation/doc/scripts/generate_how_to_cite.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def main():
encoding="utf-8",
)
k = 2
citeDic = {}
for line in f:
foundDouble=False
match = pattern.match(line)
if match:
pkg = match.group(1)
Expand All @@ -303,6 +305,10 @@ def main():
match = pattern_bib.match(pkg_line)
if match:
bib = match.group(1)
if bib in citeDic:
foundDouble=True
else:
citeDic[bib] = pkg
continue
assert len(bib) > 0, "Did you forget a \\cgalPkgBib{} in %r?" % filename
assert len(authors) > 0, (
Expand All @@ -312,6 +318,11 @@ def main():
"Did you forget the anchor in \\cgalPkgDescriptionBegin{} in %r?"
% filename
)
assert not foundDouble, (
"""Multiple use of citation name '{}' package '{}'
first occurence package '{}'
""".format(bib,pkg,citeDic[bib])
)
result_txt += gen_txt_entry(title, authors, bib, anchor, k)
# convert title and author to bibtex format
title = protect_upper_case(title)
Expand Down

0 comments on commit 558af4b

Please sign in to comment.