7 ms·
It should be mentioned that this does not support and will indeed never support line numbers due to some strange opinions of the lead developer: http://highlig
by rlx0x 12y ago
It should be mentioned that this does not support and will indeed never support line numbers due to some strange opinions of the lead developer:
http://highlightjs.readthedocs.org/en/latest/line-numbers.html http://highlightjs.readthedocs.org/en/latest/line-numbers.ht...
- jimmytucson 12y agoIs line numbers considered "highlighting"? I mean, I get why you would want it but I never would have thought to ask for it.
- lelandbatey 12y agoMany popular syntax highlighting libraries do include this functionality. For example, the popular Python syntax highlighter "Pygments" supports line numbers[0]. [0] - http://pygments.org/docs/formatters/#HtmlFormatter http://pygments.org/docs/formatters/#HtmlFormatter
- pelhage 12y agoI personally use Prism.js for my blogging, which is what Smashing Magazine and CSS-tricks uses. Prism includes line numbers. I like Prism so far and don't have any issues with it yet
- awhitty 12y agoIt does seem more appropriate to have a separate module for line numbers. I would definitely understand the separation of concerns argument, but the maintainer instead makes some sort of emotional appeal about clutter and simplicity to explain why there is no line number support.
- jnbiche 12y ago> the maintainer instead makes some sort of emotional appeal about clutter and simplicity to explain why there is no line number support Clutter and simplicity is not an emotional argument. It becomes verifiably more difficult to maintain a code base with each new line. And since he's the one doing the maintaining, his position seems quite reasonable. Secondly, he seems to have a strong aesthetic aversion to line numbers, and I can totally respect that. Frankly, among popular open source projects, those whose developers have the strongest sense of style and design and usually (not always) the best.
- ericHosick 12y agoLine numbers are really helpful when presenting code at an event, in a meeting, etc.
- gelatocar 12y agoGenuine question, why?
- zyxley 12y ago"So if you look at line 7, you'll see..."
- shironinja 12y ago... that the presenter should buy a laser pointer!
- alblue 12y agoLaser pointers don't work if the video is being recorded or screencast at the same time. They only work when the viewer is in the same room, and even then, they are typically pretty poor.
- luddypants 12y agoThis also applies to comments within the presentation, not just the verbal part of the presentation.
- hayfield 12y agoOut of several dozen different uses of laser pointers, I've only ever been able to (easily) see perhaps 3 or 4 of them, plus another small portion if focusing entirely on the game of spot-the-laser-pointer. It's related to my colourblindness. As such, verbal cues (or a long stick) are preferable to a laser pointer. Of course, use a laser pointer to assist those who can see it, but it's better assume half the people in the room can't and use words to this effect.
- aw3c2 12y agoIt's free software so that's no problem if you feel the need.
- pothibo 12y agohttp://prismjs.com/ http://prismjs.com/ is an alternative that supports line numbers.
- yellowapple 12y agoI already like this one better, to be honest. It also already has Julia and Rust support. If it were to include Elixir support as well, it'd be perfect.
- luddypants 12y agoAnd in particular prismjs lets you select lines of code without selecting the line numbers, which you probably do not want.
- thomasfoster96 12y agoPrism is pretty damn good. Although the name sounds like an NSA plan to intercept all the javascript libraries in the world.
- Octplane 12y agoOf course, YMMV http://uu.zoy.fr/p/T4RwhQ#x=2zHnAK7/HQAxDmEA http://uu.zoy.fr/p/T4RwhQ#x=2zHnAK7/HQAxDmEA
- yellowapple 12y agoI understand the author's point-of-view on this, but disabling line numbers sounds like something that should be user-controllable. Right now it feels like a misfeature, whereas "we don't implement line numbers by default, but if you want them, do this and that and you can have them" would feel way more like a good feature to have.
- cbhl 12y agoHas anyone actually tried submitting a patch that implements it yet? https://groups.google.com/d/msg/highlightjs/UVJaQcQNC1c/1C6UyVrGT50J https://groups.google.com/d/msg/highlightjs/UVJaQcQNC1c/1C6U...
- dingdingdang 12y agoI think this comment/discussion ends up over-emphasizing the 'strangeness' of the line-number situation with this library, the page linked ends with: 'This position is subject to discuss. Also it doesn’t stop anyone from forking the code and maintaining line-numbers implementation separately.', which seems pretty reasonable to me!
- ajsharma 12y agoYeah, this is pretty much the behavior that I want to see from open source maintainers: make decisions and build conventions but be open to having your mind convinced of alternatives.