Commit graph

1216 commits

Author SHA1 Message Date
jenkins-bot 8824036ea9 Merge "Remove unused directionality styles" 2021-01-15 21:39:34 +00:00
jenkins-bot 003c86028e Merge "Add mw-content-ltr/rtl classes to inline snippets" 2021-01-15 21:31:33 +00:00
jenkins-bot fe7e9f77e4 Merge "Remove -o-tab-size rule, no longer required by Grade C browsers" 2021-01-15 21:31:31 +00:00
Ebrahim Byagowi e5238a17a8 Line numbers use mw-content-ltr/rtl direction
Content blocks always output a directionality class. It defaults
to LTR as most code is LTR, but it is allowed to set it to RTL
by adding a dir attribute to the <syntaxhiglight> block.

Use this class to do CSS flipping instead of CSSJanus, as this
class indicates the direction of the code.

Bug: T271792
Change-Id: I084550c2775febf13596addfb3598d6ae1afa2db
2021-01-15 17:34:16 +00:00
Ed Sanders c895f1c9e4 Remove unused directionality styles
* direction:ltr default is not required as every block
  gets an mw-content-ltr/rtl class and dir=ltr/rtl attr
* float rules for line numbers are no longer used as
  they are now position:absolute

Change-Id: I417ae969bf969b7cb25fbcf9ca3b1457c7bc6549
2021-01-15 17:34:16 +00:00
Ed Sanders 2d3af74c39 Add mw-content-ltr/rtl classes to inline snippets
We already add the dir=ltr/rtl HTML attribute so this
should be a no-op and makes it consistent with block
snippets.

Change-Id: I53e9204cc3bd54ba167f6f91e718a9d35b5bdfd0
2021-01-15 17:33:15 +00:00
jenkins-bot 4df77c1138 Merge "De-emphasise line numbers" 2021-01-14 17:40:36 +00:00
Ed Sanders 63c5943a9f Don't try to highlight elements not in a code block
The 'hll' CSS only targets the .linenos selector, but it doesn't
hurt to avoid unnecessary DOM changes.

Change-Id: Ic7134619606c6e4abc2480ddc9650d0352fc33da
2021-01-13 20:47:41 +00:00
Ed Sanders 8f09ace86b Don't throw an error when location.hash in unparseable
Bug: T271572
Change-Id: I50e5593272c0039c32019e5fdcb2c79465229cf0
2021-01-13 20:39:10 +00:00
Ed Sanders 76fd10659b Remove -o-tab-size rule, no longer required by Grade C browsers
Change-Id: I5d8ca364f96872a6a7da925b6d6cbebf35b7e523
2021-01-13 17:14:57 +00:00
Ed Sanders 8d645a385c De-emphasise line numbers
Use the darker text color for hovered/selected lines.

Bug: T271956
Change-Id: Icc6dce48a2e5720807309a47f84d8c2a7552a4f6
2021-01-13 16:55:02 +00:00
Umherirrender ecbc374f7d build: Run stylelint also for less files
no-descending-specificity:
Expected selector ".mw-highlight.mw-content-ltr .linenos" to come before
selector ".mw-highlight a:hover .linenos"

Change-Id: Ib8bd3dcc83058c6935b6b6c472554e3c1fa01eda
2021-01-10 13:40:20 +01:00
Translation updater bot 9ddd742ad7 Localisation updates from https://translatewiki.net.
Change-Id: I19dd2d2705dc3c35cd034625dd42f5a64a6128ae
2021-01-04 08:44:50 +01:00
Ed Sanders 16af4f3c6b Register VE module unconditionally
Change-Id: Ifccc0223c2b57c0de6f6c14355850213b090f8fb
2021-01-03 00:25:21 +00:00
Ed Sanders 583e3b3db8 Add support for line anchors on code pages
Bug: T29531
Change-Id: Ic09086c19d37bdff8bb7e68bbb0f676ef87896fe
2021-01-03 00:19:13 +00:00
Ed Sanders ef196f31ff Fix positioning of line numbers in VE
Change-Id: I349e80d8ad96e240ecb7afcb43dafdd72a76a308
2021-01-03 00:19:13 +00:00
Ed Sanders 0aec99f386 Extend highlight into line number gutter
Change-Id: I8947dc11dc671c44db084287ff1b3fe497eaa25b
2021-01-01 19:55:06 +00:00
jenkins-bot d1c0acf718 Merge "Move all HTML wrapping into #highlight" 2021-01-01 18:52:10 +00:00
Ed Sanders e8add72d66 Move all HTML wrapping into #highlight
This means all callers to #highlight get code wrapped
in the correct HTML.

