-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathindex.html
81 lines (80 loc) · 3.1 KB
/
index.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>OS Learning Journey</title>
<script src="https://cdn.tailwindcss.com"></script>
<script>
tailwind.config = {
theme: {
extend: {
typography: {
DEFAULT: {
css: {
maxWidth: 'none',
},
},
},
},
},
plugins: [
function({addBase, theme}) {
addBase({
'h1': { fontSize: theme('fontSize.2xl'), fontWeight: theme('fontWeight.bold') },
'h2': { fontSize: theme('fontSize.xl'), fontWeight: theme('fontWeight.bold') },
'h3': { fontSize: theme('fontSize.lg'), fontWeight: theme('fontWeight.bold') },
'a': { color: theme('colors.blue.600') },
'p': { marginTop: theme('spacing.4'), marginBottom: theme('spacing.4') },
'ul': { listStyleType: 'disc', paddingLeft: theme('spacing.4') },
'ol': { listStyleType: 'decimal', paddingLeft: theme('spacing.4') },
'code': {
backgroundColor: theme('colors.gray.100'),
padding: theme('spacing.1'),
borderRadius: theme('borderRadius.sm'),
},
'pre': {
backgroundColor: theme('colors.gray.100'),
padding: theme('spacing.4'),
borderRadius: theme('borderRadius.md'),
overflowX: 'auto',
}
})
}
],
}
</script>
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
<script>
// Configure marked to handle GitHub-flavored markdown
marked.setOptions({
gfm: true,
breaks: true,
highlight: function(code, language) {
return code;
}
});
</script>
<script src="book-config.js"></script>
<script src="book-viewer.js"></script>
</head>
<body class="bg-gray-50">
<div id="root"></div>
<script>
window.onerror = function(msg, url, line, col, error) {
console.error('Error: ', msg, '\nURL: ', url, '\nLine:', line, '\nColumn:', col, '\nError object:', error);
return false;
};
// Initialize after everything is loaded
window.addEventListener('DOMContentLoaded', () => {
console.log('DOM Content Loaded');
const root = document.getElementById('root');
if (!root) {
console.error('Root element not found!');
return;
}
window.bookViewer = new BookViewer(root, bookConfig.chapters);
});
</script>
</body>
</html>