Village Pump:Home/Syntax Highlighting ( archived 2009-06-18 ): Difference between revisions

(→‎Switch!! <code> is now <lang>: Aww man I already started)
Line 9:
Code will be denoted as:
 
&lt;code lang=" C"&gt;(some code)&lt;code&gt;
 
This will significantly clean up the Mediawiki extension namespace, and make formatting tricks with CSS easier. I'd rather create an attribute to &lt;pre&gt;, but that appears as though it could be more complicated. --[[User:Short Circuit|Short Circuit]] 05:52, 2 July 2008 (UTC) (updated) --[[User:Short Circuit|Short Circuit]] 21:59, 29 January 2009 (UTC)
:Will we need to go and change all of the previous highlighting then? --[[User:Mwn3d|Mwn3d]] 06:11, 2 July 2008 (UTC)
::Yes. Both approaches will be supported for a little while, I expect, but the current system will definitely be phased out. --[[User:Short Circuit|Short Circuit]] 23:42, 2 July 2008 (UTC)
Line 24:
::::Also it would need a regular expression for comments. It would probably be best to talk to the people working on [http://sourceforge.net/projects/geshi/ the GeSHi project] about adding new languages.--[[User:Mwn3d|Mwn3d]] 16:29, 7 July 2008 (UTC)
 
: It's happened! I've replaced the GeSHiSyntaxHighlight Mediawiki extension with the GeSHiCodeTag extension. The old tag format works (for now), but it ''will'' be removed as soon as possible. All tags of <nowiki>&lt;langmylang&gt;some_code&lt;langmylang&gt;</nowiki> need to be changed to <nowiki>&lt;codelang langmylang&gt;some_code&lt;/codelang&gt;</nowiki>. So this block:
<cpp>#include <stdio>
int main()
Line 33:
 
: Should be rewrapped like this:
<codelang cpp>#include <stdio>
int main()
{
std::cout << "Hi!" << std::endl;
return 0;
}</codelang>
: This is going to require a massive site-wide effort for all supported languages. See [[Help:GeSHi]] for details. As soon as we're confident most of the pages have been handled, I'll disable support for <nowiki>&lt;lang&gt;</nowiki> entirely. --[[User:Short Circuit|Short Circuit]] 02:33, 23 January 2009 (UTC)
:: When the <nowiki><lang></nowiki> tags are removed, [[Special:Version]] will not any more list all the languages in the tags section, right? Maybe there should be a (perhaps auto-generated) page listing all supported languages (or maybe it's even possible to include them in [[Special:Version]] as separate section). Or maybe there's already such a list somewhere, which I simply didn't notice? --[[User:Ce|Ce]] 08:18, 23 January 2009 (UTC)
Line 45:
:::: I just noticed this too (when writing my task [[N distinct objects]]). Since &amp;code> being inline is defined by the HTML specification, to be inline, we should not redefine it to be block. --[[User:Kevin Reid|Kevin Reid]] 00:48, 29 January 2009 (UTC)
:::::You should use the <nowiki><tt></nowiki> tag instead. --[[User:Mwn3d|Mwn3d]] 01:57, 29 January 2009 (UTC)
:::::Sorta Fixed. We now use &lt;lang mylang&gt; instead of &lt;code mylang&gt;. &lt;code&gt; will remain broken until the existing pages are fixed. --[[User:Short Circuit|Short Circuit]] 21:59, 29 January 2009 (UTC)
: It seems color themes have changed for quite a number of languages...perhaps we should decide on a favorite theme, and then use that for every language? Would take quite a bit of work though... --[[User:Mbishop|Mbishop]]
:: Should be fixed. The upgrade in versions of GeSHi obliterated a configuration change I'd forgotten I made. I need to make a list of these things. As for a common color scheme, I'm all for it. GeSHi is now set to apply different CSS classes to the different code concepts it's familiar with. The current theme is set in [[Mediawiki:Common.css]], and can be changed sitewide by modifying that. --[[User:Short Circuit|Short Circuit]] 20:21, 24 January 2009 (UTC)
 
 
==Switch!! &lt;code&gt; is now &lt;lang&gt;==