bramses / chatgpt-md

A (nearly) seamless integration of ChatGPT into Obsidian.
MIT License
824 stars 61 forks source link

Different color display for the response of "::assistant" #23

Open daniellsh opened 1 year ago

daniellsh commented 1 year ago

Currently, the distinction between ChatGPT's response is clearly marked by two horizontal lines. Yet, as the conversation grow longer and span into lengthy pages, it would be advantageous to swiftly spot ChatGPT's response section. This could be achieved by displaying the text in a distinct color or using another visual cue to set them apart. :)

lukemt commented 1 year ago

@daniellsh try out the new headings feature. If you update the plugin you can activate it in settings. Maybe this solves the issue for you.

Regarding the color: Putting a <span style=color:blue>...</span> might not behave the best way in obsidian. One could set a special style instead (using the ~-selector), but the way I think of implementing it wouldn't color it 100% reliably when the answer is long.

The look of chat bubbles would also be cool, but I guess we would have the same issues.

usizu commented 1 year ago

Would it be possible to add HTML attributes to the <divs> so that they can be targeted via CSS and styled differently?

For example <div class="cm-line">role:user</div> could become <div class="cm-line role_user">role:user</div> or <div class="cm-line" chatGPT="user">role:user</div>.

Perhaps the <div> containing the response could have another class/attribute too to help with the styling

bramses commented 1 year ago

Would it be possible to add HTML attributes to the so that this way they can be targeted via CSS and styled differently?

For example <div class="cm-line">role:user</div> could become <div class="cm-line role_user">role:user</div> or <div class="cm-line" chatGPT="user">role:user</div>.

Perhaps the <div> containing the response could have another class/attribute too to help with the styling

I could see that being useful as a setting to toggle on. I'll look into it.

sensn commented 1 year ago

You can also ask chatgpt to wrap its answers in foldable Callouts once you told it the syntax for Callouts. Just tried it and it works.

usizu commented 1 year ago

You can also ask chatgpt to wrap its answers in foldable Callouts once you told it the syntax for Callouts. Just tried it and it works.

That's an interesting and creative work-around, although it is quite a bit more labour intensive to have to edit every prompt to have to include that instruction to wrap the responses in callouts

daniellsh commented 1 year ago

It's wonderful to see many innovative ideas starting to emerge here! :D