From 558af4b355127db31398f476ad292e5b3f8d7fea Mon Sep 17 00:00:00 2001 From: albert-github Date: Fri, 27 Sep 2024 18:20:29 +0200 Subject: [PATCH] Double use of citation name Based on #8320 and https://github.com/doxygen/doxygen/pull/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). --- Documentation/doc/scripts/generate_how_to_cite.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Documentation/doc/scripts/generate_how_to_cite.py b/Documentation/doc/scripts/generate_how_to_cite.py index 409678ebb91..adb7297416a 100644 --- a/Documentation/doc/scripts/generate_how_to_cite.py +++ b/Documentation/doc/scripts/generate_how_to_cite.py @@ -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) @@ -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, ( @@ -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)