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)
developer.mozilla.org Graveyard
General
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.
Reporter | ||
Comment 1•17 years ago
|
||
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.
Comment 2•17 years ago
|
||
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
Comment 3•15 years ago
|
||
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)
Comment 4•15 years ago
|
||
We should already have this installed. If we don't, please re-open.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Comment 5•15 years ago
|
||
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 :)
Comment 6•15 years ago
|
||
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 → ---
Reporter | ||
Comment 7•15 years ago
|
||
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?
Comment 8•15 years ago
|
||
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?
Comment 9•15 years ago
|
||
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 ago → 15 years ago
Resolution: --- → FIXED
Comment 10•15 years ago
|
||
You're welcome. :)
Assignee | ||
Updated•13 years ago
|
Component: Deki Infrastructure → Other
Updated•5 years ago
|
Product: developer.mozilla.org → developer.mozilla.org Graveyard
You need to log in
before you can comment on or make changes to this bug.
Description
•