-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Refactor math_symbol_table.py to dynamically determine column number #30105
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
base: main
Are you sure you want to change the base?
Refactor math_symbol_table.py to dynamically determine column number #30105
Conversation
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join us on gitter for real-time discussion.
For details on testing, writing docs, and our review process, please see the developer guide
We strive to be a welcoming and open project. Please follow our Code of Conduct.
679cb47
to
2420e6a
Compare
b726525
to
8fe5cb2
Compare
…for symbol tables(Issue matplotlib#26143) - Remove hardcoded column numbers; now columns are auto-calculated based on symbol length and page width constraints. Future changes to symbol lists require no manual column adjustment.
8fe5cb2
to
76e8873
Compare
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.
Thanks for this @BeiChenStanly. I think this is a nice clean solution and the table renders well for me on both laptop and tablet screen. I just have some minor style comments.
Any chance you can get this working w/ 1-2 columns for cell phones? Also thank you very much for picking this up! |
Can't we defer the column layout to CSS? I'm not an expert in these things, but flexbox with flex-wrap could likely do the job. |
aae40e3
to
5d25f17
Compare
5d25f17
to
9ea11da
Compare
@story645 @timhoffm
Let me know if you have any further suggestions! |
Why if you only apply the css style to the div class for the math table? We have other custom css classes in https://github.com/matplotlib/matplotlib/blob/main/doc/_static/mpl.css |
Apologies, I did not read the issue carefully enough and missed the bit about checking how it responds to window resizing. I think a few potential contributors also missed that so I took the liberty of editing the issue OP to hopefully make it obvious. |
Thank you for your suggestion! The current table styles are provided by the documentation theme, which ensures consistent look and feel (including things like row highlighting on hover, alternating row colors, and compatibility with theme changes) across all tables—certainly not just the math table. While it’s possible to apply a custom CSS class to a This could lead to duplicated effort, potential inconsistencies, and more maintenance if the theme changes in the future. In addition, I’d like to confirm the original intent of this issue, just to make sure we’re on the same page. Is the main goal to:
Thanks again for your feedback! |
The goal is more truly responsive layout, w/ avoiding fixed column size being a kinda of iterative step. One of the ways we get responsive grids in other parts of the docs is by using https://sphinx-design.readthedocs.io/en/latest/grids.html. Is there a way to maybe use that here - have the directive auto generate/populate a sphinx design grid? |
Fixed Issue #26143
PR summary
This PR refactors
math_symbol_table.py
so that the symbol tables in the mathtext documentation dynamically determine the number of columns, instead of relying on hardcoded values.What was changed