Spaces:
Running
on
Zero
Running
on
Zero
File size: 1,543 Bytes
4143239 fb5226b |
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">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>README.md Viewer</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 20px;
}
pre {
background-color: #f4f4f4;
padding: 10px;
border-radius: 5px;
overflow-x: auto;
}
</style>
</head>
<body>
<h1>README.md Viewer</h1>
<div id="readme-content"></div>
<script>
// Function to fetch README.md content
async function fetchReadme() {
const response = await fetch('README.md');
const content = await response.text();
return content;
}
// Function to convert Markdown to HTML
function markdownToHtml(markdown) {
const converter = new showdown.Converter();
return converter.makeHtml(markdown);
}
// Main function to display README content
async function displayReadme() {
const readmeContent = await fetchReadme();
const readmeHtml = markdownToHtml(readmeContent);
document.getElementById('readme-content').innerHTML = readmeHtml;
}
// Call the main function
displayReadme();
</script>
<!-- Include Showdown.js library for Markdown to HTML conversion -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.1/showdown.min.js"></script>
</body>
</html>
|