check:packet-render measures the prayer-points page against its sheet, and counts the points by their headings
The points page fits ONE sheet only because its sizes are tuned to the longest language (studio's ask): pointsOver fails a page whose content outgrows its box (two-sided: 26px text fails; all 11 languages PASS at 18.5px). Each point's heading carries class pt-h, and the gate counts those: counting every line that starts 'N. ' read German's '1. Petrus 5:6–11' (its name for 1 Peter, point 11's reference) as a thirteenth point.
This commit is contained in:
parent
56278cabfe
commit
bd85830f1c
2 changed files with 10 additions and 1 deletions
|
|
@ -277,6 +277,10 @@ const r = await page.evaluate(() => {
|
|||
prayBoxes: document.querySelectorAll('.pray-box').length,
|
||||
fdTopOver: (() => { const b = document.querySelector('.fd-top'); if (!b) return 0; const top = b.getBoundingClientRect().top
|
||||
return Math.round(Math.max(0, ...[...b.children].map((k) => k.getBoundingClientRect().bottom + parseFloat(getComputedStyle(k).marginBottom))) - top - b.clientHeight) })(),
|
||||
// The points page is ONE sheet by design and fits only because its sizes were tuned to the longest locale;
|
||||
// measure its content against its box (studio's ask), as fdTopOver does for the list's first page.
|
||||
pointsOver: (() => { const b = document.querySelector('.points-body'); if (!b) return null; const top = b.getBoundingClientRect().top
|
||||
return Math.round(Math.max(b.scrollHeight - b.clientHeight, ...[...b.children].map((k) => k.getBoundingClientRect().bottom - top - b.clientHeight))) })(),
|
||||
funnelTip: document.querySelectorAll('.funnel-tip').length,
|
||||
lifeShaded: (() => { const g = document.querySelector('.sheet-christian .lc-svg'); return g ? window.__lcBoxes(g).shaded.length : null })(),
|
||||
// ★ FILLED FROM THE TOP, in reading order (the packet's design), measured on the DOM order of the cells:
|
||||
|
|
@ -450,6 +454,10 @@ const r = await page.evaluate(() => {
|
|||
if (!title) return -1
|
||||
const host = title.parentElement?.parentElement
|
||||
if (!host) return -1
|
||||
// Each point's heading carries class="pt-h": a numbered LINE is not a point. German cites "1. Petrus 5:6–11"
|
||||
// (its own name for 1 Peter), and that reference line was counted as a thirteenth point.
|
||||
const heads = host.querySelectorAll('.pt-h')
|
||||
if (heads.length) return heads.length
|
||||
return (host.innerText || '').split('\n').filter((l) => /^\s*\d{1,2}\.\s/.test(l)).length
|
||||
})(),
|
||||
metacamp: (body.match(/metacamp\.org/g) || []).length,
|
||||
|
|
@ -770,6 +778,7 @@ const fdPages = (n) => (n <= 0 ? 0 : 1 + Math.ceil(Math.max(0, n - RR.FD_FIRST)
|
|||
const listSheets = r.cards ? fdPages(r.cards) : wsPages(r.wsRows)
|
||||
// The Full detail's first page reserves a block for the explanation and CLIPS what outgrows it (rather than
|
||||
// let it overlap the rows): only a measurement sees a clipped line, so measure it.
|
||||
if (r.pointsOver !== null && r.pointsOver > 0) fails.push(`the prayer-points page outgrows its sheet by ${r.pointsOver}px — the twelve points and the themes must fit ONE page in every language`)
|
||||
if (r.fdTopOver > 0) fails.push(`the Full detail's explanation block outgrows its reserved height by ${r.fdTopOver}px — text is clipped (raise FD_TOP_H)`)
|
||||
if (r.wsRows && r.wsSheets !== wsPages(r.wsRows)) fails.push(`${r.wsRows} worksheet rows should take ${wsPages(r.wsRows)} page(s) but the packet has ${r.wsSheets}`)
|
||||
// + 2 again (2026-09-30, the second revision): point 4's Mark 5:18-20 and the Father's-heart list are back ON the
|
||||
|
|
|
|||
|
|
@ -1393,7 +1393,7 @@ export function createPacketRenderer({ strings, lang = 'en', fontData = null, de
|
|||
const refs = (p.refs || []).map(refSpan).join(' · ');
|
||||
const sub = p.sub ? ` <span style="font:italic ${PT.sub}px Georgia,serif;color:#8c8170">— ${esc(p.sub)}</span>` : '';
|
||||
return `<div style="margin-bottom:${PT.gap}px">
|
||||
<div style="font:700 ${PT.head}px Georgia,serif;color:#1b1a17">
|
||||
<div class="pt-h" style="font:700 ${PT.head}px Georgia,serif;color:#1b1a17">
|
||||
${p.n}. ${esc(tr(p.rhythm))}${sub}</div>
|
||||
<div style="font:400 ${PT.text}px Georgia,serif;color:#3b3226;line-height:1.3;margin-top:2px">${esc(p.text)}</div>
|
||||
<div style="font:600 ${PT.refs}px Georgia,serif;color:#7a3b2e;margin-top:2px">${refs}</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue