Spaces:
Running on Zero
Running on Zero
Update index.html
Browse files12345678910111213141516171812345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152<!doctype html><html> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width" /> <title>My static Space</title> <link rel="stylesheet" href="style.css" /> </head> <body> <div class="card"> <h1>Welcome to your static Space!</h1> <p>You can modify this app directly by editing <i>index.html</i> in the Files and versions tab.</p> <p> Also don't forget to check the <a href="https://huggingface.co/docs/hub/spaces" target="_blank">Spaces documentation</a>. </p> </div> </body><!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>index.html+51-18