From aa959c51884c10e1943fd915b651a4ab36d63139 Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Wed, 27 Nov 2019 11:29:40 +0100 Subject: part-validate-parts report: Creating internal links. --- src/ee/tools/part_validate_parts.py | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/ee/tools') diff --git a/src/ee/tools/part_validate_parts.py b/src/ee/tools/part_validate_parts.py index cebe70f..1e34326 100644 --- a/src/ee/tools/part_validate_parts.py +++ b/src/ee/tools/part_validate_parts.py @@ -113,10 +113,8 @@ def validate(f, ctx: Context, bom_part: Part, sch_part: Part): if m: messages.append(m) - title = "Checking {}".format(sch_part.printable_reference) - print(title, file=f) - print("{}".format("=" * len(title)), file=f) - print("", file=f) + title = "Checks for {}".format(sch_part.printable_reference) + print(".. _{}:\n\n{}\n{}\n".format(sch_part.printable_reference, title, "=" * len(title)), file=f) for msg in messages.errors: print("* ERROR: {}".format(msg), file=f) @@ -165,11 +163,11 @@ def work(bom_path: Path, sch_path: Path, report_path: Path, part_dbs: List[Path] print("", file=f) for message, messages_ in groupby(sorted(messages.messages, key=lambda m: m[2]), lambda m: m[2]): messages = list(messages_) - print(message, file=f) - print("{}".format("-" * len(message)), file=f) + print("{}\n{}\n".format(message, "-" * len(message)), file=f) for m in messages: - print(" * {}".format(m[0].printable_reference), file=f) + ref = m[0].printable_reference + print(" * `{} <{}_>`_".format(ref, ref), file=f) print("", file=f) -- cgit v1.2.3