Skip to content

Commit 3ec22be

Browse files
Copilot0xrinegade
andcommitted
Add docs.html page to render markdown documentation and link from index.html
Co-authored-by: 0xrinegade <[email protected]>
1 parent b58259c commit 3ec22be

File tree

2 files changed

+251
-0
lines changed

2 files changed

+251
-0
lines changed

docs.html

Lines changed: 250 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,250 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>Solana AI Registries Documentation</title>
7+
<meta property="og:title" content="Solana AI Registries Documentation" />
8+
<meta property="og:description" content="Comprehensive documentation for the Solana AI Registries protocol, use cases, and $SVMAI token utility." />
9+
<meta property="og:image" content="./preview.png" />
10+
<meta property="og:type" content="website" />
11+
<meta property="og:url" content="https://aeamcp.com/docs.html" />
12+
<script src="https://cdn.tailwindcss.com"></script>
13+
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
14+
<style>
15+
body {
16+
font-family: 'Courier New', Courier, monospace;
17+
background-color: #FFFFFF;
18+
color: #262626;
19+
}
20+
.header {
21+
background-color: #171717;
22+
padding: 1rem;
23+
color: white;
24+
}
25+
.nav-link {
26+
display: inline-block;
27+
padding: 0.5rem 1rem;
28+
margin: 0.25rem;
29+
border: 1px solid #525252;
30+
border-radius: 0.25rem;
31+
color: #A3A3A3;
32+
text-decoration: none;
33+
transition: all 0.2s ease;
34+
background-color: #262626;
35+
}
36+
.nav-link:hover {
37+
background-color: #737373;
38+
color: #FFFFFF;
39+
border-color: #737373;
40+
}
41+
.nav-link.active {
42+
background-color: #404040;
43+
color: #FFFFFF;
44+
font-weight: bold;
45+
border-color: #404040;
46+
}
47+
.main-container {
48+
width: 100%;
49+
max-width: 1200px;
50+
margin: 0 auto;
51+
padding: 0 1rem;
52+
}
53+
#content {
54+
padding: 2rem 0;
55+
}
56+
#markdown-content {
57+
background-color: #f5f5f5;
58+
padding: 2rem;
59+
border-radius: 0.5rem;
60+
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
61+
line-height: 1.6;
62+
}
63+
#markdown-content h1 {
64+
font-size: 2rem;
65+
margin-bottom: 1rem;
66+
padding-bottom: 0.5rem;
67+
border-bottom: 2px solid #525252;
68+
}
69+
#markdown-content h2 {
70+
font-size: 1.5rem;
71+
margin-top: 2rem;
72+
margin-bottom: 1rem;
73+
padding-bottom: 0.25rem;
74+
border-bottom: 1px solid #737373;
75+
}
76+
#markdown-content h3 {
77+
font-size: 1.25rem;
78+
margin-top: 1.5rem;
79+
margin-bottom: 0.75rem;
80+
}
81+
#markdown-content ul, #markdown-content ol {
82+
padding-left: 1.5rem;
83+
margin-bottom: 1rem;
84+
}
85+
#markdown-content ul {
86+
list-style-type: disc;
87+
}
88+
#markdown-content ol {
89+
list-style-type: decimal;
90+
}
91+
#markdown-content pre {
92+
background-color: #262626;
93+
color: #ffffff;
94+
padding: 1rem;
95+
border-radius: 0.25rem;
96+
overflow-x: auto;
97+
margin: 1rem 0;
98+
}
99+
#markdown-content code {
100+
background-color: #d4d4d4;
101+
padding: 0.2rem 0.4rem;
102+
border-radius: 0.25rem;
103+
font-family: monospace;
104+
}
105+
#markdown-content pre code {
106+
background-color: transparent;
107+
padding: 0;
108+
}
109+
#markdown-content table {
110+
width: 100%;
111+
border-collapse: collapse;
112+
margin: 1.5rem 0;
113+
}
114+
#markdown-content th, #markdown-content td {
115+
border: 1px solid #d4d4d4;
116+
padding: 0.5rem 1rem;
117+
text-align: left;
118+
}
119+
#markdown-content th {
120+
background-color: #e5e5e5;
121+
}
122+
#markdown-content blockquote {
123+
border-left: 4px solid #737373;
124+
padding-left: 1rem;
125+
margin: 1rem 0;
126+
color: #525252;
127+
}
128+
#markdown-content a {
129+
color: #0ea5e9;
130+
text-decoration: none;
131+
}
132+
#markdown-content a:hover {
133+
text-decoration: underline;
134+
}
135+
#sidebar {
136+
width: 250px;
137+
min-width: 250px;
138+
padding-right: 1.5rem;
139+
}
140+
</style>
141+
</head>
142+
<body>
143+
<header class="header">
144+
<nav class="main-container py-3 flex flex-col sm:flex-row sm:justify-between items-center">
145+
<a href="index.html" class="text-xl sm:text-2xl font-bold text-white hover:text-neutral-300 transition-colors text-center sm:text-left mb-3 sm:mb-0">Solana AI Registries Initiative</a>
146+
<div class="flex flex-col items-center space-y-2 sm:flex-row sm:space-y-0 sm:space-x-1 sm:flex-wrap text-sm sm:justify-end">
147+
<a href="index.html" class="nav-link">Main Page</a>
148+
</div>
149+
</nav>
150+
</header>
151+
152+
<main class="main-container py-8">
153+
<div class="flex flex-col md:flex-row">
154+
<div id="sidebar" class="mb-6 md:mb-0">
155+
<h2 class="text-xl font-bold mb-4">Documentation</h2>
156+
<ul id="doc-nav" class="space-y-2"></ul>
157+
</div>
158+
<div id="content" class="flex-grow">
159+
<div id="markdown-content" class="prose max-w-none"></div>
160+
</div>
161+
</div>
162+
</main>
163+
164+
<footer class="bg-neutral-800 text-white py-6">
165+
<div class="main-container text-center">
166+
<p>© 2024 Solana AI Registries Initiative. All rights reserved.</p>
167+
</div>
168+
</footer>
169+
170+
<script>
171+
// Available documentation files
172+
const docFiles = [
173+
{ id: 'readme', name: 'Overview', path: 'docs/README.md' },
174+
{ id: 'protocol', name: 'Protocol Specification', path: 'docs/protocol-specification.md' },
175+
{ id: 'svmai', name: '$SVMAI Token', path: 'docs/svmai-token.md' },
176+
{ id: 'usecases', name: 'Use Cases', path: 'docs/use-cases.md' },
177+
{ id: 'developer', name: 'Developer Guide', path: 'docs/developer-guide.md' }
178+
];
179+
180+
// Create navigation sidebar
181+
const docNav = document.getElementById('doc-nav');
182+
docFiles.forEach(doc => {
183+
const li = document.createElement('li');
184+
const a = document.createElement('a');
185+
a.href = `#${doc.id}`;
186+
a.dataset.path = doc.path;
187+
a.className = 'block p-2 hover:bg-neutral-200 rounded';
188+
a.innerText = doc.name;
189+
a.addEventListener('click', (e) => {
190+
e.preventDefault();
191+
loadMarkdown(doc.path);
192+
193+
// Update active state in navigation
194+
document.querySelectorAll('#doc-nav a').forEach(el => {
195+
el.classList.remove('font-bold', 'bg-neutral-200');
196+
});
197+
a.classList.add('font-bold', 'bg-neutral-200');
198+
199+
// Update URL hash
200+
window.location.hash = doc.id;
201+
});
202+
li.appendChild(a);
203+
docNav.appendChild(li);
204+
});
205+
206+
// Function to load and render markdown content
207+
async function loadMarkdown(path) {
208+
try {
209+
const response = await fetch(path);
210+
if (!response.ok) {
211+
throw new Error(`Failed to load ${path}: ${response.status} ${response.statusText}`);
212+
}
213+
const markdown = await response.text();
214+
document.getElementById('markdown-content').innerHTML = marked.parse(markdown);
215+
} catch (error) {
216+
console.error('Error loading markdown:', error);
217+
document.getElementById('markdown-content').innerHTML = `
218+
<div class="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded">
219+
<h2 class="font-bold">Error Loading Document</h2>
220+
<p>${error.message}</p>
221+
</div>
222+
`;
223+
}
224+
}
225+
226+
// Load default document or from hash
227+
window.addEventListener('DOMContentLoaded', () => {
228+
const hash = window.location.hash.substring(1);
229+
const defaultDoc = docFiles[0].path;
230+
231+
let docToLoad = defaultDoc;
232+
let navItem = document.querySelector(`#doc-nav a[data-path="${defaultDoc}"]`);
233+
234+
if (hash) {
235+
const matchingDoc = docFiles.find(doc => doc.id === hash);
236+
if (matchingDoc) {
237+
docToLoad = matchingDoc.path;
238+
navItem = document.querySelector(`#doc-nav a[data-path="${docToLoad}"]`);
239+
}
240+
}
241+
242+
// Load the document and mark as active
243+
loadMarkdown(docToLoad);
244+
if (navItem) {
245+
navItem.classList.add('font-bold', 'bg-neutral-200');
246+
}
247+
});
248+
</script>
249+
</body>
250+
</html>

index.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@
340340
<a href="#discovery-querying" class="nav-link">Discovery</a>
341341
<a href="#security" class="nav-link">Security</a>
342342
<a href="#conclusion" class="nav-link">Conclusion</a>
343+
<a href="docs.html" class="nav-link" style="background-color: #0ea5e9; color: white; border-color: #0ea5e9;">Documentation</a>
343344
</div>
344345
</nav>
345346
</header>

0 commit comments

Comments
 (0)