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

customize display of line numbers in code-block #651

Merged
merged 2 commits into from
May 5, 2022

Conversation

12rambau
Copy link
Collaborator

@12rambau 12rambau commented May 4, 2022

Fix #260

I don't like unclosed issues so I was scrolling in the repository to find small stuff that could be updated. I think some adjustment could be beneficial for the code-block directive when it come to line numbers.

The normal implementation place the numbers super close to the code and in the exact same color, making it a bit difficult to read.

Capture d’écran 2022-05-05 à 00 06 01

With this PR I simply add a small padding to the line-number and dim the opacity so that they have less contrast than regular code (in short as in any good IDE).

Capture d’écran 2022-05-05 à 00 04 58

Let me know what you think.

@choldgraf
Copy link
Collaborator

I think the design is nice, though it seems to not work on all code blocks? e.g. here: https://pydata-sphinx-theme--651.org.readthedocs.build/en/651/demo/kitchen-sink/paragraph-markup.html#code-with-sidebar

@12rambau
Copy link
Collaborator Author

12rambau commented May 5, 2022

I think the design is nice, though it seems to not work on all code blocks? e.g. here: https://pydata-sphinx-theme--651.org.readthedocs.build/en/651/demo/kitchen-sink/paragraph-markup.html#code-with-sidebar

there was a simple typo, should be solved now

Copy link
Collaborator

@choldgraf choldgraf left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@choldgraf choldgraf merged commit bc40229 into pydata:master May 5, 2022
@12rambau 12rambau deleted the lineos branch May 5, 2022 11:17
@jarrodmillman jarrodmillman added this to the 0.9 milestone Jun 2, 2022
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

Successfully merging this pull request may close these issues.

Line numbers render badly on code snippets
3 participants