-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathview.html
More file actions
53 lines (50 loc) · 1.82 KB
/
view.html
File metadata and controls
53 lines (50 loc) · 1.82 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<title>Markdown Viewer</title>
<script src="https://cdnjs.cloudflare.com/ajax/libs/marked/11.1.0/marked.min.js"></script>
<link rel="stylesheet" href="github-markdown.css" />
<style>
body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
font-size: large;
}
@media (prefers-color-scheme: dark) {
body {
background-color: #0d1117;
color: #cccccc;
}
}
</style>
</head>
<body class="bg-gray-100 min-h-screen p-8">
<div class="max-w-4xl mx-auto bg-white shadow-lg rounded-lg p-6">
<div id="markdown-content" class="prose prose-lg max-w-none">
Loading...
</div>
</div>
<script>
async function loadMarkdown() {
try {
const response = await fetch(
"https://thil4n.github.io/interview-preparation/algorithms/questions.md"
);
const markdownText = await response.text();
const htmlContent = marked.parse(markdownText);
document.getElementById("markdown-content").innerHTML =
htmlContent;
} catch (error) {
document.getElementById("markdown-content").innerHTML =
"<p class='text-red-500'>Failed to load markdown file.</p>";
console.error("Error loading markdown:", error);
}
}
loadMarkdown();
</script>
</body>
</html>