executablebooks / MyST-NB

Parse and execute ipynb files in Sphinx
https://myst-nb.readthedocs.io
BSD 3-Clause "New" or "Revised" License
210 stars 83 forks source link

Improve ANSI lexing #247

Open chrisjsewell opened 4 years ago

chrisjsewell commented 4 years ago

I added your 8-bit ANSI into the docs, and it looks to be working well

image

It doesn't seem to support "underline" and "invert", and there don't seem to be any "intense" colors when switching to "bold".

image

I'll leave 256-but ANSI for another time/PR though (or feel free to give it a go)

I've already implemented this in three different places (in two languages), and I don't currently have the energy to do it yet again.

Do you even have to use Pygments? Why not just use nbconvert's implementation?

For reference, the nbconvert implementation is there: https://github.com/jupyter/nbconvert/blob/master/nbconvert/filters/ansi.py

Originally posted by @mgeier in https://github.com/executablebooks/MyST-NB/pull/243#issuecomment-678955591

chrisjsewell commented 4 years ago

Moved to an issue thanks @mgeier

chrisjsewell commented 4 years ago

here don't seem to be any "intense" colors when switching to "bold"

this is just because I didn't add CSS colors specific to bold

It doesn't seem to support "underline" and "invert",

Yeh I didn't know about these

don't currently have the energy to do it yet again.

Thats ok, I'll put it on the back-burner until someone starts asking for it

Why not just use nbconvert's implementation?

Because using pygments is a better conceptual design, and more consistent with the rest of the sphinx build process