Skip to content

Commit ae69b1d

Browse files
committed
doc/conf.py: Replace all titles
This fixes titles like "[Race Description]". Link: https://lore.kernel.org/ltp/[email protected]/ Fixes: 1bf344a ("doc: add tests catalog page") Acked-by: Andrea Cervesato <[email protected]> Signed-off-by: Petr Vorel <[email protected]>
1 parent 11ee12a commit ae69b1d

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

doc/conf.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -434,6 +434,7 @@ def generate_test_catalog(_):
434434
metadata = json.load(data)
435435

436436
timeout_def = metadata['defaults']['timeout']
437+
regexp = re.compile(r'^\[([A-Za-z][\w\W]+)\]')
437438

438439
for test_name, conf in sorted(metadata['tests'].items()):
439440
text.extend([
@@ -455,12 +456,8 @@ def generate_test_catalog(_):
455456
if desc:
456457
desc_text = []
457458
for line in desc:
458-
if line.startswith("[Description]"):
459-
desc_text.append("**Description**")
460-
elif line.startswith("[Algorithm]"):
461-
desc_text.append("**Algorithm**")
462-
else:
463-
desc_text.append(line)
459+
line = regexp.sub(r'**\1**', line)
460+
desc_text.append(line)
464461

465462
text.extend([
466463
'\n'.join(desc_text),

0 commit comments

Comments
 (0)