-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.html
More file actions
596 lines (564 loc) · 22.3 KB
/
Copy pathindex.html
File metadata and controls
596 lines (564 loc) · 22.3 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Solana Protocol Design for Agent and MCP Server Registries</title>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script src="https://cdn.tailwindcss.com"></script>
<style>
body {
font-family: 'Courier New', Courier, monospace; /* Monospace font */
background-color: #FFFFFF;
color: #262626; /* Neutral-800 */
scroll-behavior: smooth;
font-size: 16px; /* Base font size for monospace for readability */
}
.main-container {
max-width: 1200px;
margin: 0 auto;
padding: 0 1.5rem; /* 24px */
}
.nav-link {
color: #E5E5E5; /* Neutral-200 */
transition: color 0.3s ease, background-color 0.3s ease;
padding: 0.25rem 0.5rem; /* Reduced padding */
border-radius: 0; /* Sharp corners for 90s look */
font-weight: normal; /* Monospace handles weight differently */
border: 1px solid #404040; /* Border for nav links */
display: inline-block;
margin-bottom: 0.125rem; /* Reduced margin */
margin-right: 0.125rem; /* Reduced margin */
font-size: 0.875rem; /* Slightly smaller font */
text-decoration: none; /* Ensure no underline */
}
.nav-link:hover {
background-color: #737373; /* Neutral-500 */
color: #FFFFFF;
border-color: #737373;
}
.nav-link.active {
background-color: #404040; /* Neutral-700 */
color: #FFFFFF;
font-weight: bold; /* Monospace can use bold */
border-color: #404040;
}
.section-title {
color: #171717; /* Neutral-900 */
border-bottom: 2px solid #525252; /* Neutral-600 */
padding-bottom: 0.75rem; /* 12px */
font-size: 1.75rem; /* Adjusted for monospace */
font-weight: bold;
text-transform: uppercase; /* 90s style */
}
.subsection-title {
color: #262626; /* Neutral-800 */
font-size: 1.15rem; /* Adjusted for monospace */
font-weight: bold;
margin-top: 1.5rem; /* mt-6 */
margin-bottom: 0.75rem; /* mb-3 */
}
.header-bg {
background-color: #404040; /* Neutral-700 */
border-bottom: 2px solid #171717; /* Neutral-900 */
}
.footer-bg {
background-color: #404040; /* Neutral-700 */
border-top: 2px solid #171717; /* Neutral-900 */
}
.footer-text {
color: #D4D4D4; /* Neutral-300 */
}
/* Book-specific styling */
.book-container {
display: flex;
min-height: calc(100vh - 120px); /* Adjust based on header/footer height */
}
.book-sidebar {
width: 250px;
background-color: #F5F5F5;
border-right: 1px solid #A3A3A3;
padding: 1rem;
overflow-y: auto;
position: sticky;
top: 60px; /* Match header height */
height: calc(100vh - 120px); /* Adjust based on header/footer height */
}
.book-content {
flex: 1;
padding: 1.5rem;
overflow-y: auto;
}
.chapter-link {
display: block;
padding: 0.5rem;
margin-bottom: 0.25rem;
border: 1px solid #A3A3A3;
background-color: #E5E5E5;
color: #262626;
text-decoration: none;
font-size: 0.9rem;
cursor: pointer;
}
.chapter-link:hover {
background-color: #D4D4D4;
}
.chapter-link.active {
background-color: #A3A3A3;
font-weight: bold;
}
/* Markdown styling */
.markdown-content h1 {
font-size: 1.75rem;
font-weight: bold;
margin-bottom: 1.5rem;
color: #171717;
border-bottom: 2px solid #525252;
padding-bottom: 0.5rem;
}
.markdown-content h2 {
font-size: 1.5rem;
font-weight: bold;
margin-top: 2rem;
margin-bottom: 1rem;
color: #262626;
}
.markdown-content h3 {
font-size: 1.25rem;
font-weight: bold;
margin-top: 1.5rem;
margin-bottom: 0.75rem;
color: #404040;
}
.markdown-content h4 {
font-size: 1.1rem;
font-weight: bold;
margin-top: 1.25rem;
margin-bottom: 0.5rem;
color: #525252;
}
.markdown-content p {
margin-bottom: 1rem;
line-height: 1.6;
}
.markdown-content pre {
background-color: #F5F5F5;
border: 1px solid #A3A3A3;
padding: 1rem;
margin-bottom: 1rem;
overflow-x: auto;
font-size: 0.9rem;
}
.markdown-content code {
font-family: 'Courier New', Courier, monospace;
background-color: #E5E5E5;
padding: 0.1rem 0.25rem;
border: 1px solid #A3A3A3;
font-size: 0.9em;
}
.markdown-content ul, .markdown-content ol {
margin-bottom: 1rem;
padding-left: 2rem;
}
.markdown-content li {
margin-bottom: 0.5rem;
}
.markdown-content blockquote {
border-left: 4px solid #A3A3A3;
padding-left: 1rem;
margin-left: 0;
margin-right: 0;
margin-bottom: 1rem;
color: #525252;
}
.markdown-content table {
width: 100%;
border-collapse: collapse;
margin-bottom: 1rem;
}
.markdown-content th, .markdown-content td {
border: 1px solid #A3A3A3;
padding: 0.5rem;
}
.markdown-content th {
background-color: #E5E5E5;
font-weight: bold;
}
.book-navigation {
display: flex;
justify-content: space-between;
margin-top: 2rem;
padding-top: 1rem;
border-top: 1px solid #A3A3A3;
}
.book-navigation a {
padding: 0.5rem 1rem;
background-color: #E5E5E5;
border: 1px solid #A3A3A3;
color: #262626;
text-decoration: none;
cursor: pointer;
}
.book-navigation a:hover {
background-color: #D4D4D4;
}
.mobile-menu-button, .mobile-sidebar-button {
display: none;
}
/* ASCII diagram styling */
.ascii-diagram {
font-family: 'Courier New', Courier, monospace;
white-space: pre;
line-height: 1.2;
background-color: #F5F5F5;
padding: 1rem;
border: 1px solid #A3A3A3;
overflow-x: auto;
font-size: 0.85rem;
}
/* Loading indicator */
.loading-indicator {
display: flex;
justify-content: center;
align-items: center;
height: 200px;
}
.loading-spinner {
border: 4px solid #E5E5E5;
border-top: 4px solid #404040;
border-radius: 50%;
width: 40px;
height: 40px;
animation: spin 1s linear infinite;
}
@keyframes spin {
0% { transform: rotate(0deg); }
100% { transform: rotate(360deg); }
}
/* Error message */
.error-message {
padding: 1rem;
background-color: #FEE2E2;
border: 1px solid #EF4444;
color: #B91C1C;
margin-bottom: 1rem;
}
/* Responsive design */
@media (max-width: 768px) {
.book-container {
flex-direction: column;
}
.book-sidebar {
width: 100%;
height: auto;
position: relative;
top: 0;
display: none;
border-right: none;
border-bottom: 1px solid #A3A3A3;
max-height: 300px;
}
.book-sidebar.active {
display: block;
}
.mobile-menu-button, .mobile-sidebar-button {
display: block;
background-color: #404040;
color: #E5E5E5;
border: 1px solid #737373;
padding: 0.5rem;
margin-bottom: 1rem;
cursor: pointer;
text-align: center;
width: 100%;
}
.nav-container {
width: 100%;
}
.nav-links {
display: none;
width: 100%;
flex-wrap: wrap;
justify-content: center;
}
.nav-links.active {
display: flex;
}
.book-content {
padding: 1rem;
}
.markdown-content h1 {
font-size: 1.5rem;
}
.markdown-content h2 {
font-size: 1.3rem;
}
.markdown-content h3 {
font-size: 1.15rem;
}
.markdown-content h4 {
font-size: 1rem;
}
.ascii-diagram {
font-size: 0.7rem;
}
}
/* Print styles */
@media print {
.header-bg, .footer-bg, .book-sidebar, .mobile-sidebar-button, .book-navigation {
display: none !important;
}
.book-container {
display: block;
}
.book-content {
padding: 0;
}
.main-container {
max-width: 100%;
padding: 0;
}
}
</style>
</head>
<body class="antialiased">
<header class="header-bg text-white sticky top-0 z-50">
<nav class="main-container py-1">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="flex justify-between items-center w-full md:w-auto">
<a href="#" class="text-lg font-bold text-white hover:text-neutral-300 transition-colors">Solana AI Registries Initiative</a>
<button type="button" class="mobile-menu-button md:hidden" onclick="toggleMenu()">
Menu ☰
</button>
</div>
<div class="nav-container mt-1 md:mt-0">
<div id="main-nav" class="nav-links flex flex-wrap md:flex-nowrap justify-center md:justify-end">
<a href="#" class="nav-link active">Research Book</a>
<a href="#" class="nav-link" onclick="downloadPDF()">Download PDF</a>
<a href="#" class="nav-link" onclick="window.print()">Print</a>
</div>
</div>
</div>
</nav>
</header>
<div class="main-container">
<h1 class="section-title my-6">Solana Protocol Design for Agent and MCP Server Registries</h1>
<button type="button" class="mobile-sidebar-button" onclick="toggleSidebar()">
Toggle Table of Contents ☰
</button>
<div class="book-container">
<aside id="book-sidebar" class="book-sidebar">
<h2 class="font-bold text-lg mb-4 border-b border-neutral-400 pb-2">Table of Contents</h2>
<div id="chapter-links">
<a class="chapter-link" onclick="loadChapter(1)">Chapter 1: Introduction</a>
<a class="chapter-link" onclick="loadChapter(2)">Chapter 2: Foundational Solana Concepts</a>
<a class="chapter-link" onclick="loadChapter(3)">Chapter 3: Agent Registry Protocol Design</a>
<a class="chapter-link" onclick="loadChapter(4)">Chapter 4: MCP Server Registry Protocol Design</a>
<a class="chapter-link" onclick="loadChapter(5)">Chapter 5: Discovery and Querying Mechanisms</a>
<a class="chapter-link" onclick="loadChapter(6)">Chapter 6: Implementation Guide</a>
<a class="chapter-link" onclick="loadChapter(7)">Chapter 7: Security Considerations</a>
<a class="chapter-link" onclick="loadChapter(8)">Chapter 8: Performance Optimization</a>
<a class="chapter-link" onclick="loadChapter(9)">Chapter 9: Deployment and Maintenance</a>
<a class="chapter-link" onclick="loadChapter(10)">Chapter 10: Case Studies and Examples</a>
<a class="chapter-link" onclick="loadChapter(11)">Chapter 11: Future Directions</a>
<a class="chapter-link" onclick="loadChapter(12)">Chapter 12: Conclusion</a>
<a class="chapter-link" onclick="loadChapter(13)">Chapter 13: References</a>
<a class="chapter-link" onclick="loadChapter(14)">Chapter 14: Appendices</a>
</div>
</aside>
<main id="book-content" class="book-content">
<div id="markdown-content" class="markdown-content">
<!-- Markdown content will be loaded here -->
<div class="loading-indicator">
<div class="loading-spinner"></div>
</div>
</div>
<div id="navigation-controls" class="book-navigation">
<!-- Navigation controls will be added here -->
</div>
</main>
</div>
</div>
<footer class="footer-bg py-6 mt-8">
<div class="main-container">
<div class="flex flex-col md:flex-row justify-between items-center">
<div class="mb-4 md:mb-0">
<p class="footer-text">© 2025 Solana AI Registries Initiative</p>
</div>
<div>
<a href="#" class="footer-text hover:text-white mr-4">Privacy Policy</a>
<a href="#" class="footer-text hover:text-white">Contact</a>
</div>
</div>
</div>
</footer>
<script>
// Chapter file mapping
const chapterFiles = {
1: 'research_draft_part1.md',
2: 'research_draft_part2.md',
3: 'research_draft_part3.md',
4: 'research_draft_part4.md',
5: 'research_draft_part5.md',
6: 'research_draft_part6.md',
7: 'research_draft_part7.md',
8: 'research_draft_part8.md',
9: 'research_draft_part9.md',
10: 'research_draft_part10.md',
11: 'research_draft_part11.md',
12: 'research_draft_part12.md',
13: 'research_draft_part13.md',
14: 'research_draft_part14.md'
};
// Current chapter
let currentChapter = 1;
// Toggle main navigation menu
function toggleMenu() {
const navLinks = document.getElementById('main-nav');
if (navLinks) {
navLinks.classList.toggle('active');
}
}
// Toggle sidebar for mobile
function toggleSidebar() {
const sidebar = document.getElementById('book-sidebar');
if (sidebar) {
sidebar.classList.toggle('active');
}
}
// Load chapter content
async function loadChapter(chapterNum) {
try {
currentChapter = chapterNum;
// Update active chapter link
const chapterLinks = document.querySelectorAll('.chapter-link');
chapterLinks.forEach((link, index) => {
if (index + 1 === chapterNum) {
link.classList.add('active');
} else {
link.classList.remove('active');
}
});
// Show loading indicator
document.getElementById('markdown-content').innerHTML = '<div class="loading-indicator"><div class="loading-spinner"></div></div>';
// Load chapter content
const response = await fetch(chapterFiles[chapterNum]);
if (!response.ok) {
throw new Error(`Failed to load chapter ${chapterNum}`);
}
const content = await response.text();
// Render markdown content
document.getElementById('markdown-content').innerHTML = marked.parse(content);
// Add navigation buttons
addNavigation(chapterNum);
// Close sidebar on mobile after selection
if (window.innerWidth <= 768) {
document.getElementById('book-sidebar').classList.remove('active');
}
// Scroll to top
window.scrollTo(0, 0);
// Process ASCII diagrams
processAsciiDiagrams();
// Update document title
const chapterTitle = document.querySelector(`.chapter-link:nth-child(${chapterNum})`).textContent;
document.title = `${chapterTitle} | Solana Protocol Design`;
} catch (error) {
console.error('Error loading chapter:', error);
document.getElementById('markdown-content').innerHTML = `
<div class="error-message">
<h3>Error Loading Chapter</h3>
<p>Please ensure all markdown files are in the same directory as this HTML file.</p>
<p>Expected file: ${chapterFiles[chapterNum]}</p>
<p>Error details: ${error.message}</p>
</div>
<div class="mt-4">
<p>This book requires the following markdown files to be present in the same directory:</p>
<ul class="list-disc pl-5 mt-2">
${Object.values(chapterFiles).map(file => `<li>${file}</li>`).join('')}
</ul>
</div>
`;
}
}
// Process ASCII diagrams
function processAsciiDiagrams() {
const preElements = document.querySelectorAll('pre');
preElements.forEach(pre => {
// Check if this looks like an ASCII diagram
const content = pre.textContent;
if (content.includes('+---') || (content.includes('|') && content.includes('-'))) {
pre.classList.add('ascii-diagram');
}
});
}
// Add navigation buttons
function addNavigation(currentChapter) {
const totalChapters = Object.keys(chapterFiles).length;
const nav = document.getElementById('navigation-controls');
nav.innerHTML = '';
// Previous button
if (currentChapter > 1) {
const prevButton = document.createElement('a');
prevButton.textContent = `← Previous: Chapter ${currentChapter - 1}`;
prevButton.onclick = () => loadChapter(currentChapter - 1);
nav.appendChild(prevButton);
} else {
// Empty div for spacing
const spacer = document.createElement('div');
nav.appendChild(spacer);
}
// Next button
if (currentChapter < totalChapters) {
const nextButton = document.createElement('a');
nextButton.textContent = `Next: Chapter ${currentChapter + 1} →`;
nextButton.onclick = () => loadChapter(currentChapter + 1);
nav.appendChild(nextButton);
} else {
// Empty div for spacing
const spacer = document.createElement('div');
nav.appendChild(spacer);
}
}
// Download PDF function
function downloadPDF() {
const pdfUrl = 'solana_protocol_design_for_agent_and_mcp_server_registries.pdf';
// Create a temporary link element
const link = document.createElement('a');
link.href = pdfUrl;
link.download = 'solana_protocol_design_for_agent_and_mcp_server_registries.pdf';
// Append to the document, click, and remove
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
// Handle keyboard navigation
document.addEventListener('keydown', function(e) {
// Left arrow key for previous chapter
if (e.key === 'ArrowLeft' && currentChapter > 1) {
loadChapter(currentChapter - 1);
}
// Right arrow key for next chapter
else if (e.key === 'ArrowRight' && currentChapter < Object.keys(chapterFiles).length) {
loadChapter(currentChapter + 1);
}
});
// Load initial chapter on page load
document.addEventListener('DOMContentLoaded', function() {
// Default to chapter 1
loadChapter(1);
// Make sidebar visible on desktop by default
if (window.innerWidth > 768) {
document.getElementById('book-sidebar').style.display = 'block';
}
});
// Handle window resize
window.addEventListener('resize', function() {
if (window.innerWidth > 768) {
document.getElementById('book-sidebar').style.display = 'block';
} else {
document.getElementById('book-sidebar').style.display = 'none';
}
});
</script>
</body>
</html>