Commit graph

63 commits

Author SHA1 Message Date
Moritz Schubotz (physikerwelt) 11dc0e4b97 Add MathJax rendering option
When collecting user feedback regarding the native
rendering option on the German Wikipedia (T346795)
it became apparent that some power users aim for bigger
and bolder fonts and a more LaTeX-like layout.
MathML, however, aims to format math as an integral part
of the text with uniform fonts and spacing.

To match both user needs, this patch adds a new rendering
option that uses client-side MathJax (without a need for
restbase or mathoid).

* Adjust MathJax`s loader to be compatible with the mw loader
* Add new rendering mode
* Copy MathJax source to resource module as foreign repo

Bug: T354136
Change-Id: I1ecf9c77fefc3b0f717107d81979276023f6cb84
(cherry picked from commit 277663b822)
2024-06-24 00:03:07 +00:00
Reedy 702c6a1382 Cleanup SpecialMathWikibase WikibaseClient availability
If the Special Page is removed in onSpecialPage_initList, it
is not accessible, so the same logic that is duplicated in
SpecialMathWikibase is redundant.

Remove math-wikibase-special-error-no-wikibase, but leave
math-wikibase-special-error-header because it's used for another
error too.

Change-Id: I62d67a6f39591cc3c8d3b1af80380a6c758ff44f
2024-04-08 14:33:40 +00:00
Mormegil 4827a772f0 Fix typo in math-form-type-chem help message
`H20` is not water, `H2O` is.

Change-Id: I90deeaaaa0d416e639069b66e44ad85f196a63b0
2024-04-04 14:19:29 +02:00
Moritz Schubotz (physikerwelt) 4d42d55ab2
Remove color from test result messages
Bug: T360730
Change-Id: I0861d8ae1d6f7c2c0cdbb86135200a1916b3aa3a
2024-03-22 19:11:13 +01:00
Moritz Schubotz (physikerwelt) 8c4a60f08f Replace _s with -s in i18n math mode strings
Bug: T360176
Change-Id: Ibcadd60428d61afb34700455d4c2550f7e24cc43
2024-03-15 17:27:56 +00:00
Jon Harald Søby b6cb7ff1ec Use message for help page name instead of enwiki-internal shortcut
Change "wp:MATH" to instead use another message, and define a help
page name for math formulae in that other message.

Change-Id: I3fa1e9f4442887915709a2fec671f1ebdb1fc300
2024-01-16 21:33:15 +00:00
Jon Robson b99c3800d0 Should be possible to disable the Math preview
Bug: T334261
Change-Id: I46e7641d22f4c17ba318a106a62518e4ca3e3c55
2024-01-11 18:53:09 +00:00
Amir E. Aharoni 907e29ebb2 Improvements for math-form-type-* messages
* Add keys to comments for greppability
  (see https://www.mediawiki.org/wiki/Help:System_message#Using_messages
)
* Add <code> for good display of TeX code.

Change-Id: If306c2473accd34ff13c0282e2a8b1b64b6c1657
2024-01-09 10:46:17 -05:00
Moritz Schubotz (physikerwelt) 6db2a4c87e
Special:MathStatus Add form for custom input
Allow running tests with custom user input.

Bug: T351368
Change-Id: I148ac88513906042dc1aebe7a637180333d32016
2024-01-06 10:41:01 +01:00
Ed Sanders 01746a108c ve-mw: Remove unused i18n messages
Change-Id: Ibb1535e98aecc39656783471ad938000b1b32735
2024-01-02 16:32:27 +00:00
Moritz Schubotz (physikerwelt) 88a4c8bc1d
Add minimal native MML mode
* Add minimal POC for native MathML rendering.
* (minor) convert string-based reference to MathConfig to proper access
  method.

Missing:
 *  Error handling
 *  Image fallbacks

Bug: T331047

Change-Id: I7e644c4688cca7fc9af0d54bdc260268c1f6b9df
2023-03-02 20:50:29 +01:00
Moritz Schubotz (physikerwelt) 110656335f Remove PNG rendering mode
Removes functionality to
* select PNG rendering mode
* automated fallback to PNG images for SVG rendering
* PNG mode related class and tests

However, PNG images received from mathoid / restbase are still stored.

Bug: T311620
Change-Id: I595926027433182cc0396570bc3f1ce0cd2cafb3
2022-11-21 18:57:27 +00:00
Moritz Schubotz (physikerwelt) 3d979336bb
Improve description of default rendering mode
The description of the default rendering mode mw_math_mathml is misleading.
Without browser plugin users never see MathML, but SVG images.

Especially in preperation to the transition to native MathML rendering,
this should be corrected.

Bug: T310211
Change-Id: I6d3c1588105cc7ebe7433a299108deacfecd61aa
2022-06-08 20:18:53 +02:00
Fwolz 74bd7c4730 Add text field in VE to change QID
Makes it possilbe to change the QID of a formula in the visual editor
quick editor and in the dialog editor inside the options panel.

Change-Id: Ie4cb651939a59bf4446cd3e5327522d100eac5bf
2022-06-01 12:27:43 +02:00
libraryupgrader 79a7324eed build: Updating dependencies
composer:
* mediawiki/mediawiki-codesniffer: 34.0.0 → 35.0.0
  The following sniffs are failing and were disabled:
  * MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPrivate
  * MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected
  * MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationPublic
  * MediaWiki.Commenting.PropertyDocumentation.WrongStyle

* mediawiki/minus-x: 1.1.0 → 1.1.1

npm:
* eslint-config-wikimedia: 0.17.0 → 0.18.1
  The following rules are failing and were disabled:
  * no-useless-escape

Additional changes:
* Added the "composer phan" command to conveniently run phan.

Change-Id: I1c641a4945f94337ca22763920601400ee9ab691
2021-02-06 12:19:19 +00:00
MarcoAurelio be3a3f427f i18n: Fix typo 'occured'
Bug: T201491
Change-Id: Idcaa4c1b42f62e2f001a336b4a1fbc7cba46b47f
2020-09-10 18:08:54 +01:00
Moritz Schubotz (physikerwelt) 9dad688f44 Add tracking category for pages that use a deprecated LaTeX syntax
Discussions in the Wikimedia Math Community show that there is consensus
to deprecate the use of MediaWiki specific LaTeX macros that conflict
with LaTeX macros from commonly used packages.
In this change, we show the deprecation warnings generated by mathoid.

Bug: T197842
Change-Id: I24dbb446665fdc227d0e7342fdbf8829b4c1bda4
2020-03-30 21:56:58 +02:00
Amir Aharoni 67108480b3 Move API messages to a separate file
Bug: T189982
Change-Id: I3155ef30739ec343c011c57525757de8ab3fe35a
2019-11-25 17:51:19 +01:00
AndreG-P 2b15b37a3a Fix Typo in Math Extension
Fix 'forumla' typo in i18n/en.json entry 'math-wikibase-special-
form-placeholder'.

Bug: T238534
Change-Id: Iaa109937d531923e8c0567aacdb9c2bbb2ba32a6
2019-11-19 02:07:54 +09:00
Moritz Schubotz (physikerwelt) 4a7bc3ee31 Add special page and API endpoint that show information from math Wikibase items
Add a special page and an API endpoint to fetch data from Wikibase
items with a given qID. The special page summarizes information from
Wikibase. The API endpoint allows to request the information
directly. Both, the API endpoint and the special page, fetch the data
from a new helper class for consistency.

Bug: T208758
Bug: T229939
Change-Id: Idd22057a88312bf1a1cb5546d0a6edca5678d80d
2019-11-14 23:42:35 +09:00
Moritz Schubotz (physikerwelt) 0a4773e7de
Remove unused i18n messages
Bug: T210948
Change-Id: Ie758e1a47b347a56a03b240f01904d994eb18fc6
2018-12-02 17:59:37 +01:00
jenkins-bot 817ada2cf1 Merge "Add tracking category for deprecated mhchem syntax" 2018-11-09 12:19:12 +00:00
James D. Forrester 428f5a847b Drop support for MediaWiki core's removed "2006 wikitext editor"
Change-Id: I59bad8faee3f0f998344f985eb675087533d3d8f
2018-11-06 17:19:43 -08:00
Moritz Schubotz (physikerwelt) a865a8565a
Add tracking category for deprecated mhchem syntax
Gets warning information from restbase and adds tracking categories
for deprecated chemical syntax.
Refactor mechanism to add tracking categories, and avoiding rechecking
already checked formulae.

Depends on: Ieca66f45ae7685d61eece1624bd7ff65ccad2eaa
Change-Id: I10e78ab79015dc1331f645c60b25bbbd237e23fe
2018-10-27 20:38:02 +02:00
Umherirrender fc2d573028 Add config for tracking category math-tracking-category-render-error
The tracking category was added with
If7537ed9117fb736a09f4396b7d55d774ce9674f

Bug: T173371
Change-Id: I6cdcfa0ece8e2b2644106bc219b538702b0bb2d8
2017-08-16 16:35:40 +00:00
Amire80 4784fbad35 Remove MathJax messages from en.json
Bug: T165475
Change-Id: I60a63c68552d3a9333c8a099c8893179739149ba
2017-05-16 14:03:59 +03:00
Amire80 8674fdd47b Correct "operators" message in chemSymbols.json
Follow up to
I4452ceca55197fda5f1e1293a5741c6f5fb7c245

Change-Id: I061180179da83a7ad1229999ed97a783777bcfed
2017-02-23 19:34:54 +00:00
Amire80 848d762e24 Add support for chemical formulae in VisualEditor
The chemical and mathematical formula inspectors and dialogs
have a lot of similar functionality, and the common parts are
now moved to the common MWLatex class.

MWMath* classes now inherit from MWLatex*, and so do
the new MWChem* classes.

Bug: T153365
Change-Id: I4452ceca55197fda5f1e1293a5741c6f5fb7c245
2017-02-19 18:36:26 +00:00
Moritz Schubotz 14ec229cf9 Add tracking category for math errors
Bug: T134872
Change-Id: I6d0bce34aacfba27bedda23f6395001dae9c6568
2016-06-06 12:06:22 +00:00
IoannisKydonis 9e10e9cc82 Add PLURAL in math-status-introduction
Thread:
https://translatewiki.net/wiki/Thread:Support/About_MediaWiki:Math-status-introduction/en

Change-Id: I3a41a446001cf35c3dc0cac4025ae8fc64a3c9e4
2016-01-20 18:40:00 +02:00
Thiemo Mättig 5563cda43d Change TeX to LaTeX in all messages
Change-Id: I43257064bc1a29bc3c1a44d5413ed3e183ad933b
2016-01-15 23:17:27 +00:00
Thiemo Mättig f1ac24db06 More human readable name for the Wikibase type "math"
As requested by Lydia. Personally I do support this change.

Change-Id: Ia5b7a96322bb41d1d78d483f0606e3a310cd8387
2016-01-14 12:44:11 +01:00
Thiemo Mättig (WMDE) 9625dbc8e5 Revert "Fixup: Datatype has prefix PT"
This reverts commit 0add158294.

See \Wikibase\Lib\DataTypeDefinitions::getValueTypes. The
prefix is not part of the message key. If it is, this is a
bug and should be fixed.

Change-Id: I214d71a8f1c8de751e464924f75d0458e29f2514
2016-01-12 15:23:29 +00:00
physikerwelt 0add158294 Fixup: Datatype has prefix PT
Change-Id: Ic16ca72f570633a6d008e335d9e82b5bea1d94d8
2016-01-12 15:48:12 +01:00
physikerwelt 5d4fdaf852 Add i18n description for datatype math
Change-Id: I499beb33141d0a9c124db0ac11428544c766adc2
2016-01-12 14:43:24 +01:00
Thalia 5fe280c3cf Allow users to choose math inspector or math dialog
The context item for math nodes now has two edit buttons,
one for the inspector (edit inline) and one for the dialog
(edit). Creating a new math node automatically opens the
dialog.

Bug: T120382
Change-Id: Icd3ec75262fcc5e0cbc304051c651278b0d8b01c
2016-01-04 08:20:16 +00:00
Thalia 6e73aaf86c Make math dialog with clickable list of formula fragments
The main components are:
- a menu of formula fragment buttons
- an ace editor text input into which LaTeX commands are
inserted on clicking the buttons
- a preview of the formula

The deviations from the draft design (full-width menu,
smaller buttons, dialog is 'larger' instead of 'large')
are so that more buttons can be seen at once.

Depends on Ia0f46da2d4 in ve-mw
Depends on Ib75fb7b087 in ve-mw
Depends on I758f90abb9 in ve-mw
Depends on Ibcd941d938 in CodeEditor
Depends on Ie814f59086 in oojs-ui
Depends on If540670bf2 in oojs-ui
Depends on I5f70f133b7 in ve core

Bug: T114163
Bug: T118617
Bug: T118618
Change-Id: I96d4b72f2e49ad3f43a2e5c71f0d348fdfb35503
2015-11-23 16:30:38 -08:00
Thalia eac71ab60f Add tool to create SVG files of LaTeX symbols
Also produces a CSS file for the symbol buttons, using the
SVG filenames. Gets the list of symbols from symbols.json.

Bug: T118660
Change-Id: Iaa792418d870a7e266b6455ef037994e31278278
2015-11-19 04:11:59 +00:00
jenkins-bot cd65aa0e13 Merge "Add en.json credits" 2015-08-01 17:14:08 +00:00
jenkins-bot f1ecf1410e Merge "Remove double space in a message" 2015-08-01 14:27:14 +00:00
Amir E. Aharoni 01fb7d0736 Remove double space in a message
Change-Id: I67e529e974c19b182a8ce981ea31c19adfb0c917
2015-08-01 12:13:41 +03:00
Amir E. Aharoni 629d9541fb Add en.json credits
Using `git blame` and `git shortlog -s -n`
on en.json and Math.i18n.php.

Change-Id: I942748b68cd707d19308e048e3b2c835ed8473fb
2015-08-01 12:11:19 +03:00
Amir E. Aharoni efc8e845f8 Add full stop to a message for consistency with a similar message
Change-Id: I2a5251286c9522688c842785089390045fe9d3ae
2015-08-01 12:10:12 +03:00
Amir E. Aharoni 992f781c88 Convert spaces to tabs in en.json
According to the usual i18n json convention.

Change-Id: Ic288f4dbf12d9c3bc04e28cb5cb64f153cdc76b5
2015-08-01 12:06:41 +03:00
physikerwelt 40c6bb69af Add info about failed tests to MathStatus
* Prints expected and real results for failed tests.
* Adopts to the new LaTeXML naming conventions.

Bug: T94434
Change-Id: I72bc6df7e9a85ae5c14cc7f82df072adfa65b67e
2015-07-31 08:40:00 +00:00
James D. Forrester ce0a32532d Delete unused <math-preference*> i18n strings
These i18n strings stopped being used in this repo by 60411b9a, but
were not removed then as an over-sight. Deleting only the en and qqq
messages as normal, and letting the TWN bot delete the others.

Change-Id: I86e1a09f3ddcc2e558a4f04a606cc26ab379d05e
2015-07-03 13:28:35 -07:00
physikerwelt 47aef55b48 Plural support for MathStatus page
Bug: T94546
Change-Id: I431abc2c2690b24d75d30a15ce6430f0c31b3103
2015-04-13 21:48:55 +03:00
physikerwelt d2045ac9a4 Improve layout of Special:MathStatus
Bug: T94434
Change-Id: Ib723c80642d432b7eac66fc18a316aaae026e884
2015-04-06 13:32:45 +00:00
physikerwelt (Moritz Schubotz) 6889086753 Move integration tests to a new special page
The integration tests depend on the presence of external servers
and the user settings.
First, people are bothered by  failing test due to problems with
those servers and second, administrators need to run phpunit tests
to verify the configuration settings.
Therefore, we move the integration tests to a special page.

Bug: T87389
Change-Id: If66f13fe7fa16868cd4b1d8f0e0a6e3d49448b27
2015-03-30 11:47:31 -04:00
Chad Horohoe eab415ef71 Math: tidy up error message handling
- We don't localize errors and debug logs like this, it makes them
  impossible to decipher
- Also remove some 1.21 and below back-compat while we're here

Change-Id: Idb23fe5b434fa9fa3518672d57ec6e5466d005ac
2015-02-19 16:22:46 -08:00