Commit graph

18 commits

Author SHA1 Message Date
Derk-Jan Hartman 45e3085a59 Remove GeSHi from class and filenames
Remove the GeSHi name from filenames and classes where possible. We no
longer actually use GeSHi, and though we cannot rename the extension or
repo atm, we can rename these.

Bug: T164939
Change-Id: I02bc3304d88103c5302f203e788fc73ff20e1050
2017-05-20 14:47:23 +00:00
Derk-Jan Hartman 0fa395c72d GeSHi: Make sure the autoload of Compat doesn't load GeSHi
Bug: T139594
Change-Id: Ib8c78f6f1da9750e0429f7bcf29b8dcb5ecca8a1
2017-05-13 15:14:05 +02:00
Derk-Jan Hartman 39f0b85229 Do not extend GeSHi class with private modifications
Our GeSHi class is intended for other extensions making use of GeSHi.
However other libraries or extensions can bring their own GeSHi to the
classloader. In those cases, we cannot find our private modifications
like $compatibleLexers on this class. Instead use
SyntaxHighlightGeSHiCompat for our privact modifications and keep GeSHi
closer to the original implementation.

Bug: T139594
Change-Id: I5c2ba9dfb08ec31f6b5cfd90083cbae0ae0ac3c4
2017-05-11 18:11:25 +00:00
jenkins-bot 1ac67b6ee6 Merge "Remove no longer needed tsql->sql mapping" 2017-04-27 15:21:30 +00:00
Derk-Jan Hartman ab167e5fee Remove no longer needed tsql->sql mapping
This is a follow-up to I4dc1782f19881ba1294308e1cdea1b2e063f438a

Bug: T156573
Change-Id: I5a1756a8db97aa336c810fb44bb108d77b8f89c7
2017-04-27 15:11:43 +00:00
Kunal Mehta db681d158b Update pygments to 2.2
Notable changes:

* Added new token types and lexing for magic methods and variables in
  Python and PHP.
* Added a new token type for heredoc (and similar) string delimiters and
  lexing for them in C++, Perl, PHP, Postgresql and Ruby lexers.
* Improved the CSS lexer.
* Added Varnish config lexer

Full changelog is found at:
<bc45808f83/CHANGES>

Bug: T156573
Change-Id: I4dc1782f19881ba1294308e1cdea1b2e063f438a
2017-04-27 15:10:16 +02:00
Derk-Jan Hartman 55c8628d47 Add language mapping for geshi apt_sources to debsources
Bug: T132310
Change-Id: Ic2081d710e28cb603b59d4f4a8fa1fe25ca4d877
2016-04-11 13:30:17 +02:00
Ori Livneh e2ac12a7c4 Reintroduce 'emacs-lisp' as an alias for the Emacs Lisp lexer
'emacs-lisp' was an alias for the Emacs Lisp lexer.
It got dropped in Pygments commit 811926b, probably by accident.
So, declare it as a compatability alias until it is restored upstream.
Upstream bug: https://bitbucket.org/birkenfeld/pygments-main/issues/1207

Change-Id: I25c0e75a337c623529705c45bee0dc13dfdfd92c
2016-02-03 14:33:39 -08:00
Ori Livneh 5d99d54626 Update pygments bundle to 2.1
Changelog:
https://bitbucket.org/birkenfeld/pygments-main/raw/7614bf7/CHANGES

Lots of new lexers: Emacs Lisp, Arduino, Modula-2 with multi-dialect support,
Fortran fixed format, Archetype Definition language, Terraform, Jcl,
Easytrieve, ParaSail, Boogie, Turtle, Fish Shell, Roboconf, Test Anything
Protocol, Shen, Component Pascal, SuperCollider, Shell consoles (Tcsh,
PowerShell, MSDOS), Elm and J, Crmsh, Praat, CSound, Ezhil, Thrift, QVT
Operational, Hexdump, and CAmkES Configuration.

