fix(orion): correct report numbering toc and first page
This commit is contained in:
parent
503b343070
commit
47f54d3461
7 changed files with 283 additions and 137 deletions
|
|
@ -1,16 +1,19 @@
|
|||
@page {
|
||||
size: A4;
|
||||
margin: 34mm 18mm 24mm 18mm;
|
||||
@top-left { content: element(report-header); }
|
||||
@bottom-left { content: element(report-footer); }
|
||||
}
|
||||
|
||||
@page:first {
|
||||
@page cover {
|
||||
margin: 20mm 18mm 20mm 18mm;
|
||||
@top-left { content: ""; }
|
||||
@bottom-left { content: ""; }
|
||||
}
|
||||
|
||||
@page report {
|
||||
margin: 34mm 18mm 24mm 18mm;
|
||||
@top-left { content: element(report-header); }
|
||||
@bottom-left { content: element(report-footer); }
|
||||
}
|
||||
|
||||
* {
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
|
@ -27,6 +30,7 @@ body {
|
|||
}
|
||||
|
||||
.report-meta {
|
||||
display: none;
|
||||
string-set: report-number attr(data-report-number), report-version attr(data-report-version), report-date attr(data-report-date);
|
||||
}
|
||||
|
||||
|
|
@ -130,11 +134,16 @@ body {
|
|||
}
|
||||
|
||||
.cover-page {
|
||||
page: cover;
|
||||
min-height: 245mm;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: flex-start;
|
||||
page-break-after: always;
|
||||
break-after: page;
|
||||
}
|
||||
|
||||
.report-content {
|
||||
page: report;
|
||||
}
|
||||
|
||||
.cover-top {
|
||||
|
|
@ -207,6 +216,12 @@ h2 {
|
|||
line-height: 1.15;
|
||||
margin: 0 0 7mm 0;
|
||||
padding-bottom: 4mm;
|
||||
bookmark-level: none;
|
||||
}
|
||||
|
||||
h2[data-bookmark-label] {
|
||||
bookmark-label: attr(data-bookmark-label);
|
||||
bookmark-level: 1;
|
||||
}
|
||||
|
||||
.chapter + .chapter {
|
||||
|
|
@ -286,9 +301,26 @@ dd {
|
|||
|
||||
.toc-list a {
|
||||
color: #2E3B40;
|
||||
display: grid;
|
||||
gap: 4mm;
|
||||
grid-template-columns: 1fr 14mm;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.toc-level-2 {
|
||||
padding-left: 6mm;
|
||||
}
|
||||
|
||||
.toc-level-3,
|
||||
.toc-level-4 {
|
||||
padding-left: 12mm;
|
||||
}
|
||||
|
||||
.toc-list a::after {
|
||||
content: target-counter(attr(href), page);
|
||||
text-align: right;
|
||||
}
|
||||
|
||||
.figure-grid {
|
||||
display: grid;
|
||||
gap: 8mm;
|
||||
|
|
|
|||
|
|
@ -38,7 +38,8 @@ def render_document(context: ReportContext, chapters: list[str]) -> str:
|
|||
css = (Path(__file__).resolve().parent / "report.css").read_text(encoding="utf-8")
|
||||
logo_uri = schubamed_logo_uri()
|
||||
title = f"Validierungsbericht {context.validation.report_number}"
|
||||
chapter_markup = "\n".join(chapters)
|
||||
cover_markup = chapters[0] if chapters else ""
|
||||
content_markup = "\n".join(chapters[1:])
|
||||
return f"""<!doctype html>
|
||||
<html lang="de">
|
||||
<head>
|
||||
|
|
@ -49,9 +50,12 @@ def render_document(context: ReportContext, chapters: list[str]) -> str:
|
|||
</head>
|
||||
<body>
|
||||
<article class="report-document">
|
||||
<div class="report-meta" data-report-number="{text(context.validation.report_number)}" data-report-version="{text(context.validation.version)}" data-report-date="{text(context.validation.updated_at)}"></div>
|
||||
{render_report_chrome(context, logo_uri)}
|
||||
{chapter_markup}
|
||||
{cover_markup}
|
||||
<section class="report-content">
|
||||
<div class="report-meta" data-report-number="{text(context.validation.report_number)}" data-report-version="{text(context.validation.version)}" data-report-date="{text(context.validation.updated_at)}"></div>
|
||||
{render_report_chrome(context, logo_uri)}
|
||||
{content_markup}
|
||||
</section>
|
||||
</article>
|
||||
</body>
|
||||
</html>"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue