Update note links

This commit is contained in:
SillyLossy
2023-04-24 13:40:14 +03:00
parent 2752e69388
commit 4b3671c5ad
3 changed files with 71 additions and 51 deletions

View File

@@ -1,4 +1,5 @@
<html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>SillyTavern Guidebook</title>
@@ -10,16 +11,24 @@
<script src="/scripts/showdown-toc.min.js"></script>
<script type="module">
const toc = [];
let hash = location.hash;
let converter = new showdown.Converter({ extensions: [showdownToc({ toc })] } );
let text = await (await fetch('/notes/content.md')).text();
let content = document.getElementById('content');
content.innerHTML = converter.makeHtml(text);
const link = document.createElement('a');
link.href = hash;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
</script>
</head>
<body>
<div id="main">
<div id="content">
<!-- To change the guidebook content edit the content.md file -->
<!-- Then it will be dynamically inserted here -->
</div>
</div>
</body>