Live data from Hacker News

Highlight.js – Syntax highlighting for the Web

highlightjs.org

11–20 of 72 posts

Re: Highlight.js – Syntax highlighting for the Web

#11
post #10

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.ht...

Is line numbers considered "highlighting"? I mean, I get why you would want it but I never would have thought to ask for it.

Re: Highlight.js – Syntax highlighting for the Web

#12
post #10

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.ht...

Line numbers are really helpful when presenting code at an event, in a meeting, etc.

Re: Highlight.js – Syntax highlighting for the Web

#13
post #10

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.ht...

It's free software so that's no problem if you feel the need.

Re: Highlight.js – Syntax highlighting for the Web

#14
post #4

How does this compare with Prettify?

I did a comparison of Syntax Highlighter, Prettify and Highlight.js for weblogs.asp.net. I ended up preferring Highlight.js. My notes:

• SyntaxHighlighter

generates tons of nested tables, doesn’t work well with Bootstrap (overflows into right rail)

• Google Prettify

Worked okay, but kind of ugly. Had to use jQuery to apply “prettyprint” class to all pre elements.

• Highlight.js

Easy to set up, lots of themes, seems pretty quick, regular updates

Sample post: http://weblogs.asp.net/jongalloway/looking-at-asp-net-mvc-5-...

Highlight.js + styles are hosted on cdnjs, which makes it easy to host on a blog.

Re: Highlight.js – Syntax highlighting for the Web

#15
post #10

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.ht...

Line numbers are really helpful when presenting code at an event, in a meeting, etc.

Genuine question, why?

Re: Highlight.js – Syntax highlighting for the Web

#17
post #10

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.ht...

Is line numbers considered "highlighting"? I mean, I get why you would want it but I never would have thought to ask for it.

Many 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

Re: Highlight.js – Syntax highlighting for the Web

#20

Earlier quoted context omitted.

Is line numbers considered "highlighting"? I mean, I get why you would want it but I never would have thought to ask for it.

Many 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

I 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

Post reply on HN