Giter Site home page Giter Site logo

Comments (2)

nnicandro avatar nnicandro commented on May 17, 2024 2

Also as a side note, it looks like you use rainbow-delimiters-mode. You can also enable that in the REPL by adding rainbow-delimiters-mode-enable to jupyter-repl-mode-hook.

from jupyter.

nnicandro avatar nnicandro commented on May 17, 2024

I did previously try to get color in code block output. The functions used to colorize the ANSI escape sequences in the REPL are the same ones used in the org-mode output block, the difference is that org-mode strips the color for some reason and I haven't put in the time to figure out why yet. Most likely it is related to using text properties to add in the color and how org-mode does its fontification using font-lock.

Thinking about it again, I don't think it is correct to remove the ANSI escape sequences in org-mode output since we lose information that the kernel sent. We should be able to add color by inserting the ANSI escape sequences into the buffer, instead of stripping them and adding the colors as text properties before insertion (which is what the REPL does), and use ansi-color-apply-on-region to overlay them with color. This way we use overlays instead of text properties so we don't interfere with font-lock. The only downside is that overlays are known to slow down editing when there are a lot of them in the buffer.

from jupyter.

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.