Skip to content

Commit 837be25

Browse files
albert-githubsloriot
authored andcommitted
Double use of citation name
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).
1 parent 9601e96 commit 837be25

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Documentation/doc/scripts/generate_how_to_cite.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ def main():
278278
encoding="utf-8",
279279
)
280280
k = 2
281+
citeDic = {}
281282
for line in f:
283+
foundDouble=False
282284
match = pattern.match(line)
283285
if match:
284286
pkg = match.group(1)
@@ -304,6 +306,10 @@ def main():
304306
match = pattern_bib.match(pkg_line)
305307
if match:
306308
bib = match.group(1)
309+
if bib in citeDic:
310+
foundDouble=True
311+
else:
312+
citeDic[bib] = pkg
307313
continue
308314
assert len(bib) > 0, "Did you forget a \\cgalPkgBib{} in %r?" % filename
309315
assert len(authors) > 0, (
@@ -313,6 +319,11 @@ def main():
313319
"Did you forget the anchor in \\cgalPkgDescriptionBegin{} in %r?"
314320
% filename
315321
)
322+
assert not foundDouble, (
323+
"""Multiple use of citation name '{}' package '{}'
324+
first occurence package '{}'
325+
""".format(bib,pkg,citeDic[bib])
326+
)
316327
result_txt += gen_txt_entry(title, authors, bib, anchor, k)
317328
# convert title and author to bibtex format
318329
title = protect_upper_case(title)

0 commit comments

Comments
 (0)