Skip to content
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

Code-blocks with line nos - lines and line numbers don't line up. #419

Closed
TonyFlury opened this issue May 3, 2017 · 2 comments
Closed

Comments

@TonyFlury
Copy link

Using the rtd Theme with this source :

.. code-block:: python
    :linenos:

    import tkinter as tk
    root = tk.Tk()
    w = tk.Label(root, text='Hello, world!')
    w.pack()
    root.mainloop()

The resultant rendered page has this :

mismatch

@TonyFlury
Copy link
Author

TonyFlury commented May 3, 2017

It seems to be that the line nos are rendered with a line height of 1.5 - and generated html seems to also state the same line height value for the code, but there seems to be a clash between the line heights set in the theme :

These two CSS rules get appled to the code block

.rst-content .highlight > pre {
line-height: normal;
}

and :

 div[class^="highlight"] pre {
         ....
     line-height: 1.5;
        ....
 }

but the line-height: normal; takes precedence; changing the line-height value in the first rule results in correctly aligining line nos and code.

return42 added a commit to return42/sphkerneldoc that referenced this issue Jun 15, 2017
ref:  readthedocs/sphinx_rtd_theme#419

Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>
return42 added a commit to return42/boilerplate that referenced this issue Jun 15, 2017
Signed-off-by: Markus Heiser <markus.heiser@darmarIT.de>
@Blendify
Copy link
Member

This is a duplicate of #417

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants