Last modified: 2005-08-17 00:50:09 UTC

Wikimedia Bugzilla is closed!

Wikimedia has migrated from Bugzilla to Phabricator. Bug reports should be created and updated in Wikimedia Phabricator instead. Please create an account in Phabricator and add your Bugzilla email address to it.
Wikimedia Bugzilla is read-only. If you try to edit or create any bug report in Bugzilla you will be shown an intentional error message.
In order to access the Phabricator task corresponding to a Bugzilla report, just remove "static-" from its URL.
You could still run searches in Bugzilla or access your list of votes but bug reports will obviously not be up-to-date in Bugzilla.
Bug 807 - Source code highlighting
Source code highlighting
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
Extensions requests (Other open bugs)
unspecified
PC All
: Normal enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2004-10-30 15:14 UTC by Caliga
Modified: 2005-08-17 00:50 UTC (History)
1 user (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Caliga 2004-10-30 15:14:33 UTC
I suggest a feature to highlight sorce code or other things, depending on the
given definitions.

Example for a possible tag: <highlight C> </highlight>

I thought, the syntax could be defined in Specialpages like Special:Highlight:C

Example Definition for C highlighting:

basecolors: black on white
string between "/*" and "*/" : green italic override include_delimiter
string between "//" and "\n" : #00AA00 override include_delimiter
string between "\"" and "\"" : #777777 override
keywords{ #include #define #ifndef } red
keywords{ void int long short char float double } blue bold

alternative for keywords:
keywords( blue bold )
{
 "return"
 "static"
 "const"
}

"override" is ment to prevent application of other rules on this string.
maybe it should better be named "final" and only prevent the following rules,
not all.
"include_delimiter" means that the delimiters are formatted, too.
alternative: include_delimiter(1,2) meaning the first and second delimiter are
included.

im not sure if this rules are enough for several language, but here is an idea
for a html-tag with or without parameters:

string between "<" and ">" : blue bold include_delimiter
substring between " " and ">" black narrow

(but i am not sure if this is a good solution...)
Comment 1 Niklas Laxström 2005-08-17 00:26:55 UTC
There's some out there, look for example
http://www.wickle.com/wikis/index.php/Syntax_Highlight_extension
Comment 2 Brion Vibber 2005-08-17 00:50:09 UTC
A GeSHi-based syntax highlight extension for MediaWiki 1.5 is
available in our extensions module in CVS.

http://cvs.sourceforge.net/viewcvs.py/wikipedia/extensions/Highlight/SyntaxHighlight.php?view=markup

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links