File size: 2,043 Bytes
dbbb1e5
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145784e
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
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Markdown Preview</title>
    
    <!-- Link to Google Fonts to use Poppins -->
    <link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600&display=swap" rel="stylesheet">

    <!-- Styling for the page -->
    <style>
        body {
            font-family: 'Poppins', sans-serif;
            line-height: 1.6;
            padding: 20px;
            max-width: 800px;
            margin: auto;
        }
        h1, h2, h3, h4, h5, h6 {
            font-weight: 600;
        }
        p {
            margin-bottom: 1em;
        }
        pre {
            background-color: #f4f4f4;
            padding: 10px;
            border-radius: 5px;
            overflow-x: auto;
        }
        code {
            background-color: #f4f4f4;
            padding: 2px 4px;
            border-radius: 3px;
        }
        blockquote {
            border-left: 5px solid #ccc;
            padding-left: 10px;
            color: #666;
            margin-left: 0;
        }
        ul, ol {
            margin-left: 20px;
        }
        a {
            color: #007bff;
            text-decoration: none;
        }
    </style>
</head>
<body>
    <h1>Markdown Preview</h1>
    <div id="markdown-content">
        <!-- Markdown content will be rendered here -->
    </div>

    <!-- Include the Marked.js library -->
    <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>

    <!-- Script to fetch and render Markdown file -->
    <script>
        async function loadMarkdown() {
            const response = await fetch('example.md');
            const markdown = await response.text();
            
            // Render the markdown using marked.js
            const htmlContent = marked(markdown);
            document.getElementById('markdown-content').innerHTML = htmlContent;
        }

        loadMarkdown();
    </script>
</body>
</html>