Open nikomatsakis opened 3 months ago
copilot suggested markdown be converted with markdown-it
....not sure if there's a better library out there.
import * as vscode from 'vscode';
import MarkdownIt from 'markdown-it';
export function convertMarkdownToHtml() {
const editor = vscode.window.activeTextEditor;
if (!editor) {
vscode.window.showInformationMessage('No editor is active');
return;
}
const document = editor.document;
const markdown = document.getText();
const md = new MarkdownIt();
const html = md.render(markdown);
// Now you can use the HTML string
console.log(html);
}
This interferes with tolerable demos so I'm going to see what I can do quickly.
ok, did the very minimum. Unassigning myself but leaving issue open since there's so much room to make this less ugly. Other interesting add-ons include #8 (e.g., decorating source blocks) and that sort of thing.
Different example with different formatting, also doesn't look great.
The current chat is just dumping text into the window. It looks terrible.
We should render the markdown to HTML.
(We could also use the "real" chat that VSCode provides and make a chat participant, but I kind of like having full control over the interface, and I also want the freedom to move to smaller, local models, etc)