-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.html
More file actions
424 lines (401 loc) · 24 KB
/
Copy pathindex.html
File metadata and controls
424 lines (401 loc) · 24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="GraphCompose: Java PDF layout engine for structured business documents. Browse 50+ runnable examples across CV, invoice, proposal templates, and every supported feature.">
<meta name="keywords" content="Java, PDF, PDF library, PDF layout, document generation, declarative PDF, PDFBox, business documents, Java template engine, CV PDF, invoice PDF, proposal PDF">
<meta name="author" content="Artem Demchyshyn">
<title>GraphCompose — Java PDF layout engine for structured business documents</title>
<link rel="canonical" href="https://demchaav.github.io/GraphCompose/">
<link rel="icon" href="assets/logo/graphcompose-logo.png">
<link rel="stylesheet" href="styles.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/themes/prism-tomorrow.min.css">
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Space+Grotesk:wght@500;600;700&display=swap">
<!-- Apply the saved theme before first paint to avoid a flash. Dark is the default. -->
<script>
(function () {
try {
if (localStorage.getItem('gc-theme') === 'light') {
document.documentElement.setAttribute('data-theme', 'light');
}
} catch (e) {}
})();
</script>
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:url" content="https://demchaav.github.io/GraphCompose/">
<meta property="og:site_name" content="GraphCompose">
<meta property="og:title" content="GraphCompose — Java PDF layout engine for structured business documents">
<meta property="og:description" content="Declarative semantic PDF generation for Java. CVs, invoices, proposals, reports — composed from ParagraphNode, TableNode, SectionNode. 50+ runnable examples.">
<meta property="og:image" content="https://demchaav.github.io/GraphCompose/showcase/screenshots/templates/proposal/project-proposal-cinematic.png">
<meta property="og:image:alt" content="GraphCompose-rendered project proposal PDF preview">
<meta property="og:image:width" content="893">
<meta property="og:image:height" content="1263">
<meta property="og:locale" content="en_US">
<!-- Twitter Card -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="GraphCompose — Java PDF layout engine">
<meta name="twitter:description" content="Declarative semantic PDF generation for Java. CVs, invoices, proposals, reports — composed from ParagraphNode, TableNode, SectionNode.">
<meta name="twitter:image" content="https://demchaav.github.io/GraphCompose/showcase/screenshots/templates/proposal/project-proposal-cinematic.png">
<!-- Structured data: SoftwareApplication + SoftwareSourceCode -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@graph": [
{
"@type": "SoftwareApplication",
"name": "GraphCompose",
"alternateName": "GraphCompose Java PDF engine",
"description": "Declarative Java PDF layout engine for structured business documents — CVs, invoices, proposals, reports. Compose ParagraphNode, TableNode, SectionNode, LayerStackNode; the engine handles measurement, pagination, fonts, and PDFBox rendering.",
"applicationCategory": "DeveloperApplication",
"applicationSubCategory": "Library",
"operatingSystem": "Cross-platform (JVM 21+)",
"programmingLanguage": "Java",
"softwareVersion": "1.6.6",
"url": "https://demchaav.github.io/GraphCompose/",
"downloadUrl": "https://central.sonatype.com/artifact/io.github.demchaav/graphcompose/1.6.6",
"image": "https://demchaav.github.io/GraphCompose/assets/logo/graphcompose-logo.png",
"license": "https://github.com/DemchaAV/GraphCompose/blob/main/LICENSE",
"author": {
"@type": "Person",
"name": "Artem Demchyshyn",
"url": "https://github.com/DemchaAV"
},
"offers": {
"@type": "Offer",
"price": "0",
"priceCurrency": "USD"
},
"keywords": "Java, PDF, layout engine, declarative, business documents, PDFBox, document generation",
"featureList": [
"Semantic node tree DSL (ParagraphNode, TableNode, SectionNode, LayerStackNode, CanvasLayerNode)",
"Atomic pagination with row-by-row table splitting",
"14 CV presets and 14 letter pairs out of the box",
"Theme tokens via BusinessTheme.modern() / classic() / executive()",
"Markdown-aware bodies (bold, italic) in every paragraph and list block",
"PDFBox-backed render pipeline plus a DOCX backend for editable output",
"819-test verify gate with layout snapshots and pixel-diff visual parity"
]
},
{
"@type": "SoftwareSourceCode",
"name": "GraphCompose",
"codeRepository": "https://github.com/DemchaAV/GraphCompose",
"programmingLanguage": "Java",
"runtimePlatform": "JVM 21+",
"license": "https://github.com/DemchaAV/GraphCompose/blob/main/LICENSE"
},
{
"@type": "ItemList",
"name": "GraphCompose showcase examples",
"description": "50+ runnable Java examples that produce real PDFs — CV templates, cover letters, invoices, proposals, schedules, plus every supported feature.",
"numberOfItems": 51,
"itemListElement": [
{
"@type": "ListItem",
"position": 1,
"name": "Cinematic Project Proposal",
"url": "https://demchaav.github.io/GraphCompose/showcase/pdf/templates/proposal/project-proposal-cinematic.pdf"
},
{
"@type": "ListItem",
"position": 2,
"name": "Cinematic Invoice",
"url": "https://demchaav.github.io/GraphCompose/showcase/pdf/templates/invoice/invoice-cinematic.pdf"
},
{
"@type": "ListItem",
"position": 3,
"name": "Modern Professional CV",
"url": "https://demchaav.github.io/GraphCompose/showcase/pdf/templates/cv/cv-modern-professional-v2.pdf"
},
{
"@type": "ListItem",
"position": 4,
"name": "Sidebar Portrait CV",
"url": "https://demchaav.github.io/GraphCompose/showcase/pdf/templates/cv/cv-sidebar-portrait-v2.pdf"
},
{
"@type": "ListItem",
"position": 5,
"name": "Monogram Sidebar CV",
"url": "https://demchaav.github.io/GraphCompose/showcase/pdf/templates/cv/cv-monogram-sidebar-v2.pdf"
},
{
"@type": "ListItem",
"position": 6,
"name": "Master Showcase (flagship)",
"url": "https://demchaav.github.io/GraphCompose/showcase/pdf/flagships/default/master-showcase.pdf"
},
{
"@type": "ListItem",
"position": 7,
"name": "Business Report (flagship)",
"url": "https://demchaav.github.io/GraphCompose/showcase/pdf/flagships/default/business-report.pdf"
}
]
}
]
}
</script>
</head>
<body>
<header class="site-header">
<a class="brand" href="#top" aria-label="GraphCompose home">
<img src="assets/logo/graphcompose-logo.png" alt="" width="40" height="40">
<span>GraphCompose</span>
</a>
<nav class="site-nav" aria-label="Primary navigation">
<a href="#showcase">Showcase</a>
<a href="#templates-section">Templates</a>
<a href="#features-section">Features</a>
<a href="#flagships-section">Flagships</a>
<a href="#install">Install</a>
<a href="https://github.com/DemchaAV/GraphCompose">GitHub</a>
<button id="theme-toggle" class="theme-toggle" type="button" aria-label="Switch between light and dark theme" title="Toggle theme">
<svg class="icon-moon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"></path></svg>
<svg class="icon-sun" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><circle cx="12" cy="12" r="5"></circle><path d="M12 1v2M12 21v2M4.22 4.22l1.42 1.42M18.36 18.36l1.42 1.42M1 12h2M21 12h2M4.22 19.78l1.42-1.42M18.36 5.64l1.42-1.42"></path></svg>
</button>
</nav>
</header>
<main id="top">
<section class="hero section-shell" aria-labelledby="hero-title">
<div class="hero-copy">
<p class="eyebrow">Java · v1.6.5 · 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 — 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>
<div class="hero-actions">
<a class="button button-primary" href="#showcase">Browse Examples</a>
<a class="button button-secondary" href="https://github.com/DemchaAV/GraphCompose">Source on GitHub</a>
<a class="button button-ghost" href="#install">Install in 30s</a>
</div>
</div>
<div class="hero-visual" aria-label="Generated PDF previews">
<div class="document-stack">
<img class="doc-preview doc-preview-main" src="showcase/screenshots/templates/proposal/project-proposal-cinematic.png" alt="Cinematic project proposal preview">
<img class="doc-preview doc-preview-side doc-preview-top" src="showcase/screenshots/templates/invoice/invoice-cinematic.png" alt="Cinematic invoice preview">
<img class="doc-preview doc-preview-side doc-preview-bottom" src="showcase/screenshots/templates/cv/cv-blue-banner-v2.png" alt="Blue Banner CV preview">
</div>
</div>
</section>
<section class="layered-callout section-shell" aria-labelledby="layered-title">
<div class="layered-card">
<span class="layered-badge">NEW</span>
<h2 id="layered-title">Building your own templates?</h2>
<p>The <strong>layered architecture</strong> guide walks you through the five-folder pattern — <code>data</code> / <code>theme</code> / <code>components</code> / <code>widgets</code> / <code>presets</code> — with a worked CV example, widget cookbook, and step-by-step contributor checklist. New templates and major rewrites follow this shape.</p>
<div class="layered-actions">
<a class="button button-primary" href="https://github.com/DemchaAV/GraphCompose/tree/develop/docs/templates/v2-layered">Quickstart (5 min)</a>
<a class="button button-secondary" href="https://github.com/DemchaAV/GraphCompose/blob/develop/docs/templates/v2-layered/authoring-presets.md">Author a preset</a>
<a class="button button-ghost" href="https://github.com/DemchaAV/GraphCompose/blob/develop/docs/templates/v2-layered/contributor-guide.md">Add a template family</a>
</div>
</div>
</section>
<section class="value-prop section-shell" aria-labelledby="value-title">
<div class="value-grid">
<div>
<h3>30 lines → one invoice</h3>
<p>The whole stack — theme tokens, table, totals, chrome — behind one fluent DSL.</p>
</div>
<div>
<h3>Atomic pagination</h3>
<p>Tables split row-by-row, rows are atomic, layer stacks atomic. No manual page math.</p>
</div>
<div>
<h3>14 CV presets, 14 letter pairs</h3>
<p>Every preset is one final class with a one-liner <code>create(BusinessTheme)</code> factory.</p>
</div>
<div>
<h3>Tested at every layer</h3>
<p>819 green tests, layout snapshots per preset, pixel-diff visual parity gate, public-API leak guards.</p>
</div>
</div>
</section>
<section class="section-shell" id="install" aria-labelledby="install-title">
<div class="section-heading">
<p class="section-label">Install</p>
<h2 id="install-title">Maven Central. One dependency.</h2>
</div>
<div class="install-blocks">
<div class="install-block">
<h4>Maven</h4>
<pre class="language-xml"><code class="language-xml"><dependency>
<groupId>io.github.demchaav</groupId>
<artifactId>graphcompose</artifactId>
<version>1.6.6</version>
</dependency></code></pre>
</div>
<div class="install-block">
<h4>Gradle</h4>
<pre class="language-groovy"><code class="language-groovy">dependencies {
implementation(
'io.github.demchaav:graphcompose:1.6.6'
)
}</code></pre>
</div>
<div class="install-block">
<h4>30-second hello world</h4>
<pre class="language-java"><code class="language-java">try (var doc = GraphCompose
.document(out).create()) {
doc.pageFlow()
.addParagraph("Hello, GraphCompose")
.addList(l -> l.items(
"PDF", "DOCX", "Tables"))
.build();
doc.buildPdf();
}</code></pre>
</div>
</div>
</section>
<section class="section-shell" id="showcase" aria-labelledby="showcase-title">
<div class="section-heading">
<p class="section-label">Showcase</p>
<h2 id="showcase-title">50+ generated PDFs you can inspect.</h2>
<p class="section-text">Every example below is a real, runnable Java file. Click the preview to open the rendered PDF, or jump straight into the source.</p>
</div>
<div class="showcase-controls" role="search">
<input type="search" id="showcase-search" placeholder="Search by title, tag, or keyword..." aria-label="Search showcase examples">
<div class="showcase-filters" id="showcase-filters" role="tablist" aria-label="Filter by category">
<button class="filter-pill is-active" data-category="all" type="button">All</button>
<button class="filter-pill" data-category="templates" type="button">Templates</button>
<button class="filter-pill" data-category="features" type="button">Features</button>
<button class="filter-pill" data-category="flagships" type="button">Flagships</button>
</div>
</div>
<div id="showcase-content" class="showcase-content" aria-live="polite">
<p class="showcase-loading">Loading examples...</p>
</div>
<noscript>
<div class="showcase-noscript">
<p><strong>JavaScript is disabled.</strong> The full searchable gallery requires JS. Below is a static index of the catalogue so you can still reach the rendered PDFs and source files.</p>
<h3 id="templates-section">Templates</h3>
<h4>CV (14 presets)</h4>
<ul>
<li><a href="showcase/pdf/templates/cv/cv-modern-professional-v2.pdf">Modern Professional CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-nordic-clean-v2.pdf">Nordic Clean CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-classic-serif-v2.pdf">Classic Serif CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-compact-mono-v2.pdf">Compact Mono CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-executive-v2.pdf">Executive CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-engineering-resume-v2.pdf">Engineering Resume CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-timeline-minimal-v2.pdf">Timeline Minimal CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-boxed-sections-v2.pdf">Boxed Sections CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-centered-headline-v2.pdf">Centered Headline CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-blue-banner-v2.pdf">Blue Banner CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-editorial-blue-v2.pdf">Editorial Blue CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-panel-v2.pdf">Panel CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-sidebar-portrait-v2.pdf">Sidebar Portrait CV</a></li>
<li><a href="showcase/pdf/templates/cv/cv-monogram-sidebar-v2.pdf">Monogram Sidebar CV</a></li>
</ul>
<h4>Cover Letter (14 paired layouts)</h4>
<ul>
<li><a href="showcase/pdf/templates/coverletter/cover-letter-modern-professional-v2.pdf">Cover Letter (canonical)</a></li>
<li><a href="showcase/pdf/templates/coverletter/cover-letter-modern-professional-v2.pdf">Modern Professional letter</a></li>
<li><a href="showcase/pdf/templates/coverletter/cover-letter-executive-v2.pdf">Executive letter</a></li>
<li><a href="showcase/pdf/templates/coverletter/cover-letter-monogram-sidebar-v2.pdf">Monogram Sidebar letter</a></li>
<li><a href="showcase/pdf/templates/coverletter/cover-letter-sidebar-portrait-v2.pdf">Sidebar Portrait letter</a></li>
</ul>
<h4>Invoice / Proposal / Schedule</h4>
<ul>
<li><a href="showcase/pdf/templates/invoice/invoice.pdf">Invoice (canonical)</a></li>
<li><a href="showcase/pdf/templates/invoice/invoice-cinematic.pdf">Cinematic Invoice</a></li>
<li><a href="showcase/pdf/templates/proposal/proposal.pdf">Proposal (canonical)</a></li>
<li><a href="showcase/pdf/templates/proposal/project-proposal-cinematic.pdf">Cinematic Project Proposal</a></li>
<li><a href="showcase/pdf/templates/schedule/weekly-schedule.pdf">Weekly Schedule</a></li>
</ul>
<h3 id="features-section">Features</h3>
<ul>
<li><a href="showcase/pdf/features/lists/nested-list-showcase.pdf">Nested List Showcase</a></li>
<li><a href="showcase/pdf/features/tables/composed-table-cell-showcase.pdf">Composed Table Cell Showcase</a></li>
<li><a href="showcase/pdf/features/tables/table-advanced.pdf">Advanced Tables</a></li>
<li><a href="showcase/pdf/features/canvas/canvas-layer-showcase.pdf">Canvas Layer Showcase</a></li>
<li><a href="showcase/pdf/features/shapes/shape-container.pdf">Shape Container</a></li>
<li><a href="showcase/pdf/features/transforms/transforms.pdf">Transforms</a></li>
<li><a href="showcase/pdf/features/text/rich-text-showcase.pdf">Rich Text Showcase</a></li>
<li><a href="showcase/pdf/features/text/section-presets.pdf">Section Presets</a></li>
<li><a href="showcase/pdf/features/themes/invoice-custom-theme.pdf">Invoice with Custom Theme</a></li>
<li><a href="showcase/pdf/features/chrome/pdf-chrome.pdf">PDF Chrome (header/footer)</a></li>
<li><a href="showcase/pdf/features/barcodes/barcode-showcase.pdf">Barcode Showcase</a></li>
<li><a href="showcase/pdf/features/streaming/invoice-http-stream.pdf">Invoice over HTTP Stream</a></li>
<li><a href="showcase/pdf/features/snapshots/invoice-snapshot-regression.pdf">Snapshot Regression Demo</a></li>
</ul>
<h3 id="flagships-section">Flagships</h3>
<ul>
<li><a href="showcase/pdf/flagships/default/master-showcase.pdf">Master Showcase</a></li>
<li><a href="showcase/pdf/flagships/default/business-report.pdf">Business Report</a></li>
<li><a href="showcase/pdf/flagships/default/module-first-profile.pdf">Module-first Profile</a></li>
</ul>
<p>Source for every example lives under <a href="https://github.com/DemchaAV/GraphCompose/tree/main/examples/src/main/java/com/demcha/examples"><code>examples/src/main/java/com/demcha/examples</code></a> on GitHub.</p>
</div>
</noscript>
</section>
<section class="architecture section-shell" id="architecture" aria-labelledby="architecture-title">
<div class="section-heading">
<p class="section-label">Architecture</p>
<h2 id="architecture-title">Author intent stays separate from PDF rendering.</h2>
</div>
<ol class="pipeline" aria-label="Document pipeline">
<li><strong>Semantic DSL.</strong> You build a tree of <code>ParagraphNode</code>, <code>TableNode</code>, <code>SectionNode</code>, <code>LayerStackNode</code>, <code>CanvasLayerNode</code>.</li>
<li><strong>Layout pass.</strong> The engine resolves measurements, pagination, decoration, overlays. Output is a <code>LayoutGraph</code> — geometry only, no draw calls.</li>
<li><strong>Render backend.</strong> The <code>FixedLayoutBackend</code> consumes placed fragments. Default: <code>PdfFixedLayoutBackend</code> via PDFBox. DOCX backend exists for editable output.</li>
</ol>
</section>
<section class="section-shell" aria-labelledby="why-title">
<div class="section-heading">
<p class="section-label">Why GraphCompose</p>
<h2 id="why-title">For services that produce structured PDFs at scale.</h2>
</div>
<div class="feature-grid">
<article class="feature-card">
<h3>Stream straight into HTTP responses</h3>
<p><code>session.writePdf(OutputStream)</code> writes incrementally with no in-memory buffering. Spring Boot, Quarkus, Micronaut, or plain Java HTTP.</p>
</article>
<article class="feature-card">
<h3>Snapshot-tested layouts</h3>
<p>Every preset has a layout-graph JSON baseline plus a pixel-diff visual parity baseline. Regressions surface on the first run.</p>
</article>
<article class="feature-card">
<h3>Theme tokens, not magic numbers</h3>
<p><code>BusinessTheme.modern()</code> / <code>.classic()</code> / <code>.executive()</code> set palette, typography, table styles. Override one or all.</p>
</article>
<article class="feature-card">
<h3>Markdown-aware bodies</h3>
<p>Inline <code>**bold**</code>, <code>*italic*</code>, <code>_italic_</code> markers parsed in every paragraph and list block automatically.</p>
</article>
</div>
</section>
</main>
<footer class="site-footer">
<p>GraphCompose — Java declarative PDF engine. <a href="https://github.com/DemchaAV/GraphCompose/blob/main/LICENSE">MIT-licensed</a>.</p>
<p>
<a href="https://github.com/DemchaAV/GraphCompose">GitHub</a> ·
<a href="https://github.com/DemchaAV/GraphCompose/blob/main/CHANGELOG.md">Changelog</a> ·
<a href="https://github.com/DemchaAV/GraphCompose/blob/main/docs/roadmaps/migration-v1-5-to-v1-6.md">v1.5 → v1.6 migration</a>
</p>
</footer>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-core.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-markup.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-clike.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-java.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-groovy.min.js"></script>
<script>
(function () {
var btn = document.getElementById('theme-toggle');
if (!btn) return;
btn.addEventListener('click', function () {
var light = document.documentElement.getAttribute('data-theme') === 'light';
if (light) {
document.documentElement.removeAttribute('data-theme');
try { localStorage.setItem('gc-theme', 'dark'); } catch (e) {}
} else {
document.documentElement.setAttribute('data-theme', 'light');
try { localStorage.setItem('gc-theme', 'light'); } catch (e) {}
}
});
})();
</script>
<script src="examples.js"></script>
</body>
</html>