From c0b79cb6c84bb6feba93662f4c8df5aab72575d4 Mon Sep 17 00:00:00 2001 From: end-4 <97237370+end-4@users.noreply.github.com> Date: Thu, 21 Mar 2024 19:45:25 +0700 Subject: [PATCH] sidebar: ai: latex: left align, nicer /test cmd --- .config/ags/modules/.miscutils/md2pango.js | 41 +++++++------------ .../modules/sideleft/apis/ai_chatmessage.js | 2 +- 2 files changed, 16 insertions(+), 27 deletions(-) diff --git a/.config/ags/modules/.miscutils/md2pango.js b/.config/ags/modules/.miscutils/md2pango.js index fa059fed2..afa91ad23 100644 --- a/.config/ags/modules/.miscutils/md2pango.js +++ b/.config/ags/modules/.miscutils/md2pango.js @@ -59,31 +59,20 @@ export default (text) => { return output.join('\n'); } -export const markdownTest = `# Heading 1 -## Heading 2 -### Heading 3 -#### Heading 4 -##### Heading 5 -1. yes -2. no -127. well -- Bulletpoint starting with minus -* Bulletpoint starting with asterisk ---- -- __Underline__ __ No underline __ -- **Bold** ** No bold ** -- _Italics1_ *Italics2* _ No Italics _ -- A color: #D6BAFF -- nvidia green: #7ABB08 - - sub-item -\`\`\`javascript -// A code block! -myArray = [23, 123, 43, 54, '6969']; -console.log('uwu'); +export const markdownTest = `## Inline formatting +- **Bold** *Italics* __Underline__ +- \`Monospace text\` 🤓 +- Colors + - Nvidia green #7ABB08 + - Soundcloud orange #FF5500 +## Code block +\`\`\`cpp +#include +const std::string GREETING="UwU"; +int main() { std::cout << GREETING; } \`\`\` -- Random instruction thing - - To update arch lincox, run \`sudo pacman -Syu\` -\`\`\`tex -\\frac{d}{dx} \\left( \\frac{x-438}{x^2+23x-7} \\right) = \\frac{-x^2 + 869}{(x^2+23x-7)^2} \\\\ \\frac{d}{dx} \\left( \\frac{x-438}{x^2+23x-7} \\right) = \\frac{-x^2 + 869}{(x^2+23x-7)^2} +## LaTeX +\`\`\`latex +\\frac{d}{dx} \\left( \\frac{x-438}{x^2+23x-7} \\right) = \\frac{-x^2 + 869}{(x^2+23x-7)^2} \\\\ → \\\\ cos(2x) = 2cos^2(x) - 1 = 1 - 2sin^2(x) = cos^2(x) - sin^2(x) \`\`\` -`; \ No newline at end of file +`; diff --git a/.config/ags/modules/sideleft/apis/ai_chatmessage.js b/.config/ags/modules/sideleft/apis/ai_chatmessage.js index 85fadc060..38531009e 100644 --- a/.config/ags/modules/sideleft/apis/ai_chatmessage.js +++ b/.config/ags/modules/sideleft/apis/ai_chatmessage.js @@ -82,7 +82,7 @@ const Latex = (content = '') => { const latexViewArea = Box({ // vscroll: 'never', // hscroll: 'automatic', - homogeneous: true, + // homogeneous: true, attribute: { render: async (self, text) => { if (text.length == 0) return;