-
Notifications
You must be signed in to change notification settings - Fork 138
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
The background of spaces within double backticks are not rendered correctly. #130
Comments
Using single backticks is bad form. They are used to indicate a link, not for code formatting. Could you give an example of the awkward formatting? |
Sorry, I thought I had left a link. See for example the rendering of |
Upon further investiagation, the code in 1.7.0 was also |
How does the latest nightly build look after #135? |
Digging into this, it seems PR #81 changed the background color in this segment of code pytorch_sphinx_theme/pytorch_sphinx_theme/static/css/theme.css Lines 10566 to 10574 in 114bdb6
Previously it was pytorch_sphinx_theme/pytorch_sphinx_theme/static/css/theme.css Lines 10522 to 10530 in f04a90e
It seems #135 did the wrong thing and probably should be backed out. I am not sure how actually to fix this and how the scss interfaces with the theme.css file, since the theme.css is checked into git but the CI job seems to regenerate it? @brianjo could you give some guidance? |
I think there is a real mess with the desire to set a different background color for elements. The background should be an attribute of the surrounding |
@lezcano could you change the title to indicate that the problem is specifically the background color? |
Fixed the title. Also, to help testing whether this is fixed, here are two examples of the problem. In: In |
There is no specific formatting for the "literal" nor the "notranslate" classes. I think the path forward would be to define a style for "notranslate" with a background color. This would also cover the code sample with the
|
Would that remove all these Also, note that the background color would need to be different for the two backgrounds that we have, white (default) and grey (in notes and warnings). I think it'd be particularly nice if we used the grey as a background for |
Those come from the way sphinx parses a function signature, and I do not see an easy way to fold those together. The relevant code is in
Sounds reasonable |
Just hit this as well. See |
This seems to be a duplicate of #107, we should close one or the other. |
When one writes code with spaces like
``input = L @ L.T``
this is rendered in a rather awkward asInterestingly enough, this problem does not happen when we write that code in a non-white background, like that from
.. note::
or.. warning::
. See the first warning in https://pytorch.org/docs/1.9.0/generated/torch.svd.htmlWe tentatively solved this in
torch.linalg
by preferring single backticks over double backticks, but when referring to inputs of the function, that we used:attr:`input`
. This has its own problems, as code as the one in the example above has to be written in a rather awkward way::attr:`input`\ `= L @ L.T`
. Things become more difficult when there are several attributes in the expression.It would be convenient to solve the problem with the rendering of the inline code with two backticks in the template to be able to always prefer it over single backticks and the
attr
construction.cc @mattip
The text was updated successfully, but these errors were encountered: