Code Monkey home page Code Monkey logo

Comments (5)

npiv avatar npiv commented on August 30, 2024 1

I think this is fixable by adding a paramer to pass a theme to the underlying markdown parser (rich). Will take a look in the coming days

from chatblade.

ldelossa avatar ldelossa commented on August 30, 2024 1

thanks a ton!

from chatblade.

npiv avatar npiv commented on August 30, 2024

Hi @ldelossa

Latest version v0.3.0 from main or via pip has the change. homebrew is pending.

You can set the theme via --theme or as an env variable CHATBLADE_THEME. The available styles are here: https://pygments.org/styles/

e.g.
image

Do note that you will only get full syntax highlighting like in the example if chatgpt provides a type hint for the language being used. You can check this with -r to get the raw response.

e.g.
image

In this case you can see that it indicates it is python at the start of the code block. GPT-4 is really good at this, but gpt 3.5 often doesn't do this. You can create a prompt that hints it to do this though if you like which works quite well for me.

from chatblade.

jasalt avatar jasalt commented on August 30, 2024

Theme functionality works for code snippets, but having an issue with readability of inline variable names that have black background when using a "high contrast" variation of default Konsole "Black on White" theme which ends up using #2a8080 hex colour for the inline variable text that is too dark to show up.

High contrast variation (better for outdoors):
Screenshot_20230715_072831

Original Konsole theme:
Screenshot_20230715_072756

Maybe fixable by applying the same code snippet theme to inline variable names, or if background wasn't getting darker than the text.

As a temporary fix, overriding this terminal theme color 7 "intense" variation manually with lighter color.
image

Using package chatblade 0.3.1, installed using Python 3.11.2 with pipx.

from chatblade.

jasalt avatar jasalt commented on August 30, 2024

Also, noting that when using streaming mode with -s it seems to use different theme during streaming than what is used after completing full request. As this initial theme looks totally fine as is, could it be used after completion too? Does it have use pygments theme that could be used with --theme flag?

untitled.mp4

from chatblade.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.