File size: 12,831 Bytes
7366093
 
 
 
 
 
 
a93bba6
6c24d53
 
 
 
a93bba6
6c24d53
 
f1afeed
 
6c24d53
 
 
a93bba6
 
f1afeed
da19d47
f1afeed
 
 
 
da19d47
f1afeed
 
 
 
 
 
 
 
 
 
 
f480654
 
 
 
 
 
 
da19d47
 
daab465
120cf35
da19d47
 
daab465
 
f480654
da19d47
f480654
 
 
 
da19d47
 
f480654
f1afeed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
da19d47
f1afeed
96ab310
da19d47
 
e4c5b77
f480654
 
da19d47
 
 
 
 
 
f1afeed
e4c5b77
da19d47
6c24d53
 
 
 
 
 
a93bba6
 
6c24d53
 
 
 
 
 
f1afeed
6c24d53
a93bba6
6c24d53
 
 
 
 
 
f1afeed
6c24d53
a93bba6
6c24d53
 
 
 
 
 
f1afeed
6c24d53
 
 
 
 
 
 
 
f1afeed
6c24d53
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
a93bba6
6c24d53
 
 
 
 
 
a93bba6
 
 
6c24d53
 
 
 
a93bba6
6c24d53
 
 
 
 
 
 
 
 
 
 
 
 
a93bba6
 
6c24d53
 
 
 
a93bba6
6c24d53
 
 
 
 
 
 
 
 
a93bba6
 
 
 
 
6c24d53
 
 
 
a93bba6
 
 
6c24d53
 
a93bba6
6c24d53
a93bba6
 
 
6c24d53
 
 
a93bba6
 
6c24d53
 
a93bba6
 
6c24d53
 
 
 
a93bba6
 
6c24d53
 
 
 
a93bba6
 
 
6c24d53
a93bba6
 
 
6c24d53
 
a93bba6
 
da19d47
6c24d53
 
 
 
 
 
 
 
a93bba6
 
6c24d53
 
 
 
 
f1afeed
 
 
 
6c24d53
 
f1afeed
 
6c24d53
 
f1afeed
e4c5b77
 
 
f1afeed
 
 
 
 
da19d47
f1afeed
 
 
 
 
 
6c24d53
a93bba6
f1afeed
 
 
 
a93bba6
7366093
 
da19d47
f1afeed
da19d47
 
 
 
 
 
 
f1afeed
 
da19d47
 
 
 
 
 
 
 
 
f1afeed
7366093
 
f1afeed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
f480654
da19d47
f480654
da19d47
 
 
 
 
 
f480654
 
f1afeed
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7366093
 
 
 
 
 
 
 
 
 
 
f1afeed
 
 
 
7366093
f1afeed
 
7366093
 
 
 
 
 
 
 
