From 80f97e8018596e4cc657638df07c959f84141393 Mon Sep 17 00:00:00 2001 From: DemchaAV Date: Sat, 9 May 2026 11:09:41 +0100 Subject: [PATCH] =?UTF-8?q?fix(docs):=20add=20View=20Code=20button=20to=20?= =?UTF-8?q?showcase=20lightbox=20+=20flip=20v1.6.0=20=E2=86=92=20v1.6.1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two surfaces flagged on the deployed site: 1. Lightbox missing "View Code" button The regular gallery card already renders both "View PDF" + "View Code" links (renderCard, line 374-375), but the lightbox modal that opens when you click a Featured tile only had "Open PDF". Reading the source on GitHub from a featured example required closing the lightbox and finding the same example in the gallery below. Fixed by: - threading `code` through `renderHighlight` so the highlight button carries `data-code` like the regular card already did; - adding `data-code` to renderCard's preview button too (it was already in scope but never wired through to the lightbox); - adding a `.lightbox-code-link` anchor in `ensureLightbox` alongside the existing `.lightbox-pdf-link`; - extending `openLightbox(screenshot, pdf, code, title)` to set the new link's href, hiding the link when no code URL is available (e.g. "#" placeholder for examples without source). 2. v1.6.0 → v1.6.1 flip `softwareVersion` JSON-LD, `downloadUrl`, install snippets (Maven + Gradle), and the eyebrow tag in the hero all still read `v1.6.0`. Bumped to `v1.6.1` to match the release that's live on JitPack. --- docs/examples.js | 18 +++++++++++++++--- docs/index.html | 10 +++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/docs/examples.js b/docs/examples.js index d636abb6..80691fff 100644 --- a/docs/examples.js +++ b/docs/examples.js @@ -275,6 +275,7 @@ function renderHighlight(ex, categoryId) { const screenshot = ex.screenshot || ''; const pdf = ex.pdf || ''; + const code = ex.code || '#'; const badge = CATEGORY_BADGE[categoryId] || ''; return [ '
', @@ -282,6 +283,7 @@ ' data-action="lightbox"', ' data-screenshot="' + escAttr(screenshot) + '"', ' data-pdf="' + escAttr(pdf) + '"', + ' data-code="' + escAttr(code) + '"', ' data-title="' + escAttr(ex.title || ex.id || '') + '"', ' aria-label="Open preview for ' + escAttr(ex.title || ex.id || '') + '">', screenshot @@ -359,6 +361,7 @@ ' data-action="lightbox"', ' data-screenshot="' + escAttr(screenshot) + '"', ' data-pdf="' + escAttr(pdf) + '"', + ' data-code="' + escAttr(code) + '"', ' data-title="' + escAttr(ex.title || ex.id || '') + '"', ' aria-label="Open preview for ' + escAttr(ex.title || ex.id || '') + '">', screenshot @@ -412,7 +415,8 @@ ' ', @@ -434,12 +438,19 @@ }); return lightbox; } - function openLightbox(screenshot, pdf, title) { + function openLightbox(screenshot, pdf, code, title) { const lb = ensureLightbox(); lb.querySelector('.lightbox-image').src = screenshot; lb.querySelector('.lightbox-image').alt = title + ' preview'; lb.querySelector('.lightbox-title').textContent = title; lb.querySelector('.lightbox-pdf-link').href = pdf; + const codeLink = lb.querySelector('.lightbox-code-link'); + if (code && code !== '#') { + codeLink.href = code; + codeLink.style.display = ''; + } else { + codeLink.style.display = 'none'; + } lb.classList.add('is-open'); lb.setAttribute('aria-hidden', 'false'); document.body.classList.add('lightbox-open'); @@ -470,9 +481,10 @@ e.preventDefault(); const screenshot = trigger.dataset.screenshot; const pdf = trigger.dataset.pdf; + const code = trigger.dataset.code; const title = trigger.dataset.title; if (screenshot) { - openLightbox(screenshot, pdf, title); + openLightbox(screenshot, pdf, code, title); } else if (pdf) { window.open(pdf, '_blank'); } diff --git a/docs/index.html b/docs/index.html index cba426b6..c0349df5 100644 --- a/docs/index.html +++ b/docs/index.html @@ -44,9 +44,9 @@ "applicationSubCategory": "Library", "operatingSystem": "Cross-platform (JVM 21+)", "programmingLanguage": "Java", - "softwareVersion": "1.6.0", + "softwareVersion": "1.6.1", "url": "https://demchaav.github.io/GraphCompose/", - "downloadUrl": "https://jitpack.io/#DemchaAV/GraphCompose/v1.6.0", + "downloadUrl": "https://jitpack.io/#DemchaAV/GraphCompose/v1.6.1", "image": "https://demchaav.github.io/GraphCompose/assets/logo/graphcompose-logo.png", "license": "https://github.com/DemchaAV/GraphCompose/blob/main/LICENSE", "author": { @@ -151,7 +151,7 @@
-

Java · v1.6 · MIT

+

Java · v1.6.1 · MIT

Java PDF layout engine for structured business documents.

Describe documents. Render polished PDFs. A semantic layout engine for Java services that need structured, paginated, theme-driven output — CVs, invoices, proposals, reports.

No drawing API. No pixel arithmetic. You compose ParagraphNode, TableNode, SectionNode; GraphCompose handles measurement, pagination, fonts, and PDFBox rendering.

@@ -208,7 +208,7 @@

Maven

<dependency> <groupId>com.github.DemchaAV</groupId> <artifactId>GraphCompose</artifactId> - <version>v1.6.0</version> + <version>v1.6.1</version> </dependency>
@@ -219,7 +219,7 @@

Gradle

dependencies { implementation( - 'com.github.DemchaAV:GraphCompose:v1.6.0' + 'com.github.DemchaAV:GraphCompose:v1.6.1' ) }