diff --git a/.eleventy.js b/.eleventy.js index 1c51fe6..2fcb4d2 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -36,6 +36,31 @@ export default function configureEleventy(eleventyConfig) { eleventyConfig.addFilter('edcmMarkdown', value => md.render(String(value || '')) .replace(/]*\btabindex=)([^>]*)>/g, '
')
     .replace(/]*\btabindex=)(?=[^>]*\bdisplay="block")/g, '\s*

Source boundary<\/h2>\s*

([\s\S]*?)<\/p>\s*

([\s\S]*?)<\/p>\s*<\/section>/, + (_match, boundaryText, linkLine) => { + const links = [...linkLine.matchAll(/]*>[\s\S]*?<\/a>/g)].map(match => match[0]); + const sourceLink = links.shift() || ''; + const navigation = links.length + ? `

` + : ''; + return `
Source & provenance

Source boundary

${boundaryText}

${sourceLink ? `

${sourceLink}

` : ''}
${navigation}`; + } + ) + .replaceAll('Speaker A · exact canon excerpt', 'Article') + .replaceAll('Speaker B · footnote conversation', 'Footnotes'); + }); + // Exact canonical body lines of a unit: skip the heading line, stop before // footnote lines, notes blocks, separators, and sub-headings. Mirrors the // body extraction in scripts/verify-article-canon.mjs; keep the two in step. diff --git a/package.json b/package.json index bfca4b1..75f1e78 100644 --- a/package.json +++ b/package.json @@ -20,7 +20,7 @@ "build": "npm run validate && eleventy && pagefind --site _site && node scripts/write-build-info.mjs", "pretest": "node scripts/prepare-tests.mjs", "test": "node --test tests/aicontext.test.mjs tests/edcm-mathematics.test.mjs tests/gonol-relationships.test.mjs tests/post-merge-reconciliation.test.mjs tests/llms-build.test.mjs tests/canon-parser.test.mjs tests/canon-integrity.test.mjs tests/textbook-integrity.test.mjs tests/math-rendering.test.mjs tests/narratives.test.mjs tests/offline-project-snapshot.test.mjs tests/repo-coverage.test.mjs tests/research-ledger.test.mjs tests/works-registry.test.mjs tests/site-contract.test.mjs", - "test:generated": "node --test tests/generated-site.test.mjs tests/textbook-generated.test.mjs tests/math-generated.test.mjs && node tests/links.test.mjs", + "test:generated": "node --test tests/generated-site.test.mjs tests/human-ui-generated.test.mjs tests/textbook-generated.test.mjs tests/math-generated.test.mjs && node tests/links.test.mjs", "test:browser": "playwright test", "test:e2e": "playwright test tests/site.spec.mjs", "test:a11y": "playwright test tests/accessibility.spec.mjs", diff --git a/src/chapters/chapter.njk b/src/chapters/chapter.njk index 088fc64..b25b1ba 100644 --- a/src/chapters/chapter.njk +++ b/src/chapters/chapter.njk @@ -12,13 +12,17 @@ eleventyComputed:

Distributed textbook · Chapter {{ chapter.display_number }}

- exact repository source {{ chapter.status }} {% if chapter.fallback %}fallback{% endif %}
-

This chapter is displayed from {{ chapter.repository }}:{{ chapter.path }}. Its repository retains its license, status vocabulary, and claim authority; this reader does not transfer those statuses to any other chapter or to The Interdependent Way canon.

+

Each chapter retains the claim authority and status vocabulary of the repository that carries it. Source identity and verification metadata are available after the chapter text.

-
+{% if chapter.content %} +
+ {{ chapter.content | markdown | safe }} +
+
+ Source & provenance

Source evidence

Repository
{{ chapter.repository }}
@@ -29,13 +33,9 @@ eleventyComputed:
Retrieved
{{ chapter.retrievedAt or "hmmm" }}
-
-{% if chapter.content %} -
- {{ chapter.content | markdown | safe }} -
+ {% else %} -

Chapter {{ chapter.display_number }} source unavailable

The offline build has no retained content snapshot for this chapter. Its declared source remains available through the repository link above; no substitute text has been invented.

{{ chapter.retrievalError }}

+

Chapter {{ chapter.display_number }} source unavailable

The offline build has no retained content snapshot for this chapter. Its declared source remains available through the repository link below; no substitute text has been invented.

{{ chapter.retrievalError }}

Source & provenance

Source evidence

Open declared source in GitHub

{% endif %}