This was done outside of #highlight before as the transformation
depended on $parser, so optionally pass in a $parser object if
the contents are going to go through the parser.

Change-Id: Ic5d5c341687e965804cb33da07dda23913718ff5
2021-01-01 18:27:29 +00:00
Ed Sanders d3b4227ed4 Fix selector specificty for Minerva
Bug: T270989
Change-Id: I55d6735002247b228b7c2a7406d684496b0b7f00
2021-01-01 16:42:55 +00:00
Ed Sanders 10ec5067c5 Enable line numbers on code content pages
Bug: T32773
Change-Id: I2eb8dcfe4d7bf751f998e1b2dd26a23cce69bf34
2020-12-30 21:35:05 +00:00
Ed Sanders 98c644a639 Improve appearance of line numbers
* Render a solid gutter that can take 3-4 digit line numbers
* Position line numbers absolutely in the gutter
* Add padding to code so that it doesn't wrap into the gutter

Change-Id: I7abb87452ad61808dad32b41c1d2d86b8ababb28
2020-12-30 21:35:04 +00:00
Ed Sanders fe357519c7 Add correct classes to full page output
Previously the full page output was missing the
-lang-<languagename> and mw-content-<dir> classes.

Change-Id: I54f4ed0a86e78a3a7ff1d670ebbdfdb6f05f86cc
2020-12-30 20:31:38 +00:00
Ed Sanders f2ef11144a Display line numbers as generated CSS content
This makes them unselectable in more browsers as the
user-select fix isn't supported everywhere (e.g. Safari).

Bug: T32773
Change-Id: I274632a1055e1f85679fbb29c81629104cc8b222
2020-12-30 19:43:03 +00:00
Ed Sanders 6e558b37db Add small gap between line numbers and code
Change-Id: Ie65128872f318a42677e52420338684ad8d814f8
2020-12-30 19:43:03 +00:00
Ed Sanders 9c0e82878e Fix classname lineno->linenos
Bug: T270296
Change-Id: Ia11c2f13161bfd5b8c1c7e898416373202736c76
2020-12-30 19:43:00 +00:00
Ed Sanders 62cd4384ba Convert pygments.wrapper.css to LESS
Change-Id: I3b221a146528cfc328666da40f99f3132d0ac700
2020-12-30 15:31:33 +00:00
Translation updater bot 721cb16354 Localisation updates from https://translatewiki.net.
Change-Id: I3b00fc665b25ebaa3d5694332dda8dd78f685bff
2020-12-28 10:40:05 +01:00
Translation updater bot 59d8716af0 Localisation updates from https://translatewiki.net.
Change-Id: I9190bfb6c7ac4a65366ef2fe0391b9164d571155
2020-12-22 08:32:48 +01:00
Translation updater bot 8426bec5ef Localisation updates from https://translatewiki.net.
Change-Id: I3e9aa900c14138c6481304e46b40b1bc1483d849
2020-12-21 08:40:11 +01:00
libraryupgrader f50b52c97c build: Updating mediawiki/mediawiki-phan-config to 0.10.6
Change-Id: Ib2c418aa6d8d110d579e376566579ccf118825ec
2020-12-20 03:24:51 +00:00
libraryupgrader 322024dc4e build: Updating dependencies
composer:
* mediawiki/mediawiki-phan-config: 0.10.4 → 0.10.5

npm:
* ini: 1.3.5 → 1.3.7
  * https://npmjs.com/advisories/1589

Change-Id: Ifdf41f7187ce3b1003b8756a5afb5af0033c04a0
2020-12-11 10:41:33 +00:00
Translation updater bot 09c2dd66e4 Localisation updates from https://translatewiki.net.
Change-Id: I7976b85cfb75f328b9ca09dea30bad694a2c6227
2020-12-09 08:42:33 +01:00
Translation updater bot 88ec1a1fbb Localisation updates from https://translatewiki.net.
Change-Id: I6eb1219e83d33b508106cc3a10690e0dedededc3
2020-12-07 08:47:38 +01:00
libraryupgrader 4dd9dcaa54 build: Updating mediawiki/mediawiki-codesniffer to 34.0.0
Change-Id: Ia9812baa9f91990cfbe30135df161ea9c8d4f106
2020-12-07 03:00:20 +00:00
Translation updater bot da0798325e Localisation updates from https://translatewiki.net.
Change-Id: I12e91a3d4e98c9864221b74b7cebba908ce9b3c6
2020-12-04 08:34:07 +01:00
jenkins-bot d6d2231eb3 Merge "create_pygmentize_bundle: use pypi's JSON API" 2020-11-24 04:12:50 +00:00
Ori Livneh d2e9809554 Update pygments to 2.7.2
Changes:
  <https://github.com/pygments/pygments/blob/2.7.2/CHANGES#L15-L158>

