Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions docs/examples.js
Original file line number Diff line number Diff line change
Expand Up @@ -275,13 +275,15 @@
function renderHighlight(ex, categoryId) {
const screenshot = ex.screenshot || '';
const pdf = ex.pdf || '';
const code = ex.code || '#';
const badge = CATEGORY_BADGE[categoryId] || '';
return [
'<article class="highlight-tile" data-id="' + escAttr(ex.id || '') + '" role="listitem">',
' <button type="button" class="highlight-preview"',
' 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -412,7 +415,8 @@
' <header class="lightbox-header">',
' <h4 class="lightbox-title"></h4>',
' <div class="lightbox-actions">',
' <a class="example-action lightbox-pdf-link" target="_blank" rel="noopener">Open PDF</a>',
' <a class="example-action lightbox-pdf-link" target="_blank" rel="noopener" aria-label="Open PDF">Open PDF</a>',
' <a class="example-action example-action-ghost lightbox-code-link" target="_blank" rel="noopener" aria-label="Open source on GitHub">View Code</a>',
' <button class="lightbox-close" type="button" aria-label="Close" data-close>&times;</button>',
' </div>',
' </header>',
Expand All @@ -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');
Expand Down Expand Up @@ -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');
}
Expand Down
10 changes: 5 additions & 5 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down Expand Up @@ -151,7 +151,7 @@
<main id="top">
<section class="hero section-shell" aria-labelledby="hero-title">
<div class="hero-copy">
<p class="eyebrow">Java &middot; v1.6 &middot; MIT</p>
<p class="eyebrow">Java &middot; v1.6.1 &middot; MIT</p>
<h1 id="hero-title">Java PDF layout engine for structured business documents.</h1>
<p class="hero-lead">Describe documents. Render polished PDFs. A semantic layout engine for Java services that need <b>structured, paginated, theme-driven</b> output &mdash; CVs, invoices, proposals, reports.</p>
<p class="hero-text">No drawing API. No pixel arithmetic. You compose <code>ParagraphNode</code>, <code>TableNode</code>, <code>SectionNode</code>; GraphCompose handles measurement, pagination, fonts, and PDFBox rendering.</p>
Expand Down Expand Up @@ -208,7 +208,7 @@ <h4>Maven</h4>
&lt;dependency&gt;
&lt;groupId&gt;com.github.DemchaAV&lt;/groupId&gt;
&lt;artifactId&gt;GraphCompose&lt;/artifactId&gt;
&lt;version&gt;v1.6.0&lt;/version&gt;
&lt;version&gt;v1.6.1&lt;/version&gt;
&lt;/dependency&gt;</code></pre>
</div>
<div class="install-block">
Expand All @@ -219,7 +219,7 @@ <h4>Gradle</h4>

dependencies {
implementation(
'com.github.DemchaAV:GraphCompose:v1.6.0'
'com.github.DemchaAV:GraphCompose:v1.6.1'
)
}</code></pre>
</div>
Expand Down
Loading