Preserve classic finding layout for authored reports
This commit is contained in:
parent
2eebf62f12
commit
127a74ab29
|
|
@ -69,6 +69,15 @@
|
|||
parbreak(); link(finding.reference_url)[#as-text(get(finding, "reference_label", default: "Reference guidance")) ↗]
|
||||
}
|
||||
]
|
||||
#let render-classic-finding(finding) = block(width: 100%, inset: 8pt, below: 6pt, breakable: false,
|
||||
stroke: 0.5pt + line-color, radius: 2pt)[
|
||||
#grid(columns: (1fr, auto, auto), gutter: 5pt, align: (left, center, center),
|
||||
text(weight: "bold")[#as-text(finding.title)],
|
||||
if "severity" in finding { badge(finding.severity) } else { [] },
|
||||
if "status" in finding { badge(finding.status) } else { [] })
|
||||
#if "evidence" in finding { parbreak(); text(size: 8pt, weight: "bold", fill: muted)[EVIDENCE]; parbreak(); as-text(finding.evidence) }
|
||||
#if "assessment" in finding { parbreak(); text(size: 8pt, weight: "bold", fill: muted)[ASSESSMENT]; parbreak(); as-text(finding.assessment) }
|
||||
]
|
||||
#let render-block(item) = {
|
||||
let kind = get(item, "type", default: "text")
|
||||
if kind == "text" { inline-code(get(item, "text", default: "")) }
|
||||
|
|
@ -188,7 +197,11 @@
|
|||
#let sections-own-findings = get(report, "sections", default: ()).any(section => section.content.any(has-finding-list))
|
||||
#if not sections-own-findings and "findings" in report and report.findings.len() > 0 {
|
||||
heading("Findings")
|
||||
for finding in report.findings { render-finding(finding) }
|
||||
for finding in report.findings {
|
||||
if "confidence" in finding or "resolution_steps" in finding or "reference_url" in finding {
|
||||
render-finding(finding)
|
||||
} else { render-classic-finding(finding) }
|
||||
}
|
||||
}
|
||||
#for section in get(report, "sections", default: ()) {
|
||||
if get(section, "page_break_before", default: false) { pagebreak(weak: true) }
|
||||
|
|
|
|||
Loading…
Reference in New Issue