-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
740 lines (650 loc) · 32.1 KB
/
Copy pathindex.html
File metadata and controls
740 lines (650 loc) · 32.1 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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
<!DOCTYPE html>
<html lang="pt-BR" data-theme="dark">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Fixed Width File Ecosystem — Documentação & Suíte de Conformidade</title>
<meta name="description" content="Ecossistema open-source para leitura, validação e manipulação de arquivos posicionais (Fixed Width File) em múltiplas linguagens." />
<meta property="og:title" content="Fixed Width File Ecosystem" />
<meta property="og:description" content="Bibliotecas padronizadas em Python, Java, JavaScript e PHP com suíte de testes de conformidade." />
<meta property="og:type" content="website" />
<!-- Fonts -->
<link href="https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&f[]=cabinet-grotesk@700,800&display=swap" rel="stylesheet" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@400;500;700&display=swap" rel="stylesheet" />
<!-- Lucide Icons -->
<script src="https://unpkg.com/lucide@latest" defer></script>
<style>
/* === DESIGN SYSTEM inspirada no padrão SUAP Suite === */
:root, [data-theme="light"] {
--text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
--text-sm: clamp(0.875rem, 0.8rem + 0.35vw, 1rem);
--text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
--text-lg: clamp(1.125rem, 1rem + 0.75vw, 1.35rem);
--text-xl: clamp(1.5rem, 1.2rem + 1.25vw, 2rem);
--text-2xl: clamp(2rem, 1.2rem + 2.5vw, 3rem);
--text-3xl: clamp(2.5rem, 1rem + 4vw, 4.5rem);
--space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
--space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
--space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
--space-16: 4rem; --space-20: 5rem; --space-24: 6rem;
--color-bg: #f8fafc;
--color-surface: #ffffff;
--color-surface-2: #f1f5f9;
--color-surface-offset: #e2e8f0;
--color-surface-dynamic: #cbd5e1;
--color-divider: #e2e8f0;
--color-border: #cbd5e1;
--color-text: #0f172a;
--color-text-muted: #475569;
--color-text-faint: #94a3b8;
--color-text-inverse: #f8fafc;
--color-primary: #059669;
--color-primary-hover: #047857;
--color-primary-active: #065f46;
--color-primary-highlight: #d1fae5;
--color-secondary: #2563eb;
--color-accent-purple: #7c3aed;
--color-accent-amber: #d97706;
--radius-sm: 0.375rem; --radius-md: 0.5rem;
--radius-lg: 0.75rem; --radius-xl: 1rem; --radius-full: 9999px;
--transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);
--shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.05);
--shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
--shadow-lg: 0 12px 32px rgba(15, 23, 42, 0.12);
--content-narrow: 640px; --content-default: 1040px; --content-wide: 1240px;
--font-display: 'Cabinet Grotesk', -apple-system, sans-serif;
--font-body: 'Satoshi', -apple-system, sans-serif;
--font-mono: 'JetBrains Mono', monospace;
}
[data-theme="dark"] {
--color-bg: #0b0f17;
--color-surface: #111827;
--color-surface-2: #1f2937;
--color-surface-offset: #1e293b;
--color-surface-dynamic: #334155;
--color-divider: #1e293b;
--color-border: #334155;
--color-text: #f8fafc;
--color-text-muted: #94a3b8;
--color-text-faint: #64748b;
--color-text-inverse: #0f172a;
--color-primary: #10b981;
--color-primary-hover: #059669;
--color-primary-active: #047857;
--color-primary-highlight: #064e3b;
--color-secondary: #3b82f6;
--color-accent-purple: #a855f7;
--color-accent-amber: #f59e0b;
--shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
--shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
--shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.6);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; scroll-behavior: smooth; scroll-padding-top: 80px; }
body { min-height: 100dvh; line-height: 1.6; font-family: var(--font-body); font-size: var(--text-base); color: var(--color-text); background-color: var(--color-bg); }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.15; font-family: var(--font-display); }
p, li { text-wrap: pretty; }
code, pre { font-family: var(--font-mono); }
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; transition: color var(--transition-interactive); }
/* Layout */
.container { max-width: var(--content-default); margin-inline: auto; padding-inline: var(--space-6); }
.container--wide { max-width: var(--content-wide); margin-inline: auto; padding-inline: var(--space-6); }
/* Navigation */
.nav {
position: sticky; top: 0; z-index: 100;
background: color-mix(in srgb, var(--color-bg) 85%, transparent);
backdrop-filter: blur(12px);
border-bottom: 1px solid var(--color-divider);
}
.nav__inner {
display: flex; align-items: center; justify-content: space-between;
height: 72px;
}
.nav__logo { display: flex; align-items: center; gap: var(--space-3); font-family: var(--font-display); font-size: var(--text-base); font-weight: 800; }
.nav__logo-badge {
width: 32px; height: 32px; border-radius: var(--radius-md);
background: var(--color-primary); color: #fff;
display: flex; align-items: center; justify-content: center; font-weight: 900;
}
.nav__links { display: flex; gap: var(--space-6); align-items: center; list-style: none; }
.nav__links a { font-size: var(--text-sm); color: var(--color-text-muted); font-weight: 600; }
.nav__links a:hover { color: var(--color-text); }
.nav__actions { display: flex; gap: var(--space-3); align-items: center; }
.btn-theme { display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: var(--radius-md); border: 1px solid var(--color-border); color: var(--color-text-muted); }
.btn-theme:hover { background: var(--color-surface-2); color: var(--color-text); }
.btn-gh {
display: inline-flex; align-items: center; gap: var(--space-2);
padding: var(--space-2) var(--space-4); border-radius: var(--radius-md);
background: var(--color-surface-2); border: 1px solid var(--color-border);
font-size: var(--text-sm); font-weight: 600; color: var(--color-text);
}
.btn-gh:hover { background: var(--color-surface-offset); }
/* Hero */
.hero {
padding-block: clamp(var(--space-12), 8vw, var(--space-20));
border-bottom: 1px solid var(--color-divider);
}
.hero__eyebrow {
display: inline-flex; align-items: center; gap: var(--space-2);
font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
color: var(--color-primary); margin-bottom: var(--space-4);
}
.hero__badge {
display: inline-block; padding: var(--space-1) var(--space-3);
background: var(--color-primary-highlight); color: var(--color-primary);
border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700;
}
.hero__title {
font-size: var(--text-3xl); font-weight: 800; letter-spacing: -0.02em;
line-height: 1.08; margin-bottom: var(--space-6); max-width: 20ch;
}
.hero__title em { font-style: normal; color: var(--color-primary); }
.hero__desc {
font-size: var(--text-lg); color: var(--color-text-muted);
max-width: 58ch; margin-bottom: var(--space-8); line-height: 1.6;
}
.hero__ctas { display: flex; gap: var(--space-3); flex-wrap: wrap; }
.btn-primary {
display: inline-flex; align-items: center; gap: var(--space-2);
padding: var(--space-3) var(--space-6); border-radius: var(--radius-md);
background: var(--color-primary); color: #fff;
font-size: var(--text-sm); font-weight: 700; box-shadow: var(--shadow-sm);
}
.btn-primary:hover { background: var(--color-primary-hover); box-shadow: var(--shadow-md); }
.btn-outline {
display: inline-flex; align-items: center; gap: var(--space-2);
padding: var(--space-3) var(--space-6); border-radius: var(--radius-md);
border: 1px solid var(--color-border); font-size: var(--text-sm);
font-weight: 600; color: var(--color-text); background: var(--color-surface);
}
.btn-outline:hover { background: var(--color-surface-2); }
/* Stats Bar */
.stats-bar {
background: var(--color-surface); border-bottom: 1px solid var(--color-divider);
padding-block: var(--space-6);
}
.stats-bar__inner { display: flex; gap: var(--space-12); flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: var(--space-1); }
.stat__value { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 800; color: var(--color-text); }
.stat__label { font-size: var(--text-xs); color: var(--color-text-muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; }
/* Section Styling */
.section { padding-block: clamp(var(--space-12), 6vw, var(--space-16)); border-bottom: 1px solid var(--color-divider); }
.section-header { margin-bottom: var(--space-10); }
.section-tag { font-size: var(--text-xs); font-weight: 700; color: var(--color-primary); text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: var(--space-2); display: block; }
.section-title { font-size: var(--text-2xl); font-weight: 800; margin-bottom: var(--space-3); }
.section-desc { font-size: var(--text-base); color: var(--color-text-muted); max-width: 60ch; }
/* Repositories Grid */
.repo-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: var(--space-6); }
.repo-card {
background: var(--color-surface); border: 1px solid var(--color-border);
border-radius: var(--radius-lg); padding: var(--space-6);
display: flex; flex-direction: column; justify-content: space-between;
transition: transform var(--transition-interactive), border-color var(--transition-interactive);
}
.repo-card:hover { transform: translateY(-3px); border-color: var(--color-primary); box-shadow: var(--shadow-md); }
.repo-card__header { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.repo-card__title { font-size: var(--text-lg); font-weight: 700; font-family: var(--font-mono); }
.tag { padding: var(--space-1) var(--space-3); border-radius: var(--radius-full); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; }
.tag-py { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }
.tag-java { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.tag-ts { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.tag-php { background: rgba(168, 85, 247, 0.15); color: #a855f7; }
.tag-spec { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.repo-card__desc { color: var(--text-muted); font-size: var(--text-sm); margin-bottom: var(--space-6); }
.repo-card__footer { display: flex; align-items: center; justify-content: space-between; font-size: var(--text-xs); color: var(--color-text-faint); }
.repo-card__link { display: inline-flex; align-items: center; gap: var(--space-1); font-weight: 700; color: var(--color-primary); font-size: var(--text-sm); }
/* Code Tabs Component */
.code-tabs { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-md); }
.code-tabs__nav { display: flex; background: var(--color-surface-2); border-bottom: 1px solid var(--color-border); }
.tab-btn { padding: var(--space-4) var(--space-6); font-size: var(--text-sm); font-weight: 700; color: var(--color-text-muted); border-bottom: 2px solid transparent; transition: all var(--transition-interactive); }
.tab-btn.active { color: var(--color-primary); border-bottom-color: var(--color-primary); background: var(--color-surface); }
.code-container { position: relative; padding: var(--space-6); background: #090d16; color: #e2e8f0; }
.code-container pre { margin: 0; font-size: 0.9rem; line-height: 1.6; overflow-x: auto; }
.copy-btn { position: absolute; top: var(--space-4); right: var(--space-4); background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: #cbd5e1; padding: var(--space-1) var(--space-3); border-radius: var(--radius-sm); font-size: var(--text-xs); font-weight: 600; }
.copy-btn:hover { background: rgba(255,255,255,0.2); color: #fff; }
/* Table */
.table-wrapper { overflow-x: auto; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); }
table { width: 100%; border-collapse: collapse; text-align: left; font-size: var(--text-sm); }
th { background: var(--color-surface-2); padding: var(--space-4) var(--space-6); font-weight: 700; color: var(--color-text-muted); border-bottom: 1px solid var(--color-border); }
td { padding: var(--space-4) var(--space-6); border-bottom: 1px solid var(--color-divider); }
tr:last-child td { border-bottom: none; }
/* Interactive Playground Component */
.playground { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-lg); padding: var(--space-6); }
.playground__grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); margin-top: var(--space-4); }
@media (max-width: 768px) { .playground__grid { grid-template-columns: 1fr; } }
.form-control { width: 100%; background: #090d16; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: var(--space-3); color: #f8fafc; font-family: var(--font-mono); font-size: 0.9rem; }
textarea.form-control { min-height: 140px; resize: vertical; }
/* Footer */
footer { padding-block: var(--space-12); background: var(--color-surface-2); border-top: 1px solid var(--color-divider); }
.footer__inner { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: var(--space-6); }
.footer__text { font-size: var(--text-sm); color: var(--color-text-muted); }
</style>
</head>
<body>
<!-- Navigation -->
<header class="nav">
<div class="container nav__inner">
<a href="#" class="nav__logo">
<div class="nav__logo-badge">F</div>
<span>Fixed Width File</span>
</a>
<nav>
<ul class="nav__links">
<li><a href="#repositorios">Repositórios</a></li>
<li><a href="#conformidade">Conformidade</a></li>
<li><a href="#exemplos">Exemplos</a></li>
<li><a href="#playground">Playground</a></li>
</ul>
</nav>
<div class="nav__actions">
<button id="theme-toggle" class="btn-theme" title="Alternar tema">
<i data-lucide="moon"></i>
</button>
<a href="https://github.com/fixed-width-file" target="_blank" class="btn-gh">
<i data-lucide="github"></i>
<span>GitHub</span>
</a>
</div>
</div>
</header>
<!-- Hero Section -->
<section class="hero">
<div class="container">
<div class="hero__eyebrow">
<i data-lucide="shield-check" style="width:16px;height:16px;"></i>
<span>Ecossistema Multi-Linguagem</span>
<span class="hero__badge">v1.0.0 Released</span>
</div>
<h1 class="hero__title">
Processamento de Arquivos Posicionais <em>Padronizado & Confiável</em>
</h1>
<p class="hero__desc">
Bibliotecas open source para leitura, validação e geração de arquivos de largura fixa (Fixed Width File) em Python, Java, JavaScript e PHP com descritores orientados a objetos e suíte de testes de conformidade.
</p>
<div class="hero__ctas">
<a href="#playground" class="btn-primary">
<i data-lucide="play" style="width:16px;height:16px;"></i>
<span>Simulador Interativo</span>
</a>
<a href="#conformidade" class="btn-outline">
<i data-lucide="file-check" style="width:16px;height:16px;"></i>
<span>Suíte de Conformidade v1.0.0</span>
</a>
</div>
</div>
</section>
<!-- Stats Bar -->
<div class="stats-bar">
<div class="container stats-bar__inner">
<div class="stat">
<span class="stat__value">5</span>
<span class="stat__label">Repositórios</span>
</div>
<div class="stat">
<span class="stat__value">4</span>
<span class="stat__label">Linguagens</span>
</div>
<div class="stat">
<span class="stat__value">100%</span>
<span class="stat__label">Test Coverage</span>
</div>
<div class="stat">
<span class="stat__value">v1.0.0</span>
<span class="stat__label">Compliance Standard</span>
</div>
</div>
</div>
<!-- Repositories Grid Section -->
<section id="repositorios" class="section">
<div class="container">
<div class="section-header">
<span class="section-tag">Repositórios Oficiais</span>
<h2 class="section-title">Ecossistema de Bibliotecas FWF</h2>
<p class="section-desc">Conheça as implementações oficiais mantidas sob a organização <code>fixed-width-file</code>.</p>
</div>
<div class="repo-grid">
<!-- python-pyfwf -->
<div class="repo-card">
<div>
<div class="repo-card__header">
<span class="repo-card__title">python-pyfwf</span>
<span class="tag tag-py">Python</span>
</div>
<p class="repo-card__desc">Biblioteca de referência em Python para leitura e geração de arquivos posicionais com colunas tipadas e descritores OO.</p>
</div>
<div class="repo-card__footer">
<span>v1.0.0 • Compliant</span>
<a href="https://fixed-width-file.github.io/python-pyfwf/" target="_blank" class="repo-card__link">
<span>Veja mais</span>
<i data-lucide="arrow-right" style="width:16px;height:16px;"></i>
</a>
</div>
</div>
<!-- java-fwf -->
<div class="repo-card">
<div>
<div class="repo-card__header">
<span class="repo-card__title">java-fwf</span>
<span class="tag tag-java">Java</span>
</div>
<p class="repo-card__desc">Biblioteca em Java para leitura e gravação de arquivos posicionais e integração com JUnit 5 e suíte compliance.</p>
</div>
<div class="repo-card__footer">
<span>Java 17+</span>
<a href="https://fixed-width-file.github.io/java-fwf" target="_blank" class="repo-card__link">
<span>Veja mais</span>
<i data-lucide="arrow-right" style="width:16px;height:16px;"></i>
</a>
</div>
</div>
<!-- javascript-fwf -->
<div class="repo-card">
<div>
<div class="repo-card__header">
<span class="repo-card__title">javascript-fwf</span>
<span class="tag tag-ts">TypeScript</span>
</div>
<p class="repo-card__desc">Implementação em TypeScript/Node.js para manipulação de arquivos posicionais com tipagem estática.</p>
</div>
<div class="repo-card__footer">
<span>Node / Browser</span>
<a href="https://fixed-width-file.github.io/javascript-fwf" target="_blank" class="repo-card__link">
<span>Veja mais</span>
<i data-lucide="arrow-right" style="width:16px;height:16px;"></i>
</a>
</div>
</div>
<!-- php-fwf -->
<div class="repo-card">
<div>
<div class="repo-card__header">
<span class="repo-card__title">php-fwf</span>
<span class="tag tag-php">PHP</span>
</div>
<p class="repo-card__desc">Biblioteca em PHP 8.x para parsing de arquivos FWF, integração via Composer e testes via PHPUnit.</p>
</div>
<div class="repo-card__footer">
<span>PHP 8.1+</span>
<a href="https://fixed-width-file.github.io/php-fwf" target="_blank" class="repo-card__link">
<span>Veja mais</span>
<i data-lucide="arrow-right" style="width:16px;height:16px;"></i>
</a>
</div>
</div>
</div>
</div>
</section>
<!-- Compliance Section -->
<section id="conformidade" class="section">
<div class="container">
<div class="section-header">
<span class="section-tag">Padrão Único</span>
<h2 class="section-title">Suíte de Testes de Conformidade (v1.0.0)</h2>
<p class="section-desc">Garantia de que qualquer parser em qualquer linguagem retorne exatamente o mesmo resultado estruturado.</p>
</div>
<div class="table-wrapper">
<table>
<thead>
<tr>
<th>ID do Caso</th>
<th>Categoria</th>
<th>Descrição do Teste</th>
</tr>
</thead>
<tbody>
<tr>
<td><code>simple</code></td>
<td><span class="tag tag-py">basic</span></td>
<td>Arquivo ASCII simples com 1 descritor de detalhe e colunas texto e inteiro.</td>
</tr>
<tr>
<td><code>utf8</code></td>
<td><span class="tag tag-spec">encoding</span></td>
<td>Suporte a caracteres multibyte UTF-8 com acentuação em português.</td>
</tr>
<tr>
<td><code>typed_columns</code></td>
<td><span class="tag tag-ts">types</span></td>
<td>Colunas tipadas: Char, RightChar, Integer, Decimal, Date, Time, DateTime e nulos.</td>
</tr>
<tr>
<td><code>header_footer</code></td>
<td><span class="tag tag-java">structure</span></td>
<td>Arquivo com linhas de Cabeçalho (Header), Detalhes (Detail) e Rodapé (Footer).</td>
</tr>
<tr>
<td><code>padding_and_spaces</code></td>
<td><span class="tag tag-php">edge_cases</span></td>
<td>Casos de borda: alinhamentos, espaços em branco e campos vazios.</td>
</tr>
</tbody>
</table>
</div>
<div class="section-header">
<br/>
<h2 class="section-title">Repositório de conformidade</h2>
<p class="section-desc">Todas as bibliotecas são 100% aderentes ao padrão presente na suíte de conformidade.</p>
</div>
<div class="repo-grid">
<!-- fwf-compliance-tests -->
<div class="repo-card">
<div>
<div class="repo-card__header">
<span class="repo-card__title">fwf-compliance-tests</span>
<span class="tag tag-spec">Suíte de conformidade</span>
</div>
<p class="repo-card__desc">Suíte de conformidade agnóstica de linguagem em formato JSON/FWF para validar novos parsers.</p>
</div>
<div class="repo-card__footer">
<span>Release v1.0.0</span>
<a href="https://fixed-width-file.github.io/fwf-compliance-tests" target="_blank" class="repo-card__link">
<span>Veja mais</span>
<i data-lucide="arrow-right" style="width:16px;height:16px;"></i>
</a>
</div>
</div>
</div>
</div>
</section>
<!-- Code Examples Section -->
<section id="exemplos" class="section">
<div class="container">
<div class="section-header">
<span class="section-tag">Sintaxe Consistente</span>
<h2 class="section-title">Exemplos de Código</h2>
<p class="section-desc">API uniforme orientada a objetos para criar descritores e ler arquivos posicionais.</p>
</div>
<div class="code-tabs">
<div class="code-tabs__nav">
<button class="tab-btn active" onclick="switchTab('python')">Python (pyfwf)</button>
<button class="tab-btn" onclick="switchTab('typescript')">TypeScript</button>
<button class="tab-btn" onclick="switchTab('java')">Java</button>
<button class="tab-btn" onclick="switchTab('php')">PHP</button>
</div>
<div class="code-container">
<button class="copy-btn" onclick="copyCode()">Copiar</button>
<pre id="code-block"><code>from pyfwf.columns import CharColumn, PositiveIntegerColumn, PositiveDecimalColumn
from pyfwf.descriptors import DetailRowDescriptor, FileDescriptor
from pyfwf.readers import Reader
# Define os campos do detalhe
detail = DetailRowDescriptor([
CharColumn(name="nome", size=20),
PositiveIntegerColumn(name="idade", size=3),
PositiveDecimalColumn(name="saldo", size=9, decimals=2)
])
# Cria o descritor de arquivo
fd = FileDescriptor(details=[detail])
# Lê o arquivo FWF
reader = Reader(conteudo_fwf, fd)
for row in reader:
print(row)
# Output: {'nome': 'KELSON MEDEIROS', 'idade': 45, 'saldo': 1250.50}</code></pre>
</div>
</div>
</div>
</section>
<!-- Interactive Live Playground Section -->
<section id="playground" class="section">
<div class="container">
<div class="section-header">
<span class="section-tag">Simulador</span>
<h2 class="section-title">Playground FWF em Tempo Real</h2>
<p class="section-desc">Digite ou cole um arquivo posicional para ver o parsing dinâmico dos campos em JSON.</p>
</div>
<div class="playground">
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; flex-wrap: wrap; gap: 12px;">
<h3 style="font-size: 1.1rem; font-weight: 700;">Parser Posicional</h3>
<select id="preset-select" class="form-control" style="width: auto; padding: 6px 16px;" onchange="updatePreset()">
<option value="simple">Preset: Exemplo Simples (Nome + Idade)</option>
<option value="typed">Preset: Exemplo Tipado (Nome + CPF + Decimal)</option>
</select>
</div>
<div class="playground__grid">
<div>
<label style="font-size: 0.8rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; margin-bottom: 6px; display: block;">Entrada Posicional (FWF)</label>
<textarea id="playground-input" class="form-control" oninput="runPlayground()" spellcheck="false"></textarea>
</div>
<div>
<label style="font-size: 0.8rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; margin-bottom: 6px; display: block;">Resultado Estruturado (JSON)</label>
<div id="playground-output" style="background:#090d16; border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; font-family: var(--font-mono); min-height: 140px; font-size: 0.85rem;"></div>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer>
<div class="container footer__inner">
<div style="display: flex; align-items: center; gap: 12px;">
<div class="nav__logo-badge">F</div>
<span class="footer__text">Fixed Width File Ecosystem • Licença MIT</span>
</div>
<div class="footer__text">
<a href="https://github.com/fixed-width-file" target="_blank" style="text-decoration: underline;">Organização no GitHub</a>
</div>
</div>
</footer>
<script>
// Theme Toggle Logic
const themeBtn = document.getElementById('theme-toggle');
const htmlEl = document.documentElement;
themeBtn.addEventListener('click', () => {
const current = htmlEl.getAttribute('data-theme');
const next = current === 'dark' ? 'light' : 'dark';
htmlEl.setAttribute('data-theme', next);
themeBtn.innerHTML = next === 'dark' ? '<i data-lucide="sun"></i>' : '<i data-lucide="moon"></i>';
lucide.createIcons();
});
// Code Snippets Data
const snippets = {
python: `from pyfwf.columns import CharColumn, PositiveIntegerColumn, PositiveDecimalColumn
from pyfwf.descriptors import DetailRowDescriptor, FileDescriptor
from pyfwf.readers import Reader
# Define os campos do detalhe
detail = DetailRowDescriptor([
CharColumn(name="nome", size=20),
PositiveIntegerColumn(name="idade", size=3),
PositiveDecimalColumn(name="saldo", size=9, decimals=2)
])
# Cria o descritor de arquivo
fd = FileDescriptor(details=[detail])
# Lê o arquivo FWF
reader = Reader(conteudo_fwf, fd)
for row in reader:
print(row)`,
typescript: `import { FileDescriptor, DetailRowDescriptor, CharColumn, PositiveIntegerColumn } from 'javascript-fwf';
const detail = new DetailRowDescriptor([
new CharColumn('nome', 20),
new PositiveIntegerColumn('idade', 3)
]);
const fd = new FileDescriptor({ details: [detail] });
const reader = fd.createReader(fwfContent);
for (const row of reader) {
console.log(row);
}`,
java: `import com.kelsoncm.libs.fwf.*;
DetailRowDescriptor detail = new DetailRowDescriptor(
new CharColumn("nome", 20),
new PositiveIntegerColumn("idade", 3)
);
FileDescriptor fd = new FileDescriptor(detail);
Reader reader = new Reader(fwfContent, fd);
while (reader.hasNext()) {
Row row = reader.next();
System.out.println(row);
}`,
php: `use Fwf\\Columns\\CharColumn;
use Fwf\\Columns\\PositiveIntegerColumn;
use Fwf\\Descriptors\\DetailRowDescriptor;
use Fwf\\Descriptors\\FileDescriptor;
use Fwf\\Reader;
$detail = new DetailRowDescriptor([
new CharColumn('nome', 20),
new PositiveIntegerColumn('idade', 3)
]);
$fd = new FileDescriptor([$detail]);
$reader = new Reader($fwfContent, $fd);
foreach ($reader as $row) {
var_dump($row);
}`
};
function switchTab(lang) {
document.querySelectorAll('.tab-btn').forEach(btn => btn.classList.remove('active'));
event.target.classList.add('active');
document.getElementById('code-block').textContent = snippets[lang];
}
function copyCode() {
const code = document.getElementById('code-block').textContent;
navigator.clipboard.writeText(code);
alert('Código copiado para a área de transferência!');
}
// Playground Logic
const presets = {
simple: {
fwf: "KELSON MEDEIROS 045\nMARIA SILVA 030",
fields: [{ name: "nome", size: 20 }, { name: "idade", size: 3, type: "int" }]
},
typed: {
fwf: "JOÃO SILVA 1234567890250020260720\nMARIA SANTOS 9876543211507520260720",
fields: [{ name: "nome", size: 20 }, { name: "cpf", size: 9, type: "int" }, { name: "valor", size: 5, type: "decimal" }]
}
};
function updatePreset() {
const sel = document.getElementById('preset-select').value;
document.getElementById('playground-input').value = presets[sel].fwf;
runPlayground();
}
function runPlayground() {
const input = document.getElementById('playground-input').value;
const sel = document.getElementById('preset-select').value;
const fields = presets[sel].fields;
const lines = input.split('\n').filter(l => l.trim().length > 0);
let parsed = [];
lines.forEach(line => {
let row = {};
let cursor = 0;
fields.forEach(f => {
let raw = line.substring(cursor, cursor + f.size);
cursor += f.size;
if (f.type === 'int') {
row[f.name] = parseInt(raw, 10) || 0;
} else if (f.type === 'decimal') {
row[f.name] = ((parseInt(raw, 10) || 0) / 100).toFixed(2);
} else {
row[f.name] = raw.trim();
}
});
parsed.push(row);
});
document.getElementById('playground-output').textContent = JSON.stringify(parsed, null, 2);
}
document.addEventListener('DOMContentLoaded', () => {
lucide.createIcons();
updatePreset();
});
</script>
</body>
</html>