vasilecampeanu / obsidian-weaver

Weaver is an Obsidian plugin that integrates a ChatGPT-like interface into your note-taking workflow. This plugin makes it easy to access AI-generated suggestions and insights within Obsidian, helping you improve your writing and brainstorming process.
MIT License
202 stars 8 forks source link

Better response rendering #14

Closed SPiCaRiA closed 1 year ago

SPiCaRiA commented 1 year ago

Hi, this is definitely an awesome plug-in to see! Thank you for making it.

I'm wondering if we can improve the markdown rendering of the responses in the following ways:

  1. Support math rendering. I see you using remark/react-markdown to render the dialogue bubbles, I'm sure it supports a go-to math rendering plug-in (check this). It would be very helpful to people who work in academia to have latex rendered in response!

  2. Rely more on obsidian's rendering tools

    1. I think for code blocks rendering, obsidian exposes its global Prism object through loadPrism. I'm not an expert on this and not sure if it can be helpful or not, so this is just FYI.
    2. Similarly, I'm wondering if there is an API to utilize obsidian's Markdown engine so we can throw remark/react-markdown away, with way better consistency with the rest of the app. However, after a quick view of the relevant APIs, I'm not able to come up with a quick way to do this in our React components. It will be great if anyone else with more knowledge can help :)
vasilecampeanu commented 1 year ago

Thanks for the feedback, I am going to look into adding the math rendering in the next update. However, improving integration with Obsidian will be part of the long-term development goals.

vasilecampeanu commented 1 year ago

Thanks again for bringing up the issue. Version 0.3.2 is now available, I've switched to Obsidian's built-in rendering, which now supports math rendering. To take advantage of the better LaTeX support provided by GPT-3, you'll need to either reinstall the plugin or change the System Role Prompt setting as described in the release notes.