Repository navigation
Expand file tree
/
Copy pathindex.html
More file actions
57 lines (54 loc) · 1.88 KB
/
Copy pathindex.html
File metadata and controls
57 lines (54 loc) · 1.88 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document Viewer for AI</title>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<style>
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
line-height: 1.6;
max-width: 800px;
margin: 40px auto;
padding: 0 20px;
color: #333;
}
pre {
background: #f4f4f4;
padding: 15px;
border-radius: 5px;
overflow-x: auto;
}
code {
font-family: monospace;
background: #f4f4f4;
padding: 2px 4px;
border-radius: 3px;
}
</style>
</head>
<body>
<div id="content">Loading document...</div>
<script>
// CHANGE THIS to the exact name of your text or readme file
const fileName = 'claude-fable-5.md';
fetch(fileName)
.then(response => {
if (!response.ok) {
throw new Error('Network response was not ok: ' + response.statusText);
}
return response.text();
})
.then(text => {
// This converts the markdown/text into HTML and injects it into the page
document.getElementById('content').innerHTML = marked.parse(text);
})
.catch(error => {
document.getElementById('content').innerHTML =
`<p style="color: red;"><strong>Error loading file:</strong> Please make sure "${fileName}" exists in the same folder and you are viewing this via a server or GitHub Pages.</p>`;
console.error('Error:', error);
});
</script>
</body>
</html>