Extension talk:SyntaxHighlight

From MediaWiki.org
Jump to: navigation, search
An archive box Archives 

2016[edit]

selecting code also selects line number, and the CSS fix doesn't seem to work[edit]

In my version 2.0 (822ede6), selecting code also selects the line number. This makes it hard to use the code you have copied. the solution here, .mw-highlight .lineno { user-select:none; } on Mediawiki:Common.css, doesn't seem to work. Billmackenty (talk) 08:59, 11 March 2016 (UTC)

At a quick glance, the CSS classes look like they should also be working with the new version... --87.123.61.63 22:40, 31 March 2016 (UTC)

e[edit]

w:en:E (programming language) is listed as currenty supported, but I don’t see an e downstream nor an entry in the Pygments lexer list. Greetings --PerfektesChaos (talk) 14:10, 13 March 2016 (UTC)

I have updated the page accordingly. If you need E support, you might be able to use a custom version of Pygments (an own wheel file). The right way, however, is to get an E lexer integrated into the upstream version of Pygments. --87.123.61.63 22:35, 31 March 2016 (UTC)

Example for a language definition[edit]

My text editor KeditW (an XEDIT-clone) offers syntax highlighting based on KLD-files (Kedit Language Definitions), and it's fun to create new KLD-files. So far I have created "good enough" (for me) KLDs for BATCH (Windows NT bat/cmd), FREECIV (an INI-variant for rulesets/tilesets/etc.), and WASM (Watcom assembler). Now I'm curious if the BATCH + WASM stuff might be also useful here, please add some example links to raw language definitions (apparently known as pygments lexers), and a recipe (ideally less than 5min reading time :tongue:) how and where to test and submit a new language. Be..anyone (talk) 07:29, 6 April 2016 (UTC)

Supported languages[edit]

Code Language (see listing) change to example
bnf Backus–Naur Form active
 <Programm>               ::= 'PROGRAM' <Bezeichner> 'BEGIN' <Satzfolge> 'END' .
 <Bezeichner>             ::= <Buchstabe> <Restbezeichner>
 <Restbezeichner>         ::= | <Buchstabe oder Ziffer> <Restbezeichner>
 <Buchstabe oder Ziffer>  ::= <Buchstabe> | <Ziffer>
 <Buchstabe>              ::= A | B | C | D | … | Z | a | b | … | z
 <Ziffer>                 ::= 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9
 <Satzfolge>              ::= …
 …
dcl Data Control Language
GRANT Operation+ ON Relation TO (PUBLIC|Benutzer) [WITH GRANT OPTION]
REVOKE Operation+ ON Relation FROM (PUBLIC|Benutzer)
cfdg CFDG strike out
div DIV
euphoria Euphoria
genero Genero
oz Oz
spark SPARK

Please actualize the listing. --Lómelinde (talk) 08:55, 10 April 2016 (UTC)

Indent oddity[edit]

On my commons user page and here I use SyntaxHighlight for a very simple JavaScript example. Oddly I had to modify the indent of one line in the source to get the intended effect with SyntaxHighlight, diffs: 1, 2. –Be..anyone 💩 12:07, 17 April 2016 (UTC)