-
Notifications
You must be signed in to change notification settings - Fork 572
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable ANSI underline and inverse #696
Conversation
You're going to have to give a lot more context than just saying it is a companion. What is the purpose of this particular change? Please explain for those who will need to debug this in the future. Note: you made an API breaking change, these are private methods but still… we try to avoid breaking APIs. Why does it need to be a positional argument? You removed some documentation, is that documentation wrong? If it is, is it that the functionality should change or the documentation should change? I am not a fan of the multiple lines of documentation that describe different pieces of functionality. Please break them up into individual lines for the individual code definitions. |
@mpacer Thanks for the feedback!
I wanted to wait for feedback on the
Do you mean here in the Github comments or somewhere in the code docstring/comments? The purpose is in the title of this PR. The
Yes, since #259.
The functionality did change in #259 and the documentation should follow suit at some point.
I don't understand what you mean by that. It would probably be best to get rid of most of the documentation, because it will not be as accurate as the code anyway, and it is very likely to fall out of sync (which it already did). What about removing the description about the actual codes from the docstring and instead adding a few comments in the code where it is not obvious what certain codes do? |
I forgot to address this:
It doesn't need to be a positional argument. I can make it a keyword argument if that's what you want, but it won't really help. The problem is that I'm calling the converter functions with one more argument in But as you say, those are private functions. And I made them private intentionally. They are only there as an implementation detail for internal code re-use and they are not meant to be used externally. In the future, we might even add more ANSI formatting, which will require further "breaking" changes. |
jupyter/notebook#2967 was merged, I've updated this PR accordingly: 006153c I don't know when/how the new CSS classes from the |
This will work once jupyter/nbconvert#696 is available.
@mpacer Ping? |
I think this looks OK, and I'm not worried about changing the API of these private functions. Can you add a few tests for the new functionality in |
I've shortened a docstring (a6e4ba2) as mentioned in #696 (comment). And I've added some test cases in e443e85. What about the new CSS classes? |
e443e85
to
197dcee
Compare
I've changed the last commit to avoid a problem with Python 2.x and |
Grant is getting ready to release notebook 5.3 in the next couple of days, which will include your PR jupyter/notebook#2967 . Once that's done, you can update the version of the notebook it gets the CSS from in |
Thanks! @mpacer do you want to have another look at this before we press the green button? |
Ping? |
fe17cf1
to
4bc6c2e
Compare
I've rebased this PR onto |
@@ -61,6 +64,7 @@ def test_ansi2latex(self): | |||
'hello\x1b[01;34mthere': r'hello\textcolor{ansi-blue-intense}{\textbf{there}}', | |||
'hello\x1b[001;34mthere': r'hello\textcolor{ansi-blue-intense}{\textbf{there}}', | |||
'\x1b[1mhello\x1b[33mworld\x1b[0m': r'\textbf{hello}\textcolor{ansi-yellow-intense}{\textbf{world}}', | |||
'he\x1b[4mll\x1b[24mo': 'he\\underline{ll}o', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it convenient to test the conversion of inverted mode to latex as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a bit unwieldy, but why not: dab9596
Thanks! |
This will work once jupyter/nbconvert#696 is available.
This is a companion PR to jupyter/notebook#2967.