-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Remove has_equations
from the mathematics domain
#13044
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.
I think we need a CHANGELOG entry to indicate that a new context data has been added to the context object for the handler and that a publicly named (yet probably not documented) method has been removed from the domain API.
I have a very bad Internet connection so I don't know if I'll be able to review more.
Heya, you do realise this is used by one of sphinx's own extensions 😅: https://github.com/sphinx-doc/sphinxcontrib-jsmath/blob/19763d7fc9ebb29eb2f325fef0bc6f067907a233/sphinxcontrib/jsmath/__init__.py#L70 Calling a method internal, just because it is undocumented, is incorrect; if does not start with an Not saying not to change, but the new means of detection should also be public and documented |
Whilst we are now using this philosophy for new code, I don't think it holds true for old code, where marking names as private was less deliberate. Both cases you cite are effective copies of A |
I think we should restore return (
self.data['has_equations'].get(docname, False)
or any(map(self.has_equations, self.env.toctree_includes.get(docname, ())))
) works well the first time, but I'm wondering if we shouldn't just do has_equations = self.data['has_equations'].get(docname, False)
if has_equations:
return True
has_equations = any(map(self.has_equations, self.env.toctree_includes.get(docname, ())))
if has_equations:
self.data['has_equations'][docname] = True
return has_equations This could at least save re-testing |
The slow bit isn't |
I really think it does; users will not care about your standards, if something is not |
# Conflicts: # sphinx/domains/math.py # sphinx/ext/mathjax.py
Feature or Bugfix
Purpose
When profiling,
MathDomain.process_doc()
takes around 1% of runtime. We can reduce this to ~0.