[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]
Subject: Re: [docbook-apps] Syntax highlighting
On Mon, 2013-12-09 at 10:38 -0600, David Cramer wrote: > On 12/09/2013 08:10 AM, Shaun McCance wrote: > > Yelp uses jQuery.Syntax for syntax highlighting, which we've been pretty > > happy with. I've had no problems with it clobbering markup inside code > > blocks, which is something I deal with pretty often. > > That looks interesting. I experimented by adding some markup to an > example in the distribution (ex.python.html). Adding <b> was ignored > (isn't clobbered but doesn't make text bold either). When I added <img > src="1.png"/> it broke the highlighting. Perhaps I'm doing it wrong? I have to admit, I've never tested images. And I completely override all the CSS and just use jQuery.Syntax as a tokenizer. But I do use spans to highlight added text with no problems. YMMV. > > http://www.codeotaku.com/projects/jquery-syntax/index.en > > > > Yelp does still do line numbers is XSLT though. Also: > > > >> One caveat about using tables for line numbers. It generally makes it > >> impossible to cut and paste the code sample without getting all the line > >> numbers. One thing I like about the syntax highlighter above is that > >> when you click on the code sample, the callouts go away and are not copied. > > > > Yelp puts the line numbers in a single pre that is float: left (or right > > in RTL) next to the code block. It's the best solution I've found. > > The jquery-syntax examples have line numbers (added by the js). Is there > a reason not to use that functionality? I already had the XSLT for this in place. I didn't feel like figuring out how to support continuation/startinglinenumber. And I don't see that doing it in JS has any actual benefits. JS might be the right solution for others. -- Shaun
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]