Page MenuHomePhabricator

Post deploy tasks for "Add 'wikitext' as language in Pygments"
Open, Needs TriagePublic

Description

Requested by @ShakespeareFan00 on Discord

When T29828: Add "wikitext" as language in Pygments and the upstream patch https://github.com/pygments/pygments/pull/2373 are deployed to MediaWiki, we need to update some documentation, and potentially update some wiki pages (if worth it and there's consensus and it's not too difficult).

  • https://www.mediawiki.org/wiki/Extension:SyntaxHighlight will need updating when the wikitext support becomes available in a <syntaxhighlight>...<\syntaxhighlight> tag.
  • Notify users with Tech/News.
  • Notify users with wikitech-ambassadors and/or wikitech-l mailing list
  • Potentially search where users were using a different "similar" language to approximate lang="wikitext" on wiki, then replace it with lang="wikitext".
    • lang="moin"
    • lang="html5"
    • lang="handlebars"
    • lang="xml+smarty"
    • lang="tid"
  • Potentially search where users were using no lang or lang="text", identify if wikitext, and replace.
  • Document {{#tag:syntaxhighlight}} as a workaround for nested <syntaxhighlight>s (T334776)

Note that the double quotes in lang="" are optional, and single quotes are also allowed, so when searching, make sure to search both with and without those.

Event Timeline

The current release of Pygments is 2.14.0 which was released on 2023-01-01. The new lexer was merged on 2023-04-05 so it obviously is not in the current release. It should be in the planned 2.15.0 release.

Thanks for adding this. Documentation updates are something that gets overlooked, so tracking these tasks is good :)

Anyone know if some kind of technical report listing occurrences on other wikis is feasible? ( possibly also listing other 'variants' mentioned previously.)

It should be possible to repeat these with the other interesting language choices.

Another possible clean-up list item is example/sample wikitext which has been <nowiki> ed. ?

Draft for Tech/News
Later the SyntaxHighlight extension will start supporting wikitext markup as the corresponding Pygments library has been updated. You will be able to use the new highlight by selecting the language wikitext. Old highlights used to replace wikitext highlights, such as html5, moin, html+handlebars, could be replaced.

Check this text plz :)

Thanks for the draft! Appreciated.
I suggest we postpone this entry until the week after it is merged, both so that it can be tested and confirmed as working, but more importantly so that editors can immediately start using it when they learn about it! (versus up to 4 days later)

Thanks for the draft! Appreciated.
I suggest we postpone this entry until the week after it is merged, both so that it can be tested and confirmed as working, but more importantly so that editors can immediately start using it when they learn about it! (versus up to 4 days later)

Yes, I thought about that too. Initially, I started writing a draft without knowing that there were some delays T320848#8777556 :)

Draft for Tech/News
Later the SyntaxHighlight extension will start supporting wikitext markup as the corresponding Pygments library has been updated. You will be able to use the new highlight by selecting the language wikitext or mediawiki. Old highlights used to replace wikitext highlights, such as html5, moin, html+handlebars, could be replaced.

Check this text plz :)

Personally I would recommend telling people to only use wikitext to keep code consistency, as mediawiki only exists for compatibility.

Draft for Tech/News
Later the SyntaxHighlight extension will start supporting wikitext markup as the corresponding Pygments library has been updated. You will be able to use the new highlight by selecting the language wikitext or mediawiki. Old highlights used to replace wikitext highlights, such as html5, moin, html+handlebars, could be replaced.

Check this text plz :)

Personally I would recommend telling people to only use wikitext to keep code consistency, as mediawiki only exists for compatibility.

Oh, ok, fixed :) Thanks!

@bd808 From my testing single quotes also work as lang='xxx'. I think those cases need to be searched too.

@bd808 From my testing single quotes also work as lang='xxx'. I think those cases need to be searched too.

I think lang=xxx also works.
lang="tid" is also used as a wikimarkup substitute (by me, at least).

Woohoo! Is this now ready to go into the next edition of Tech News, or does anything else need to be deployed or updated or checked beforehand?
And does anyone have further suggestions to improve the draft?

Draft: If I tweak and simplify Iniquity's draft from above... (T334137#8783024), I think something like this may work?

The SyntaxHighlight extension now supports wikitext as a selected language. Old alternatives that were used to highlight wikitext, such as html5, moin, and html+handlebars, can now be replaced. [ 1 ]

Should be good to go for the next edition! Thanks for posting the simplified version.

It appears that lang="html5" (example) and lang="html4strict" (example) stopped working recently.
I'm not sure if that was on purpose (I can't see any related upstream changes), or related to efforts tangential to this task?
It might be good impetus to move forward with that aspect of this task?
Or perhaps we should file a new phab-task to create an alias for these old keywords? (Asking here first, as you folks might be familiar with any changes I overlooked)

@Quiddity I think it's unrelated. Looking at Pygments I cannot find lexers for html5 and html4strict, and looking up in the release notes I cannot find relevant information either.

It seems to me that there will be no more work on this task and it can be closed, right? :)

The checklist above still has several incomplete entries.