add support for page summary and summary cards

This commit is contained in:
Jean-Marie 'Histausse' Mineau 2026-04-20 14:13:32 +02:00
parent 383cf855b5
commit ff024740a4
Signed by: histausse
GPG key ID: B66AEEDA9B645AD2
5 changed files with 176 additions and 7 deletions

View file

@ -1,15 +1,22 @@
#import "@local/template-web:0.0.1": *
#set document(
#let summ = summary(
url: "http://test.example.com",
title: "TeTyTe",
preview-image: image(
"./platypus.png",
alt: "A drawing of a blue-ish round-ish platypus with big eyes, holding a laptop. This platypus is quite cute, but I might be biased.",
),
author: "Me!",
description: "Test of the TTT template",
date: datetime(year: 1942, month: 4, day: 1),
)
#set document(
..summ.document-args
)
#show: webpage.with(
"http://test.example.com",
..summ.template-args,
home: link(
"http://test.example.com",
image(
@ -51,6 +58,8 @@
#lorem(400)
#summ.card
Test, `this is not a code block`, end test.
```python
@ -66,7 +75,7 @@ def plopliplop(n: int)
print(i)
```
/*
#figure({
show table: set text(size: 0.80em)
table(
@ -97,6 +106,7 @@ def plopliplop(n: int)
caption: [Comparison of API methods between documentation and emulators],
)<tab:cl-platform_apis>
*/
```raw-css
table {
@ -117,7 +127,7 @@ thead {
border-bottom: 1px solid #999999;
}
```
/*
#table(
columns: 5,
//inset: (x: 0% + 5pt, y: 0% + 2pt),
@ -135,6 +145,7 @@ thead {
[34], [605106], [605098], [26], [18],
table.hline(),
)
*/
#figure(
image(
@ -150,3 +161,16 @@ thead {
),
caption: [A Big Platypus!]
)
#card-list(
range(1, 21).map(i =>
summary(
url: "http://test.example.com",
title: "Card " + str(i),
preview-image: summ.preview-image,
author: "Me!",
description: lorem(10 * calc.rem(i * 123, 10)),
date: datetime(year: 2000, month: 12, day: i),
)
)
)