Currently,
https://wikimedia.org/api/rest_v1/media/math/ lists the following endpoints:
- Figure out if it is possible to redirect requests made to https://wikimedia.org/api/rest_v1/media/math/ to new MW-Rest endpoints via a proxy so that the process is transparent to the user. @daniel
- check/{type} Example curl -v -d 'q=E=mc^2' https://wikimedia.org/api/rest_v1/media/math/check/tex returns {"success":true,"checked":"E=mc^{2}","requiredPackages":[],"identifiers":["E","m","c"],"endsWithDot":false} with the header x-resource-location: 4c0004393a88f350a93bcef62106d556c7fc827b https://github.com/wikimedia/mediawiki-extensions-Math/blob/master/src/InputCheck/MathoidChecker.php is the implementation that gets respective information from mathoid backed by a WAN cache.
- Check if the cache key is exactly the same as it used to be and determine if it needs to be exactly the same.
- Implement tests for successful and failing examples
- formula/{hash} example curl https://wikimedia.org/api/rest_v1/media/math/formula/4c0004393a88f350a93bcef62106d556c7fc827b
returns {"q":"E=mc^{2}","type":"tex"} so it can be extracted from the same WANCache
- figure out if this endpoint is used
- render/{format}/{hash} example https://wikimedia.org/api/rest_v1/media/math/render/mml/4c0004393a88f350a93bcef62106d556c7fc827b returns
<math xmlns="http://www.w3.org/1998/Math/MathML" display="block" alttext="E=mc^{2}"> <semantics> <mrow> <mi>E</mi> <mo>=</mo> <mi>m</mi> <msup> <mi>c</mi> <mrow class="MJX-TeXAtom-ORD"> <mn>2</mn> </mrow> </msup> </mrow> <annotation encoding="application/x-tex">E=mc^{2}</annotation> </semantics> </math>
- Refactor https://github.com/wikimedia/mediawiki-extensions-Math/blob/master/src/SpecialMathShowImage.php to get content from hash independent of the special page
- Develop the endpoint based on the to be created special page backend