diff --git a/public/css/notes.css b/public/css/notes.css index 5c6b2d3ba..d491d6657 100644 --- a/public/css/notes.css +++ b/public/css/notes.css @@ -39,6 +39,7 @@ code { padding: 5px; border-radius: 5px; display: block; + white-space: normal; } a { @@ -54,4 +55,19 @@ h3 { hr { border: 1px solid #999; +} + +table { + width: 100%; +} + +table, +th, +td { + border: 1px solid; + border-collapse: collapse; +} + +table img { + max-width: 200px; } \ No newline at end of file diff --git a/public/notes/faq.md.html b/public/notes/faq.md.html new file mode 100644 index 000000000..98c00ea1b --- /dev/null +++ b/public/notes/faq.md.html @@ -0,0 +1,24 @@ + + + + + SillyTavern FAQ + + + + + + + + + + +
+
+ + +
+
+ + + \ No newline at end of file diff --git a/public/notes/index.html b/public/notes/index.html index c2ff713b6..08ce9c3b2 100644 --- a/public/notes/index.html +++ b/public/notes/index.html @@ -9,22 +9,10 @@ - + - +
diff --git a/public/notes/readme.md.html b/public/notes/readme.md.html new file mode 100644 index 000000000..16f1fdc5c --- /dev/null +++ b/public/notes/readme.md.html @@ -0,0 +1,24 @@ + + + + + SillyTavern Guidebook + + + + + + + + + + +
+
+ + +
+
+ + + \ No newline at end of file diff --git a/public/script.js b/public/script.js index b83f33f33..b97fca2ce 100644 --- a/public/script.js +++ b/public/script.js @@ -251,15 +251,35 @@ const system_messages = { is_user: false, is_name: true, mes: [ - 'Welcome to SillyTavern! In order to begin chatting:', + '

Welcome to SillyTavern!

', + '

In order to begin chatting:

', '
    ', '
  1. Connect to one of the supported generation APIs (the plug icon)
  2. ', '
  3. Create or pick a character from the list (the top-right namecard icon)
  4. ', '
', - "

Running on Colab and can't get an answer from the AI or getting Out of Memory errors?

", + "

Running on Colab and can't get an answer from the AI or getting Out of Memory errors?

", 'Set a lower Context Size in AI generation settings (leftmost icon).
Values in range of 1400-1600 Tokens would be the safest choice.', - '

Still have questions left?

', - 'Check out built-in help or type /? in any chat.' + '

Where to download more characters?

', + '
    ', + '
  1. Pygmalion AI Discord
  2. ', + '
  3. CharacterHub (NSFW)
  4. ', + '
  5. Arca.live (Korean)
  6. ', + '
  7. Botprompts.net
  8. ', + '
', + '

Where can I get help?

', + 'Before going any further, check out the following resources:', + '
    ', + '
  1. Introduction to SillyTavern
  2. ', + '
  3. SillyTavern FAQ
  4. ', + '
  5. SillyTavern Guidebook
  6. ', + '
  7. Extras API Docs
  8. ', + '
  9. Pygmalion AI Docs
  10. ', + '
', + 'Type /? in any chat to get help on message formatting commands.', + '

Still have questions or suggestions left?

', + 'Post a GitHub issue.', + '
', + 'Contact the developers.' ].join('') }, group: { diff --git a/public/scripts/notes.js b/public/scripts/notes.js new file mode 100644 index 000000000..66e6a7472 --- /dev/null +++ b/public/scripts/notes.js @@ -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; \ No newline at end of file diff --git a/server.js b/server.js index 46e2c0382..e3dbd98fe 100644 --- a/server.js +++ b/server.js @@ -267,6 +267,12 @@ app.get("/", function (request, response) { app.get("/notes/*", function (request, response) { response.sendFile(__dirname + "/public" + request.url + ".html"); }); +app.get('/get_faq', function(_, response) { + response.sendFile(__dirname + "/faq.md"); +}); +app.get('/get_readme', function(_, response) { + response.sendFile(__dirname + "/readme.md"); +}); //**************Kobold api app.post("/generate", jsonParser, async function (request, response_generate = response) {