Last modified: 2014-06-06 04:09:37 UTC
When we open a SVN page like this http://svn.wikimedia.org/viewvc/mediawiki/trunk/phase3/resources/Resources.php?revision=82285&view=markup#l142 we are able to add #l___ to the url to create links pointing to a specific part of the code. On [[MediaWiki:Common.js]] and other [[*.js]] and [[*.css]] pages, there is no way to do this at the momment. It would be great to have such a feature, mainly for long script pages. Similarly, it would probably be desirable to display such line numbers in those js and css pages.
Implementing that isn't difficult. implementing the syntax coloring code to work in accordance with that, is probably the more challenging issue.
FYI on code.google they use two columns, one for the line numbers and other for code. E.g.: http://code.google.com/p/google-ajax-examples/source/browse/branches/javascript_playground/js/interactive_logic.js#2
Checked, syntax extension does line based parsing as well, so less of a problem than I first thought.
(In reply to comment #3) > Checked, syntax extension does line based parsing as well, so less of a problem > than I first thought. Yes, use <source line lang=...></source>. But ids per line are not added.
*** Bug 60410 has been marked as a duplicate of this bug. ***
Is this a ::Parser bug? [[:mw:Extension:SyntaxHighlight_GeSHi]] seems to be responsible for <source> tag.
The output would probably use something like <span id="mw-source-f2-l31"> where f2 indicates it is the second <source> section on the page, and l31 line 31.
If handling potential multiple occurrences on a page is too difficult, we can at least start by supporting it on entire pages such as those in the MediaWiki and User namespaces for .js and .css.