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

Consistent use of monospaced font #1852

Open
mdhaber opened this issue Jun 3, 2024 · 2 comments
Open

Consistent use of monospaced font #1852

mdhaber opened this issue Jun 3, 2024 · 2 comments
Labels
needs: discussion Needs discussion before an implementation can be made tag: design Items related to design tasks or improvements

Comments

@mdhaber
Copy link

mdhaber commented Jun 3, 2024

I think it would be helpful if code tokens were consistently rendered in monospaced font. For instance, in the documentation of scipy.stats.bootstrap, text that refers to code is rendered in many different styles.

  1. The navigation pane uses proportional font:
image
  1. The scipy.stats table of contents mixes monospaced and proportional font in the function signature:
image
  1. In the scipy.stats.bootstrap page, the title heading uses proportional font:
image
  1. The signature is all monospaced and bold, but some is italicized and some is not:
image
  1. Parameters of the function enclosed in single backticks appear in proportional font with emphasis:
image

(Although this situation may be improved by numpy/numpydoc#525 and linked issues.)

  1. Double backticks result in monospaced font with a gray background and pink text:
image
  1. The names of parameters in the parameter descriptions use bold, proportional font:
image
  1. The type descriptions use bold, italicized, proportional font; double backticks can be used for additional stylization:
image

(Please feel free to add other ways that code appears. I think that the numbers will help us refer to distinct cases as needed.)

This issue could be generalized to be about consistent use of color, boldface, italics, etc..., but I thought it would be best to be a little more targeted here. So my suggestion is that that appearances of code should either all be monospaced or all proportional. My initial motivation is from the perspective of consistency and aesthetics, but I think there is also an accessibility perspective to be considered. Personally, I think that monospacing is a helpful visual cue to distinguish code from other text, so I would prefer that all code be monospaced, but I recognize that there may be arguments in the other direction.

@melissawm
Copy link
Contributor

See scipy/scipy#20890

@trallard trallard added tag: design Items related to design tasks or improvements needs: discussion Needs discussion before an implementation can be made labels Jun 4, 2024
@trallard
Copy link
Collaborator

trallard commented Jun 5, 2024

Hey folks. I know some variation across style weight, colour is intentional (albeit not perfectly executed) to visually differentiate functions from params and the likes.

However I agree there are other further inconsistencies and overall improvements we can make to end up with a more coherent style.

Tagging @isabela-pf and @smeragoel for visibility and so that we can add this to our design backlog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs: discussion Needs discussion before an implementation can be made tag: design Items related to design tasks or improvements
Projects
None yet
Development

No branches or pull requests

3 participants