Fetch and render README.md content dynamically in the notes section

This commit is contained in:
MayaChat
2025-11-24 01:22:07 -05:00
parent 622a164873
commit 0c3d89b7da

View File

@@ -25,12 +25,8 @@
<!-- Service groups will be populated dynamically from /services.xml --> <!-- Service groups will be populated dynamically from /services.xml -->
</section> </section>
<section class="notes"> <section class="notes" id="readme-section">
<h2>Notes</h2> <div id="readme-content">Loading documentation...</div>
<ul>
<li>If any service is behind a reverse proxy or uses host networking, the path/host may differ.</li>
<li>Edit <code>services.xml</code> in this repo to add/remove links.</li>
</ul>
</section> </section>
</main> </main>
@@ -479,6 +475,20 @@
container.innerHTML = '<p class="notes">Error loading services.xml — see console for details.</p>'; container.innerHTML = '<p class="notes">Error loading services.xml — see console for details.</p>';
} }
})(); })();
// Fetch and render README.md
(async function loadReadme(){
try {
const response = await fetch('/README.md', {cache: 'no-cache'});
if(!response.ok) throw new Error('README not found');
const markdown = await response.text();
const html = marked.parse(markdown);
document.getElementById('readme-content').innerHTML = html;
} catch(err) {
console.error('Error loading README:', err);
document.getElementById('readme-content').innerHTML = '<p>Documentation unavailable.</p>';
}
})();
</script> </script>
</body> </body>
</html> </html>