mirror of
https://github.com/SillyTavern/SillyTavern.git
synced 2025-06-05 21:59:27 +02:00
New onboarding experience
This commit is contained in:
18
public/scripts/notes.js
Normal file
18
public/scripts/notes.js
Normal file
@ -0,0 +1,18 @@
|
||||
async function loadNotes(file) {
|
||||
const toc = [];
|
||||
let hash = location.hash;
|
||||
let converter = new showdown.Converter({ tables: true, extensions: [showdownToc({ toc })] } );
|
||||
let text = await (await fetch(file)).text();
|
||||
let content = document.getElementById('content');
|
||||
content.innerHTML = converter.makeHtml(text);
|
||||
|
||||
if (hash) {
|
||||
const link = document.createElement('a');
|
||||
link.href = hash;
|
||||
document.body.appendChild(link);
|
||||
link.click();
|
||||
document.body.removeChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
window.loadNotes = loadNotes;
|
Reference in New Issue
Block a user