Bug 471501 - Add SyntaxHighlight extension.
Summary: Add SyntaxHighlight extension.
Status: RESOLVED FIXED
Alias: None
Product: KDE MediaWiki
Classification: Websites
Component: general (show other bugs)
Version: unspecified
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: carl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-06-27 12:38 UTC by Andrew Shark
Modified: 2023-08-24 15:11 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Shark 2023-06-27 12:38:45 UTC
For the wiki pages, it would be good to show syntax highlighting. See for example this page: https://community.kde.org/Get_Involved/development/More#Build_Qt6_using_kdesrc-build
Long file content with lots of comments is hard to read when the comments and actual code are the same color.

I currently manually colored the text there (opened in vim with kdesrc-buildrc syntax installed, choosed a good theme (I used "shine", but made comments color a bit more bright), saved with TOhtml command, replaced span attributes class="" with syntax="...").

With that approach, it is hard to edit the wiki. The SyntaxHighlight https://www.mediawiki.org/wiki/Extension:SyntaxHighlight extension will allow to make it automatically.

It uses Pygments (https://pygments.org), and it is said there that it is very easy to create your own languages (for our case it is kdesrc-buildrc). But even if not do this, we can just at least highlight it as bash, and this will significantly easify reading (comments will be different color from the code). 

ADDITIONAL INFORMATION
Discussed in Matrix
Comment 1 Andrew Shark 2023-08-24 15:11:49 UTC
I used syntaxhighlight tag, it works, thanks.