Extension talk:SyntaxHighlight GeSHi/Archive 2013

From mediawiki.org
Jump to navigation Jump to search

How can I mimic this?

For example, if I wanted to make an extension, FooHighlight, and every instance of the word "bar" between the <foo> tags was colored purple and everything between { and } was colored green, what would I do? I am a complete newbie to PHP.


Custom User Defined Languages

Could someone make a basic how-to page to give the general idea for creating our own .css for custom languages. For example, I would like to add the ability to have it work with AHK (AutoHotKey) scripts. Thank you. -- ShoeMaker   ( Contributions Message )   14:25, 7 February 2013 (UTC)

Answering my own question here. The how-to create your own language documentation can be found at http://qbnz.com/highlighter/geshi-doc.html#language-files -- ShoeMaker   ( Contributions Message )   14:41, 7 February 2013 (UTC)

Request for pseudocode highlighting

Since pseudocode is typically used for explaining algorithm, it would be nice if this extension supports pseudocode highlighting by default. In my thought, it should highlight words like for, while, each, function, return, if, in, ... --Nullzero (talk) 18:25, 11 February 2013 (UTC)

"Please do not make requests for support for languages or bug reports for highlighting errors on this page. ... Bug reports and feature requests for the highlighting should be made to the GeSHi developers." --Iynque (talk) 15:05, 18 January 2014 (UTC)

Generic HTML

Why there is not a general value HTML for all types of (X)HTML? I dont see a reason to have there html4strict and html5 while highlight ways are the same. How I can highlight XHTML 1.0 Transitional, than?--Juandev (talk) 11:21, 15 March 2013 (UTC)

Wiki links

Is there not a way to include wiki links inside the code block?

$ echo "a + b" | calc --hex      # [[Page_About_Options|this option]] causes calc to interpret its input as hex
  • You mean like:
$ echo "a + b" | calc --hex      # [[Page_About_Options|this option]] causes calc to interpret its input as hex

Yeah - notice how the link is not rendered as a link ??? "Page_About_Options" would be the link target, "this option" would be the link text

Technical 13 (talk) 21:43, 10 May 2013 (UTC)
  • I now understand your question fully. <syntaxhighlight> is a <pre> substitute that offers highlighting. There can be no active links inside by its very definition. See W:HTML element#pre. Technical 13 (talk) 01:54, 11 May 2013 (UTC)

lang for Mediwiki Code ?

What language in your opinion is best for rendering Mediawiki code, e.g. Wiki Syntax, templates, SMW extensions ? Or does anyone think that we could petition for someone to write a "mediawiki" module for Geshi (sorry I can't). Greetings !- Daniel K. Schneider (talk) 14:00, 12 June 2013 (UTC)

  • I personally use lang="bibtex" as it seems to be the closest to me. I have thought about writing a MWML module, but do not currently have the skills to do so or the time to invest into it. Technical 13 (talk) 12:33, 17 June 2013 (UTC)
    • Cool ! thanx a lot. Yes code is much more readable than my other attemps, e.g. JavaScript, Perl, XML, ... (see here (I am trying to learn semantic mediawiki/forms and write down as I play ...) - Daniel
Useful to know. Thanx. Could this be noted in the manual page somehow? -DePiep (talk) 09:13, 12 December 2013 (UTC)

Underscore not displaying properly

I noticed that the following code isn't displaying properly...

<syntaxhighlight lang="python">
# Set count_to equal to 1 plus 2 on line 3!

count_to = 1+2

print count_to
</syntaxhighlight>
# Set count_to equal to 1 plus 2 on line 3!

count_to = 1+2

print count_to

The underscore in the "print count_to" isn't displaying on en:User:Theopolisme/help/Matty.007 to me.

Displays just fine for me on MW and enwiki using Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_4) AppleWebKit/536.30.1 (KHTML, like Gecko) Version/6.0.5 Safari/536.30.1 Theopolisme (talk) 18:39, 8 July 2013 (UTC)
  • It displays properly here for me but not on en: using the exact same code. Odd. I'm using FF22 FWIW. Technical 13 (talk) 18:41, 8 July 2013 (UTC)

SASS

Any plan for including sass and/or scss source languages to the extension?
80.230.3.58 11:51, 26 July 2013 (UTC)

"Please do not make requests for support for languages or bug reports for highlighting errors on this page. ... Bug reports and feature requests for the highlighting should be made to the GeSHi developers." --Iynque (talk) 15:05, 18 January 2014 (UTC)

Use pre tags?

Is there anyway to make it automatically do syntax highlighting for code in <pre> tags? — Preceding unsigned comment added by 81.151.174.60 (talkcontribs)

  • "Why would you want to do that?", would be my first question. The answer is, if you modify the php for the extension, you could make it work for any element/tag you wanted. Problem is, <pre> is part of the HTML standard, so your new users wouldn't be expecting that output from it, and might not want/like it (especially since it would return an undefined language error unless you created a default, which would be poor because there are so many languages and to assume that one will always be the most popular is a bad idea). Now, I agree that <syntaxhighlight lang="blah"> is kind of long to type out, and would request the developers of this extension to add a <sh lang="blah"> alias. Technical 13 (talk) 12:05, 26 August 2013 (UTC)

PHP 5.5 Notice

PHP Notice:  Use of undefined constant CONTENT_MODEL_CSS - assumed 'CONTENT_MODEL_CSS' in /usr/local/www/wiki/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php on line 75,

IRC

Any plan for introducing IRC as a language? E.g.,

<source lang="irc">
[12:27] <legoktm> leucosticte: $content->getNativeData()
[12:27] <legoktm> you should also probably do check that $content instanceof TextContent
</source>

Leucosticte (talk) 18:00, 17 October 2013 (UTC)

"Please do not make requests for support for languages or bug reports for highlighting errors on this page. ... Bug reports and feature requests for the highlighting should be made to the GeSHi developers." --Iynque (talk) 15:05, 18 January 2014 (UTC)
Feature request submitted! Leucosticte (talk) 15:19, 6 February 2014 (UTC)