elevenhsoft / cosmic-ext-applet-ollama

Ollama applet for COSMIC Desktop
GNU General Public License v3.0
19 stars 1 forks source link

[Feature Request] Add markdown view of answers #1

Open ahoneybun opened 1 month ago

ahoneybun commented 1 month ago

This would be helpful for code questions at least from my POV.

elevenhsoft commented 1 month ago

Yes, exactly! This is something I was consider before but was not sure how to implement this. I was thinking to use cosmic-text somehow, but maybe markdown parser should be enough as you say. Definitely. So I have a plan for today, thank you ;p

elevenhsoft commented 1 month ago

Well, I tried to do this but it's kind of hard task. Especially syntax highlighting for code so I guess this issue will wait a bit for better times :P

elevenhsoft commented 1 month ago

Hey @ahoneybun , I'm working on this markdown on markdown branch. Would you be able to test it and give me some feedback how you see it?

ahoneybun commented 1 month ago

Yea I can test this in a bit.

elevenhsoft commented 1 month ago

Thank you, I'm working also to add rich_text from cosmic-text, and then we will have some headings, and other stuff like bold text, it will looks better but for now it's kind of bare bone, but it works ^^

ahoneybun commented 1 month ago

I think you can say that it works.

screenshot-2024-06-14-12-42-12

ahoneybun commented 1 month ago

It's odd that it is applying the color outside of the bash code though.

elevenhsoft commented 1 month ago

It's odd that it is applying the color outside of the bash code though.

Yes and I'm not sure how to deal with it. Maybe rich_text() will help somehow and I don't know yet. Syntax is set for whole text block when it recognize code block, and then it works with all the text, that's the result.

After implementing rich text i will try to correct this.

ahoneybun commented 1 month ago

Sounds good!

elevenhsoft commented 1 month ago

@ahoneybun yeahhhh i achieved something! ^^

Take a look: Screenshot_20240614_172029

elevenhsoft commented 1 month ago

Just updated branch with new update :)

You can check in free time.

mmstick commented 1 month ago

There may be value in having a markdown widget integrated into libcosmic

elevenhsoft commented 1 month ago

Well, if it's good enough hahah I'm worry to add it upstream since I'm not sure how good it is. For my use case it works but you know

mmstick commented 1 month ago

Code quality can only go up after it's mainstreamed and used by multiple applications. We could use this in the app store for app summaries. App summaries are written in HTML, which we could pass through https://github.com/nabbisen/mdka-rs to convert to markdown.

elevenhsoft commented 1 month ago

Yeah that's for sure. I will try to improve this if possible and make a PR to libcosmic then. In any case it was nice learning going through all this ;p

ahoneybun commented 1 month ago

Just updated branch with new update :)

You can check in free time.

It looks like it is still doing it from what I can tell with a prompt like this:

"write a python script to print the weather"

elevenhsoft commented 4 weeks ago

I'm not sure but for me works correctly. Did you wait for full response from AI? The code is properly parsed when full code has been written.

ahoneybun commented 3 weeks ago

@elevenhsoft ah yes that looks correct.

screenshot-2024-06-18-19-38-13