a28557f
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>EU AI Act Open Source Guide</title>
    <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
    <style>
        * {
            box-sizing: border-box;
        }
        
        body {
            font-family: "Source Sans Pro", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            line-height: 1.75;
            margin: 0;
            padding: 0;
            color: #374151;
            background-color: #ffffff;
            font-size: 16px;
        }
        
        /* Layout container */
        .layout {
            display: flex;
            min-height: 100vh;
        }
        
        /* TOC Sidebar */
        .toc-sidebar {
            position: fixed;
            left: 0;
            top: 0;
            width: 280px;
            height: 100vh;
            background-color: #f9fafb;
            border-right: 1px solid #e5e7eb;
            padding: 24px 16px;
            overflow-y: auto;
            z-index: 100;
            transition: transform 0.3s ease;
        }
        
        .toc-sidebar.collapsed {
            transform: translateX(-240px);
        }
        
        .toc-toggle {
            position: absolute;
            top: 20px;
            right: -5px;
            width: 40px;
            height: 40px;
            background: #3b82f6;
            color: white;
            border: none;
            border-radius: 0 6px 6px 0;
            cursor: pointer;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 16px;
            z-index: 101;
            transition: all 0.3s ease;
        }
        
        .toc-sidebar h3 {
            margin: 0 0 16px 0;
            font-size: 1.125rem;
            font-weight: 600;
            color: #111827;
            border-bottom: 1px solid #e5e7eb;
            padding-bottom: 8px;
        }
        
        .toc-sidebar ul {
            list-style: none;
            margin: 0;
            padding: 0;
        }
        
        .toc-sidebar li {
            margin: 0;
            padding: 0;
        }
        
        .toc-sidebar a {
            display: block;
            padding: 6px 12px;
            color: #6b7280;
            text-decoration: none;
            font-size: 0.875rem;
            border-radius: 4px;
            transition: all 0.2s;
        }
        
        .toc-sidebar a:hover {
            background-color: #e5e7eb;
            color: #374151;
        }
        
        .toc-sidebar a.active {
            background-color: #dbeafe;
            color: #1d4ed8;
            font-weight: 500;
        }
        
        /* Nested TOC items */
        .toc-sidebar .toc-level-2 {
            padding-left: 16px;
        }
        
        .toc-sidebar .toc-level-3 {
            padding-left: 32px;
        }
        
        /* Main content area - always centered */
        .main-content {
            max-width: 1000px;
            margin: 0 auto;
            padding: 32px 48px;
            width: 100%;
        }
        
        /* Content wrapper */
        .content-wrapper {
            flex: 1;
            display: flex;
            justify-content: center;
            min-height: 100vh;
        }
        
        /* Typography - Hugging Face style */
        h1 {
            font-size: 2.25rem;
            font-weight: 700;
            line-height: 1.2;
            margin: 0 0 2rem 0;
            color: #111827;
        }
        
        h2 {
            font-size: 1.875rem;
            font-weight: 600;
            line-height: 1.3;
            margin: 3rem 0 1.5rem 0;
            color: #111827;
            scroll-margin-top: 20px;
        }
        
        h3 {
            font-size: 1.5rem;
            font-weight: 600;
            line-height: 1.4;
            margin: 2.5rem 0 1rem 0;
            color: #111827;
            scroll-margin-top: 20px;
        }
        
        h4 {
            font-size: 1.25rem;
            font-weight: 600;
            line-height: 1.5;
            margin: 2rem 0 1rem 0;
            color: #111827;
            scroll-margin-top: 20px;
        }
        
        h5, h6 {
            font-size: 1.125rem;
            font-weight: 600;
            line-height: 1.5;
            margin: 1.5rem 0 1rem 0;
            color: #111827;
            scroll-margin-top: 20px;
        }
        
        p {
            margin: 0 0 1.5rem 0;
            color: #374151;
        }
        
        strong {
            font-weight: 600;
            color: #111827;
        }
        
        em {
            font-style: italic;
        }
        
        a {
            color: #3b82f6;
            text-decoration: none;
            font-weight: 500;
        }
        
        a:hover {
            text-decoration: underline;
        }
        
        code {
            background-color: #f3f4f6;
            color: #374151;
            padding: 0.125rem 0.375rem;
            border-radius: 0.375rem;
            font-family: "SF Mono", Monaco, "Cascadia Code", "Roboto Mono", Consolas, "Courier New", monospace;
            font-size: 0.875em;
        }
        
        pre {
            background-color: #f9fafb;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            padding: 1.5rem;
            overflow-x: auto;
            margin: 1.5rem 0;
        }
        
        pre code {
            background: none;
            padding: 0;
            border-radius: 0;
            font-size: 0.875rem;
        }
        
        ul, ol {
            margin: 0 0 1.5rem 0;
            padding-left: 1.5rem;
        }
        
        li {
            margin: 0.5rem 0;
        }
        
        blockquote {
            border-left: 4px solid #e5e7eb;
            margin: 1.5rem 0;
            padding-left: 1.5rem;
            color: #6b7280;
            font-style: italic;
            word-wrap: break-word;
            overflow-wrap: break-word;
            white-space: normal;
            max-width: 100%;
        }
        
        table {
            border-collapse: collapse;
            width: 100%;
            margin: 1.5rem 0;
            border: 1px solid #e5e7eb;
            border-radius: 0.5rem;
            overflow: hidden;
        }
        
        th, td {
            border-bottom: 1px solid #e5e7eb;
            padding: 0.75rem 1rem;
            text-align: left;
            vertical-align: top;
        }
        
        th {
            background-color: #f9fafb;
            font-weight: 600;
            color: #374151;
        }
        
        tr:last-child td {
            border-bottom: none;
        }
        
        hr {
            border: none;
            border-top: 1px solid #e5e7eb;
            margin: 3rem 0;
        }
        
        img, iframe {
            max-width: 100%;
            height: auto;
            border-radius: 0.5rem;
        }
        
        iframe {
            border: 1px solid #e5e7eb;
        }
        
        input[type="checkbox"] {
            margin-right: 0.5rem;
            transform: scale(1.1);
        }
        
        /* Custom styled boxes */
        div[style*="border: 2px solid black"] {
            border: 1px solid #e5e7eb !important;
            border-radius: 0.75rem !important;
            background-color: #f9fafb !important;
            padding: 1.5rem !important;
            margin: 2rem 0 !important;
        }
        
        #loading {
            text-align: center;
            padding: 3rem;
            color: #6b7280;
            font-size: 1.125rem;
        }
        
        /* Mobile responsiveness */
        @media (max-width: 1024px) {
            .toc-sidebar {
                transform: translateX(-100%);
            }
            
            .toc-sidebar.open {
                transform: translateX(0);
            }
            
            .main-content {
                padding: 16px;
            }
            
            .mobile-toc-toggle {
                display: block;
                position: fixed;
                top: 16px;
                left: 16px;
                z-index: 102;
                background: #3b82f6;
                color: white;
                border: none;
                padding: 8px 12px;
                border-radius: 4px;
                cursor: pointer;
            }
        }
        
        .mobile-toc-toggle {
            display: none;
        }
    </style>