The 2.7.2 release contains fixes to existing lexers, as well as the
following new lexers:

  arrow, bare, devicetree, dmesg, dts, execline, fstar, gd, gdscript,
  ipython, ipython2, ipython3, ipythonconsole, kmsg, llvm-mir,
  llvm-mir-body, miniscript, mosel, ms, peg, pointless, promql, psysh,
  raku, reason, reasonml, ride, sieve, singularity, tid, tnt, usd, usda,
  webidl, and yang

To verify the integrity of the pygmentize binary, you can run
'create_pygmentize_bundle' and verify that the same pygmentize file is
created.

Change-Id: I0be3c1c204237b4a8873063e282be7ab8655be9d
2020-11-23 22:16:20 +00:00
Ori Livneh 4f46b00108 create_pygmentize_bundle: use pypi's JSON API
The old XML-RPC API is considered deprecated and is now rate limited,
such that making two queries in quick succession (like this script does)
hits the limit. Fix by using the JSON API.

While we're here, use the SHA256 sum instead of MD5.

Change-Id: Ib2156649e234d974cc4fc75807a5d140aa99bd44
2020-11-23 14:06:42 -08:00
libraryupgrader 0c669a0acc build: Updating npm dependencies
* grunt-stylelint: 0.15.0 → 0.16.0
* stylelint-config-wikimedia: 0.10.1 → 0.10.3

Change-Id: Ib26cb5e70a26c64c21580fc9d57fb082e68e6da8
2020-11-22 10:44:04 +00:00
libraryupgrader 3727a802f2 build: Updating mediawiki/mediawiki-phan-config to 0.10.4
Change-Id: Id8840c4a5d6155a4d57e649e4f80af11211f1ffd
2020-11-20 19:41:32 +00:00
jenkins-bot ddf1c650ff Merge "Fix versions in README" 2020-11-18 00:26:04 +00:00
libraryupgrader 01287f51bc build: Updating mediawiki/mediawiki-codesniffer to 33.0.0
The following sniffs are failing and were disabled:
* MediaWiki.Commenting.PropertyDocumentation.MissingDocumentationProtected

Change-Id: Ibbd5bd7aa4040517ce46ab8bba3db19aa9237793
2020-11-04 13:13:42 +00:00
Translation updater bot 612c9d2b21 Localisation updates from https://translatewiki.net.
Change-Id: Ic9ae33701c1a40e16c62df4bbb036acad9d28123
2020-11-02 08:53:55 +01:00
Translation updater bot ab9b4bb429 Localisation updates from https://translatewiki.net.
Change-Id: I1784d5a5f71b9bbfcd6d62735ab8859582562336
2020-10-26 08:32:15 +01:00
Translation updater bot dac457f55b Localisation updates from https://translatewiki.net.
Change-Id: I5311ac3dbcb35d98273ccd2ea167864927d6deb3
2020-10-22 08:31:41 +02:00
Freephile 24d418bced The word Python was misspelled
Change-Id: Icb38cd1cc07d2a2be95cdf3254502af0417afdf8
2020-10-07 17:30:05 +00:00
Reedy 005442046d Fix versions in README
Change-Id: Iea1503eb7378a28d68ba8a30a76616b8077e1c11
2020-10-06 18:10:18 +01:00
libraryupgrader 720096b77f build: Updating mediawiki/mediawiki-phan-config to 0.10.3
Change-Id: Ic8682084991007cabfa600607247c1ff76747623
2020-09-25 10:28:31 +00:00
Reedy 0f876f17b1 Fix PSR12.Properties.ConstantVisibility.NotFound
Bug: T253169
Change-Id: Ibbf708a030504b1db61050cd2ef05280e9d52f2d
2020-09-19 12:11:07 +01:00