File size: 1,081 Bytes
be70a85
f646389
be70a85
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
<!DOCTYPE html>
<html>
<head>
    <title>Markdown Viewer</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/2.1.0/showdown.min.js"></script>
    <!-- Or for Marked.js: -->
    <!-- <script src="https://cdnjs.cloudflare.com/ajax/libs/marked/4.0.0/marked.min.js"></script> -->
</head>
<body>
    <div id="markdown-content"></div>

    <script>
        const markdownUrl = 'https://raw.githubusercontent.com/huggingface/xet-core/refs/heads/assaf/spec/spec/spec.md'; // Replace with your URL

        fetch(markdownUrl)
            .then(response => response.text())
            .then(markdownText => {
                const converter = new showdown.Converter(); // For Showdown.js
                // Or for Marked.js:
                // const html = marked.parse(markdownText);

                const html = converter.makeHtml(markdownText); // For Showdown.js
                document.getElementById('markdown-content').innerHTML = html;
            })
            .catch(error => console.error('Error fetching Markdown:', error));
    </script>
</body>
</html>