</head>
<body>
    <div class="layout">
        <!-- TOC Sidebar -->
        <aside class="toc-sidebar" id="toc-sidebar">
            <button class="toc-toggle" onclick="toggleTOC()" id="toc-toggle"></button>
            <h3>Table of Contents</h3>
            <div id="toc-content">
                <!-- TOC will be generated here -->
            </div>
        </aside>
        
        <!-- Mobile TOC Toggle -->
        <button class="mobile-toc-toggle" onclick="toggleMobileTOC()">☰ TOC</button>
        
        <!-- Main Content Wrapper -->
        <div class="content-wrapper">
            <main class="main-content">
                <div id="loading">Loading...</div>
                <div id="content"></div>
            </main>
        </div>
    </div>

    <script>
        function generateTOC(content) {
            const headings = content.querySelectorAll('h1, h2, h3, h4, h5, h6');
            const toc = document.getElementById('toc-content');
            
            let tocHTML = '<ul>';
            
            headings.forEach((heading, index) => {
                const level = parseInt(heading.tagName.charAt(1));
                const text = heading.textContent;
                const id = text.toLowerCase()
                    .replace(/[^\w\s-]/g, '')
                    .replace(/\s+/g, '-')
                    .replace(/-+/g, '-')
                    .replace(/^-|-$/g, '');
                
                heading.id = id;
                
                const tocClass = `toc-level-${level}`;
                tocHTML += `<li><a href="#${id}" class="${tocClass}" onclick="setActiveLink(this)">${text}</a></li>`;
            });
            
            tocHTML += '</ul>';
            toc.innerHTML = tocHTML;
        }
        
        function setActiveLink(clickedLink) {
            document.querySelectorAll('.toc-sidebar a').forEach(link => {
                link.classList.remove('active');
            });
            clickedLink.classList.add('active');
        }
        
        function toggleTOC() {
            const sidebar = document.getElementById('toc-sidebar');
            const btn = document.getElementById('toc-toggle');
            
            sidebar.classList.toggle('collapsed');
            btn.innerHTML = sidebar.classList.contains('collapsed') ? '▶' : '◀';
        }
        
        function toggleMobileTOC() {
            document.getElementById('toc-sidebar').classList.toggle('open');
        }
        
        function highlightCurrentSection() {
            const headings = document.querySelectorAll('h1, h2, h3, h4, h5, h6');
            const tocLinks = document.querySelectorAll('.toc-sidebar a');
            
            let current = '';
            headings.forEach(heading => {
                const rect = heading.getBoundingClientRect();
                if (rect.top <= 100) {
                    current = heading.id;
                }
            });
            
            tocLinks.forEach(link => {
                link.classList.remove('active');
                if (link.getAttribute('href') === `#${current}`) {
                    link.classList.add('active');
                }
            });
        }
        
        async function loadMarkdown() {
            try {
                const response = await fetch('eu-act-os-guideai.md');
                const markdown = await response.text();
                
                marked.setOptions({
                    breaks: true,
                    gfm: true
                });
                
                const html = marked.parse(markdown);
                const contentDiv = document.getElementById('content');
                contentDiv.innerHTML = html;
                
                generateTOC(contentDiv);
                document.getElementById('loading').style.display = 'none';
                window.addEventListener('scroll', highlightCurrentSection);
                
            } catch (error) {
                document.getElementById('loading').innerHTML = 'Error loading content: ' + error.message;
            }
        }

        loadMarkdown();
    </script>
</body>
</html>