kesimeg's picture
Update index.hmtl to render markdown
54dce55 verified
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Render Markdown</title>
<style>
body {
font-family: 'Arial', sans-serif;
line-height: 1.6;
margin: 0;
padding: 20px;
background-color: #f7f7f7;
color: #333;
}
h1, h2, h3, h4, h5, h6 {
font-weight: 600;
color: #222;
}
p {
font-size: 1rem;
margin-bottom: 1.25em;
}
a {
color: #0366d6;
text-decoration: none;
}
a:hover {
text-decoration: underline;
}
pre, code {
font-family: 'Courier New', monospace;
background-color: #f4f4f4;
padding: 4px 6px;
border-radius: 4px;
font-size: 1rem;
}
blockquote {
border-left: 4px solid #ccc;
padding-left: 16px;
margin: 16px 0;
color: #666;
font-style: italic;
}
ul, ol {
margin-left: 20px;
}
li {
margin-bottom: 8px;
}
/* Smooth font rendering */
* {
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
/* Remove the box around the content */
#markdown-content {
max-width: 800px;
margin: 0 auto;
}
/* GitHub Badge styling */
#github-badge {
display: block;
width: 200px;
margin: 20px auto;
text-align: center;
}
#github-badge img {
width: 100%;
}
</style>
<!-- Include marked.js via CDN -->
<script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
</head>
<body>
<!-- GitHub Badge linking to the repository -->
<a id="github-badge" href="https://github.com/kesimeg/awesome-turkish-language-models" target="_blank">
<img src="https://img.shields.io/badge/GitHub-View%20Repository-blue?logo=github" alt="GitHub Badge">
</a>
<div class="content">
<div id="markdown-content"></div>
</div>
<script>
// Function to fetch and render the Markdown file from a remote URL
async function loadMarkdown() {
try {
// Fetch the README.md file from a hosted URL
const response = await fetch("https://raw.githubusercontent.com/kesimeg/awesome-turkish-language-models/refs/heads/main/README.md");
const markdownText = await response.text();
// Convert markdown to HTML using 'marked'
const htmlContent = marked.parse(markdownText);
// Inject the HTML into the page
document.getElementById('markdown-content').innerHTML = htmlContent;
} catch (error) {
console.error("Error loading the markdown file:", error);
}
}
// Load the markdown content automatically
loadMarkdown();
</script>
</body>
</html>