Closed Bug 463500 Opened 17 years ago Closed 15 years ago

syntax highlighting without line numbers should be possible (and preferably default)

Categories

(developer.mozilla.org Graveyard :: General, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: asqueella, Unassigned)

References

Details

Currently if you edit a page on developer.mozilla.org and apply a "syntax.JavaScript" transformation to a code snippet, it gets syntax highlighting, but also automatic line numbers. There's no (obvious) way to get rid of the line numbers. While syntax highlighting is great and it vastly increases readability, the line numbers are highly inconvenient: when you try to copy/paste a syntax highlighted code snippet to a text editor, the line numbers are pasted along with the code. Yes, there's a "plain text" link, but it's an extra click and it opens in a new window, which causes an additional delay. The snippets for copy/pasting are very common on MDC (see https://developer.mozilla.org/en/Code_snippets ). The line numbers are only useful in rare cases when the article refers to specific lines in the example. Line numbers also make the snippets, especially short ones, look cluttered.
So, Actual results: applying syntax.* transformations displays line numbers by default. Expected results: no line numbers by default. If enabled, line numbers aren't copied when copy/pasting.
I would actually prefer to leave line numbers on by default, as I think they're awfully useful. However, you're right that there are certainly times where they get in the way. Filed a feature request with MindTouch: http://bugs.developer.mindtouch.com/view.php?id=5332
Blocks: 519025
The request on MindTouch has been fixed, because they updated the extension to use the latest syntax highlighter. I think we should update the syntax highlighter on MDC as well. It will allow toggling line numbers (among other improvements): http://alexgorbatchev.com/wiki/SyntaxHighlighter:Demo:gutter (Demo)
We should already have this installed. If we don't, please re-open.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
The way I see it MDC uses version 1.5.1 Check it on my sandbox: Click on the "?" in the code sample: https://developer.mozilla.org/User:Elchi3/Sandbox The MindTouch wiki uses version 2.0.320 (May 03 2009). Latest version is 2.1.364 (October 15 2009 ). This article about Syntax Highlighter 2.0 outlines really nice features which I would like to use on MDC as well: http://developer.mindtouch.com/Deki/Extensions/Syntax_Highlighter_2.0 I tried to find out how to disable line numbers in our current version and other features mentioned in the article. I don't see a chance to do this at the moment. So I think we haven't installed the current version. Please enlighten me if I'm wrong :)
I'm going to assume we'll pick up the 2.0 version of the highlighter when we install the 9.12 update RSN.
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I think we're running 9.12 now, but apparently I'm too stupid to convince the highlighter not to show the line numbers. http://developer.mindtouch.com/Deki/Extensions/Syntax_Highlighter_2.0#syntax.javascript%28code_.3a_str.2c_collapse_.3a_bool.2c_firstline_.3a_num.2c_gutter_.3a_bool.2c_ruler_.3a_bool.2c_toolbar_.3a_bool.2c_wrap_.3a_bool.2c_theme_.3a_str%29_.3a_xml says: "syntax.javascript(code : str, collapse : bool, firstline : num, gutter : bool, ruler : bool, toolbar : bool, wrap : bool, theme : str) : xml" and I have this: "<pre function="syntax.JavaScript" class="eval deki-transform">". I tried changing that to function="syntax.JavaScript(gutter:false)", which didn't work. Could you help please?
You are not too stupid to do that :) I think the syntax highlighter is an extension which isn't updated yet. We're still using version 1.5.1 (See Comment 5) which doesn't offer to disable line numbers among other features. We are running 9.12 now, but we have to upgrade this extension as well. Sheppy?
Because of these ugly error messages with the syntax highlighter extension, someone updated this extension to a newer version. Which means, we are finally able to disable line numbers :) Here is a sample to try the new magic: <pre function="syntax.javascript{code:$, gutter:false}"> //Your code here </pre> See also: https://developer.mozilla.org/User:Elchi3/Sandbox
Status: REOPENED → RESOLVED
Closed: 15 years ago15 years ago
Resolution: --- → FIXED
You're welcome. :)
Component: Deki Infrastructure → Other
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in before you can comment on or make changes to this bug.