Bug: T125581
Change-Id: Ie881af3d1dff23f08ccc9cbcf5f94a084fa561e1
2016-02-02 15:17:25 -08:00
jenkins-bot d05162e653 Merge "Map 'gettext' to 'pot'" 2015-07-24 12:07:40 +00:00
John Vandenberg 3fdb883739 Map 'gettext' to 'pot'
Bug: T105889
Change-Id: I41a7441987bae95bfb7e138f06d9c27feef070b9
2015-07-18 17:09:08 +10:00
John Vandenberg 99b0cd96bd Render "dcl" as "sql"
"dcl" (Data Control Language) in GeSHi was SQL with
additional keyword support, and a fallback to pygments
'sql' renders correctly, albeit without all keywords
highlighted, however most of the keywords are part of 'sql'.

Change-Id: I121ce6d6ab20328dd1788f537127e16fa3049503
2015-07-16 08:48:21 +10:00
John Vandenberg 653292c2f2 Map other assembler language to 'asm' or 'nasm'
Add mappings for 6502acme, 6502tasm, 6502kickass,
68000devpac, dcpu16, m68k, mmix, mpasm, pic16, and z80.

Change-Id: If593f4ccbd158517824b6ceed43b7d6cf3b08080
2015-07-13 13:12:12 +10:00
John Vandenberg 124434abc8 Render "arm" as "asm"
"arm" in GeSHi was assembly with additional keyword support,
and a fallback to pygments 'asm' renders correctly.

Change-Id: I3eb354cda2a1f324dd539eb20e9801c8350e21d1
2015-07-12 19:20:06 +00:00
John Vandenberg aacd82820b Use 'ebnf' to render 'bnf'
bnf syntax renders correctly using the ebnf handler.

Change-Id: I4f6f96d1b1c034c1f653797d0d03436307ddc819
2015-07-12 21:36:30 +10:00
John Vandenberg 53ea68e8b3 Render "bibtex" as "latex"
bibtex was supported by GeSHi, and is LaTeX syntax.

Change-Id: Id29f61529c5afbc5c9ecf51f81b5cdae7f3b3737
2015-07-12 15:53:04 +10:00
Kunal Mehta 139f68c410 Render "xpp" as "java"
Per jayvdb on wikitech-l, who said it looks "quite good":
 https://lists.wikimedia.org/pipermail/wikitech-l/2015-June/082166.html

Change-Id: I234a4da51592cabddce356c692471e90e6f2a829
2015-06-23 11:29:08 -07:00
Ori Livneh 6484894497 Highlight using Pygments rather than Geshi
GeSHi is unmaintained, lacks support for many popular modern languages, and
suffers from deep architectural flaws, chief among them the inconsistent
tokenization of different languages, each of which requires a custom
stylesheet.

Pygments is a well-maintained alternative. It is, by my count, the most popular
syntax highlighting library around. It is BSD-licensed, actively maintained,
and is widely used in PHP projects.

To keep this easy to review, this change does not include update for l10n
files, and it does not delete the geshi/ directory. I will do those in a
separate patch.

The chief change between this and the previous implementation is that errors
result in the code block not being highlighted, as opposed to not being printed
at all, having been replaced by an angry red error message. I think that is the
right user experience. If you go to StackOverflow or GitHub and try to mark up
your code block as being written in some language that their highlighter
doesn't know about, you don't get an error message -- the code simply doesn't
get highlighted.

Because we don't recursively load dependencies for extensions, to test this,
you will need to create a composer.local.json in $IP and add:

    {
        "extra": {
            "merge-plugin": {
                "include": [
                    "extensions/SyntaxHighlight_GeSHi/composer.json"
                ]
            }
        }
    }

Then run `composer update`.

Bug: T85794
Change-Id: I07446ec9893fae3d1e394f435d3d95cf8be6bc33
2015-06-22 23:37:15 +01:00