We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 2b7394f commit cf38295Copy full SHA for cf38295
1 file changed
openkb/agent/compiler.py
@@ -494,10 +494,18 @@ def _update_index(
494
495
for name in concept_names:
496
concept_link = f"[[concepts/{name}]]"
497
- if concept_link not in text:
498
- concept_entry = f"- {concept_link}"
+ concept_entry = f"- {concept_link}"
+ if name in concept_briefs:
499
+ concept_entry += f" — {concept_briefs[name]}"
500
+ if concept_link in text:
501
if name in concept_briefs:
- concept_entry += f" — {concept_briefs[name]}"
502
+ lines = text.split("\n")
503
+ for i, line in enumerate(lines):
504
+ if concept_link in line:
505
+ lines[i] = concept_entry
506
+ break
507
+ text = "\n".join(lines)
508
+ else:
509
if "## Concepts" in text:
510
text = text.replace("## Concepts\n", f"## Concepts\n{concept_entry}\n", 1)
511
0 commit comments