Commit graph

11 commits

Author SHA1 Message Date
bhsd e0af18f99d fix heading style conflict with CM5
CSS classes such as `.cm-mw-section-3` are assigned to the `<pre>` elements in CM5 while to the `<span>` elements in CM6. The heading styles for CM6 should not interfere with CM5, at least for now.

Bug: T355290
Change-Id: I47426a8319e67503014f847fba39891bdf42db5b
2024-01-18 23:53:52 +08:00
bhsd 9826cc906f Line-level styling for section heading
This is merely a CSS hack which seems to work well for me. The only required JS change is to wrap plain text in section heading in a span, the CSS class of which is unused.

Bug: T351686
Change-Id: I17b1f0b7a6fdf9c090309f558349a06ccec4257f
2024-01-09 02:35:51 +00:00
MusikAnimal bbd142c118 mode.mediawiki: rename mnemonic to html-entity and deprecate variants
This removes treating an HTML entity in a template name as a separate
token, and thus deprecates the .cm-mw-template-name-mnemonic CSS class.

In CM6 we have to register tokens for them to show, and this one seems
of little use to begin with. HTML entities should always be styled as a
such, especially in page titles where they are treated post-processing.
i.e. [[&#47;dev/null]] links to [[/dev/null]].

The rename to .cm-html-entity and associated code is to better reflect
what it is. $rarr; is a mnemonic form while &#x2f; is not, but both are
entities.  Deprecations are noted in the README, with the old classes
to be removed later after on-wiki usage has been updated.

Bug: T348019
Change-Id: I1184fb5d7d37084c80af1abd5f3cb5f2091b085c
2024-01-03 21:48:34 -05:00
MusikAnimal 65f9c986f2 mediawiki.less: don't remove font-weight from .cm-mw-strong tokens
Presumably it was always the intention that tokens with the styles
.cm-mw-page-name AND .cm-mw-em should be both bold and italic in links,
without having the CSS rules override each other. As an example:

  '''''[[Bold and italic title]]'''''

Added a note in the README that this will be a new user-facing feature

Change-Id: Iac41e31b7a9cf8683cd5c982c496ff83a092acfb
2024-01-03 16:08:01 -05:00
MusikAnimal c670344851 Implement core MediaWiki stream parser for CodeMirror 6
This is more or less a exact port of the old stream parser, with the big
notable change being that all configuration-related code lives in a
separate class, CodeMirrorModeMediaWikiConfig. A smaller change is that
closing HTML tags that are marked as errors now have the ending '>'
character highlighted red, when it didn't before.

Integration with other extensions and modes is saved for a future patch
(T348684). This means <nowiki>, <ref> and other extension-supplied
markup is not yet highlighted.

The entry point for WikiEditor integration is now at
ext.CodeMirror.v6.WikiEditor.init.js, which needs to first require the
virtual file set via the DataScript (PHP) class. This can't be
integrated into the CM6 code because it needs to be precompiled before
ResourceLoader can use it (T281781).

Known issues, to be addressed separately:

* No support for TagModes / PluginModes (T348684)
* Identical adjacent tokens produce excess markup (T352917)
* Section headings do not have line-level styling (T351686)

Bug: T348019
Change-Id: I8f8a81f362bed60dea14ecde9487a2b0c89225e8
2024-01-02 23:18:32 -05:00
Ed Sanders 21c121b898 build: Update linters
Change-Id: I49eb2de402a8c89065968cf927a2ca6a361ca684
2023-09-13 14:02:43 +01:00
Volker E ba64a52368 styles: Replace mentioning of WikimediaUI Base and add skin variables
It makes no difference to directly assign Codex Design System for
Wikimedia colors as values instead of re-assigning the outdated
`@wmui-color-*` variables.

Bump to required MediaWiki core version >= v1.41.0.

Also put stylelint-disable before the block it's actually needed.

Bug: T334934
Change-Id: I5696f160d39ef4edec7a1b966fe7e73608c86bdc
2023-05-16 17:58:24 +02:00
jenkins-bot 377efc459d Merge "Merge some more identical MediaWiki color scheme styles" 2022-06-20 12:00:21 +00:00
Thiemo Kreuz 263285e139 Merge some more identical MediaWiki color scheme styles
Bug: T307188
Change-Id: I50037fe3f8653941269699b140a84ff44d8e20ed
2022-06-16 16:15:56 +02:00
Thiemo Kreuz df1a084547 Use named colors in the MediaWiki style .less file
I leave some colors behind where I'm not entirely sure how to name
them.

Change-Id: Id3a248a116efaf2143f836f32606b1dc3d5ef290
2022-06-15 13:31:02 +02:00
Thiemo Kreuz 762c9e3eb4 Convert MediaWiki style sheet to LESS code
I did some reverse engeneering and derived the three base colors for
nested templates and parser functions as well as links, together with
a formula to calculate any mixture of the three.

You can manually compile the .less file:
lessc resources/mode/mediawiki/mediawiki.less resources/mode/mediawiki/mediawiki.css

Then compare:
git diff --word-diff=color -w HEAD^ -- resources/mode/mediawiki/mediawiki.css

You will see that some numbers change. These are rounding errors in
the old .css code.

Bug: T307188
Change-Id: Ic534a2fac73f9f737ae5238b87aa80b705b37786
2022-06-14 15:59:33 +00:00
Renamed from resources/mode/mediawiki/mediawiki.css (Browse further)