Re: [docbook-apps] syntax highlighting in webhelp format
Hi, Can you import the file from the xhtml directory. I don't know how the urn: syntax is interpreted, but could you use something like: xsl:import href=urn:docbkx:stylesheet/../xhtml/highlight.xsl/ Bob Stayton Sagehill Enterprises b...@sagehill.net On 5/4/2014 11:02 PM, Natalie Kershaw wrote: Is anyone syntax highlighting programlistings in webhelp format? I use the maven-docbkx-plugin and in HTML and PDF output, I add the following to my customization layer: xsl:import href=urn:docbkx:stylesheet/highlight.xsl/ But there is no highlight.xsl file in the webhelp directory. Is there any other way of doing this? Nat - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
[docbook-apps] syntax highlighting in webhelp format
Is anyone syntax highlighting programlistings in webhelp format? I use the maven-docbkx-plugin and in HTML and PDF output, I add the following to my customization layer: xsl:import href=urn:docbkx:stylesheet/highlight.xsl/ But there is no highlight.xsl file in the webhelp directory. Is there any other way of doing this? Nat - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Syntax highlighting
On Sat, 2013-12-07 at 15:26 -0600, David Cramer wrote: On 12/07/2013 01:38 AM, davep wrote: On 06/12/13 21:53, Norman Walsh wrote: Hello world, A fair bit of effort in the DocBook stylesheets goes into parsing, decomposing, annotating, and recomposing program listings for the purpose of adding line numbers to them. There's also a bunch of work that goes into syntax highlighting them. Occasionally, this takes a *long* time. It appears that modern systems do this in the JavaScript layer on the client. They also use tables to render line numbers. We use the popular syntax highlighter: https://github.com/alexgorbatchev/SyntaxHighlighter But we had to adapt it to support callouts and markup inside the code sample. Without our modifications, the js highlighter would end up displaying the html markup from the inline markup and the callouts as if it were part of the code sample. Here's an example of our version: http://docs.rackspace.com/servers/api/v2/cs-devguide/content/curl_summary_xml.html On the downside, it adds weight to the page. 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. 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. -- Shaun - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Syntax highlighting
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? 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? David - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
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 - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
RE: [docbook-apps] Syntax highlighting
On 2013-12-06 Norman Walsh wrote: I'm also tempted to abandon the XSL stylesheets and work instead on a purpose-built HTML+CSS rendering for printing. While I don't plan to upgrade my generating workflow to XSL 2.0 stylesheets in the near future, I am quite curious whether the proposed HTML+CSS approach can really cover all common needs: 1. ToC and Index with page numbers 2. Bookmarks 3. Double-sided version (different recto/verso margins, header/footer content) 4. Running header-footers (differences amongst title, blank or recto/verso pages) 5. Absolute positioning of title page graphics or other page elements 6. Using PDF format for images 7. Change bars Currently I also post-process final PDF files utilizing an intermediate format (I can retrieve the page # and Y coord for the specific ID in this format). Thanks, Jan - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Syntax highlighting
On 12/6/2013 1:53 PM, Norman Walsh wrote: ... As long as I'm airing dirty laundry, I'm also tempted to abandon the XSL stylesheets and work instead on a purpose-built HTML+CSS rendering for printing. Hi Norm, What composition engines do you have in mind for rendering HTML+CSS to print? Bob Stayton Sagehill Enterprises b...@sagehill.net - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Syntax highlighting
On 6.12.2013 22:53, Norman Walsh wrote: It appears that modern systems do this in the JavaScript layer on the client. They also use tables to render line numbers. I'm tempted to move in this direction. Comments? I have used both approaches. Problem with Javascript one is that it doesn't work for print (neither of XSL-FO, HTML/CSS composition egines support Javascript) and sometimes introduces delay in rendering. On the other hand Javascript syntax highlighters are in a more active development then highlighting extensions for XSLT. As long as I'm airing dirty laundry, I'm also tempted to abandon the XSL stylesheets and work instead on a purpose-built HTML+CSS rendering for printing. Do you mean completely removing existing incomplete fo code from project? I think that we can keep code here in the case someone will have time and interest to improve it further. With HTML+CSS composition there is one big problem -- there is (at least to my knowledge) no free renderer, I'm aware only of PrinceXML and AntennaHouse. But HTML+CSS printing got some traction recently, so it is wortwhile to explore this area. Jirka -- -- Jirka Kosek e-mail: ji...@kosek.cz http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep. -- Bringing you XML Prague conferencehttp://xmlprague.cz -- signature.asc Description: OpenPGP digital signature
Re: [docbook-apps] Syntax highlighting
On 12/07/2013 01:38 AM, davep wrote: On 06/12/13 21:53, Norman Walsh wrote: Hello world, A fair bit of effort in the DocBook stylesheets goes into parsing, decomposing, annotating, and recomposing program listings for the purpose of adding line numbers to them. There's also a bunch of work that goes into syntax highlighting them. Occasionally, this takes a *long* time. It appears that modern systems do this in the JavaScript layer on the client. They also use tables to render line numbers. We use the popular syntax highlighter: https://github.com/alexgorbatchev/SyntaxHighlighter But we had to adapt it to support callouts and markup inside the code sample. Without our modifications, the js highlighter would end up displaying the html markup from the inline markup and the callouts as if it were part of the code sample. Here's an example of our version: http://docs.rackspace.com/servers/api/v2/cs-devguide/content/curl_summary_xml.html On the downside, it adds weight to the page. I'm tempted to move in this direction. Comments? No problem with line numbers. I guess it's the outcome we want rather than how it is done? Would that work with insertions too? E.g. lines with (6) etc which are referred to in commentary? 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. Of course for pdf/print output, copy/paste is less of a concern. Regards, David - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Syntax highlighting
7 dec 2013 kl. 21:35 skrev Jirka Kosek ji...@kosek.cz: On 6.12.2013 22:53, Norman Walsh wrote: It appears that modern systems do this in the JavaScript layer on the client. They also use tables to render line numbers. I'm tempted to move in this direction. Comments? I have used both approaches. Problem with Javascript one is that it doesn't work for print (neither of XSL-FO, HTML/CSS composition egines support Javascript) and sometimes introduces delay in rendering. On the other hand Javascript syntax highlighters are in a more active development then highlighting extensions for XSLT. As long as I'm airing dirty laundry, I'm also tempted to abandon the XSL stylesheets and work instead on a purpose-built HTML+CSS rendering for printing. Do you mean completely removing existing incomplete fo code from project? I think that we can keep code here in the case someone will have time and interest to improve it further. With HTML+CSS composition there is one big problem -- there is (at least to my knowledge) no free renderer, I'm aware only of PrinceXML and AntennaHouse. Actually, there is a renderer that is able to generate PDF from HTML with really good results. Wkhtmltopdf (https://code.google.com/p/wkhtmltopdf/). It's basically a wrapper for the WebKit engine used by safari, chrome etc. Not sure if the WebKit they are using right now is bleeding edge. Anyway, it produces quite decent PDFs. I would definitely vote for the HTML route. Styling printable output with CSS would make the whole development process much more easier and less time consuming than it is today with XSL. /frank But HTML+CSS printing got some traction recently, so it is wortwhile to explore this area. Jirka -- -- Jirka Kosek e-mail: ji...@kosek.cz http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep. -- Bringing you XML Prague conferencehttp://xmlprague.cz -- - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Syntax highlighting
On 7.12.2013 23:05, Frank Arensmeier wrote: Actually, there is a renderer that is able to generate PDF from HTML with really good results. Wkhtmltopdf (https://code.google.com/p/wkhtmltopdf/). It's basically a wrapper for the WebKit engine used by safari, chrome etc. Not sure if the WebKit they are using right now is bleeding edge. Anyway, it produces quite decent PDFs. I would definitely vote for the HTML route. Styling printable output with CSS would make the whole development process much more easier and less time consuming than it is today with XSL. AFAIK web browsers, including those based on webkit, doesn't support CSS3 modules that add basic features necessary for print output, e.g.: https://bugs.webkit.org/show_bug.cgi?id=85062 -- -- Jirka Kosek e-mail: ji...@kosek.cz http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep. -- Bringing you XML Prague conferencehttp://xmlprague.cz -- signature.asc Description: OpenPGP digital signature
Re: [docbook-apps] Syntax highlighting
On 12/7/2013 5:05 PM, Frank Arensmeier wrote: Actually, there is a renderer that is able to generate PDF from HTML with really good results. Wkhtmltopdf (https://code.google.com/p/wkhtmltopdf/). There's also htmltolatex (with LaTeX to create the PDF): http://htmltolatex.sourceforge.net/ I'm not sure how it handles character encodings; I would guess that it could be made to preserve UTF-8 (rather than substituting special LaTeX names), in which case you could use XeLaTeX to produce the PDF. -- Mike Maxwell maxw...@umiacs.umd.edu My definition of an interesting universe is one that has the capacity to study itself. --Stephen Eastmond - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
[docbook-apps] Syntax highlighting
Hello world, A fair bit of effort in the DocBook stylesheets goes into parsing, decomposing, annotating, and recomposing program listings for the purpose of adding line numbers to them. There's also a bunch of work that goes into syntax highlighting them. Occasionally, this takes a *long* time. It appears that modern systems do this in the JavaScript layer on the client. They also use tables to render line numbers. I'm tempted to move in this direction. Comments? As long as I'm airing dirty laundry, I'm also tempted to abandon the XSL stylesheets and work instead on a purpose-built HTML+CSS rendering for printing. I should say that this note is particularly about the XSLT 2.0 stylesheets that I've been working on, not the standard ones. Be seeing you, norm -- Norman Walsh n...@nwalsh.com | Resist the urge to hurry; it will http://www.oasis-open.org/docbook/ | only slow you down--Bruce Eckel Chair, DocBook Technical Committee | signature.asc Description: PGP signature
Re: [docbook-apps] Syntax highlighting
On 06/12/13 21:53, Norman Walsh wrote: Hello world, A fair bit of effort in the DocBook stylesheets goes into parsing, decomposing, annotating, and recomposing program listings for the purpose of adding line numbers to them. There's also a bunch of work that goes into syntax highlighting them. Occasionally, this takes a *long* time. It appears that modern systems do this in the JavaScript layer on the client. They also use tables to render line numbers. I'm tempted to move in this direction. Comments? No problem with line numbers. I guess it's the outcome we want rather than how it is done? Would that work with insertions too? E.g. lines with (6) etc which are referred to in commentary? As long as I'm airing dirty laundry, I'm also tempted to abandon the XSL stylesheets and work instead on a purpose-built HTML+CSS rendering for printing. I can see you getting 80% with html and CSS... My penneth says you'll fall over on the 20% so I'm -1 on this. Do you believe you can do it? What of re-ordering, toc etc? I should say that this note is particularly about the XSLT 2.0 stylesheets that I've been working on, not the standard ones. Be seeing you, norm Understood. regards -- Dave Pawson XSLT XSL-FO FAQ. http://www.dpawson.co.uk - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] Syntax highlighting - setting colours
On 16.4.2013 18:36, John Brown wrote: xsl:template match=xslthl:keyword You must have this templates in xslthl mode like xsl:template match=xslthl:keyword mode=xslthl Jirka -- -- Jirka Kosek e-mail: ji...@kosek.cz http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 rep. -- Bringing you XML Prague conferencehttp://xmlprague.cz -- signature.asc Description: OpenPGP digital signature
[docbook-apps] Syntax highlighting - setting colours
Hello All, It seems that by default, keywords are bold. In addition to that, I want to make keywords blue and comments green. I copied the code to do it from http://www.sagehill.net/docbookxsl/SyntaxHighlighting.html, but it is not working. The text in the program listing is bold but black. My customisation layer looks like this: ?xml version=1.0 encoding=UTF-8? xsl:stylesheet version=1.0 xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:xslthl=http://xslthl.sf.net; exclude-result-prefixes=xslthl xsl:import href=file:///c:/mingw/local/share/docbook-xsl-ns-1.78.1/fo/docbook.xsl / xsl:import href=file:///c:/mingw/local/share/docbook-xsl-ns-1.78.1/fo/highlight.xsl / xsl:param name=highlight.source select=1/ xsl:template match=xslthl:keyword fo:inline font-weight=bold color=bluexsl:apply-templates//fo:inline /xsl:template xsl:template match=xslthl:comment fo:inline font-style=italic color=greenxsl:apply-templates//fo:inline /xsl:template /xsl:stylesheet The relevant section of my DocBook 5.0 sub-document (XIncluded in main document notes.xml) is programlisting language=sql92 ... /programlisting I transform notes.xml like this: xmllint --xinclude -o notesi.xml notes.xml %JAVA% -cp %CLASSPATH% -Dxslthl.config=/path/to/xslthl-config.xml com.icl.saxon.Stylesheet -o notes.fo notesi.xml notes.xsl %FOP% notes.fo notes.pdf What am I doing wrong? Regards, John Brown. - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting with xslt2/pygments/jython/saxon
OK, thanks a lot. While your explanations are certainly very precise and I understand a lot better now, what's going on and how it is supposed to work, it is still not working for me (for html). - Will try to reduce my example document to the absolute minimum / dig further. -Andreas Mauritz Jeanson m...@johanneberg.com writes: | -Original Message- | From: Andreas Reuleaux | java \ | -cp | /opt/saxonhe/saxon9he.jar:/opt/dbk/xslt2/lib/docbook-xsl2-saxon.jar:/usr/sh are/java/jython.jar net.sf.saxon.Transform \ | -init:docbook.Initializer \ | -s:myfile.dbk \ | -xsl:fo-xslt2.xsl \ | -o:myfile.fo \ | -xi:on \ | -ext:on \ | use.extensions=1 \ | fop1.extensions=1 | |OK, my toolchain still works, but no highlighting yet At present, highlighting does not work for XSL-FO. There are two reasons as far as I can tell: 1. The code for calling Pygments via Jython only handles (X)HTML output. 2. Pygments does not provide an XSL-FO formatter. For XHTML, it took me a while to figure out how to make highlighting work (Saxon HE on Windows XP). These points were particularly important: 1. Add role=pygments to the programlisting element in the source XML. 2. Add -Dpython.path=path to Pygments install dir to the java command. This was necessary in order to avoid ImportError: No module named pygments. 3. Add the output generated from this snippet, from pygments.formatters import HtmlFormatter print HtmlFormatter().get_style_defs() to a CSS file, and ensure that this file is referenced in the output (see the docbook.css parameter). Below is the contents of my Windows BAT file. I run it from the root directory of the 2.0.2 relase downloaded from http://docbook.github.com/. -- java -Dpython.path=c:/Java/jython2.5.2/Lib/site-packages/Pygments-1.4-py2.5.egg ^ -cp c:/Java/saxon93/saxon9he.jar;./lib/docbook-xsl2-saxon.jar;c:/Java/jython2.5. 2/jython.jar ^ net.sf.saxon.Transform ^ -init:docbook.Initializer ^ -s:verbatim.xml ^ -xsl:./xslt/base/html/docbook.xsl ^ -o:verbatim.html ^ -xi:on ^ -ext:on ^ docbook.css=mydefault.css -- | * Also there is mention of some python.path setting in ~/.jython |what does that look exactely (the path to the script maybe)? As an alternative to '-Dpython.path=...' at the command line, you can add python.path=path to Pygments install dir to ~/.jython. See http://wiki.python.org/jython/UserGuide#the-jython-registry | * I use neither Saxon PE or EE, but saxonb and/or saxonhe |so I guess I don't have to set | | resources | | extensionFunctionorg.docbook.extensions.xslt20.Cwd/extensi onFunction | | extensionFunctionorg.docbook.extensions.xslt20.ImageIntrins ics/extensionFunction | | extensionFunctionorg.docbook.extensions.xslt20.Pygmenter/e xtensionFunction |/resources That's right, configuration files cannot be used with Saxon HE. See http://www.saxonica.com/documentation/configuration/configuration-file.xml. Mauritz - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org !DSPAM:4eb1dcae66961388319417! - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
[docbook-apps] syntax highlighting with xslt2/pygments/jython/saxon
I am trying to get syntax hightlighting working as described in http://norman.walsh.name/2011/08/31/xsltPygments which was a response to a mail thread: http://lists.oasis-open.org/archives/docbook-apps/201108/msg00132.html respectively for the beginning of the thread: http://lists.oasis-open.org/archives/docbook-apps/201108/msg00079.html i. e. I'd like to * use the xslt2 stylesheets * have pygments do the syntax highlighting (instead of xslthl as described e. g. in http://www.sagehill.net/docbookxsl/SyntaxHighlighting.html or http://xmlguru.cz/2006/07/docbook-syntax-highlighting) * by calling jython directly from saxonb/saxonhe (there are some instructions to use pygments with docbook at http://lunaryorn.de/articles/docbook_pygments.html but according to Norman's blog there should be an easier way to call jython directly from saxon) What I have now is this: * I can use the xslt2 stylesheets in my toolchain like this java \ -cp /opt/saxonhe/saxon9he.jar:/opt/dbk/xslt2/lib/docbook-xsl2-saxon.jar \ net.sf.saxon.Transform \ -s:myfile.dbk \ -xsl:fo-xslt2.xsl \ -o:myfile.fo \ -xi:on \ -ext:on \ use.extensions=1 \ fop1.extensions=1 fo-xslt2.xsl is my customization layer stylesheet which besides my customizations imports the main xslt2 stylesheet xsl:import href=/opt/dbk/xslt2/xslt/base/fo/docbook.xsl / in this case for fo output, but it works equally well with html /opt/saxonhe ist just the path where I have put my saxonhe and my xslt2 stylesheets live in /opt/dbk * This works equally well for me if I use the (debian packaged) saxonb-xslt, in that case my classpath is /usr/share/java/saxonb.jar:/opt/dbk/xslt2/lib/docbook-xsl2-saxon.jar * Now I have installed jython as a debian package (I am on wheezy) # aptitude install jython * and installed pygments within jython by first getting easy_install working in jython # wet -nd http://peak.telecommunity.com/dist/ez_setup.py # jython ez_setup.py and then easy installing # /usr/share/jython/bin/easy_install pygments had to call it several times (don't know why), but it finally installed pygments, now I can call $ jython blahblah... import pygments * Now I understand that I have to add jython.jar to my classpath above and have to initialize saxon (-init:docbook.Initializer) java \ -cp /opt/saxonhe/saxon9he.jar:/opt/dbk/xslt2/lib/docbook-xsl2-saxon.jar:/usr/share/java/jython.jar \ net.sf.saxon.Transform \ -init:docbook.Initializer \ -s:myfile.dbk \ -xsl:fo-xslt2.xsl \ -o:myfile.fo \ -xi:on \ -ext:on \ use.extensions=1 \ fop1.extensions=1 OK, my toolchain still works, but no highlighting yet * I understand that saxon should call some jython script that contains at least something like from pygments.formatters import HtmlFormatter print HtmlFormatter().get_style_defs('.highlight') (or I guess something similar for fo) - but how do I tell saxonb/saxonhe to actually call this jython script? * Also there is mention of some python.path setting in ~/.jython what does that look exactely (the path to the script maybe)? * I use neither Saxon PE or EE, but saxonb and/or saxonhe so I guess I don't have to set resources extensionFunctionorg.docbook.extensions.xslt20.Cwd/extensionFunction extensionFunctionorg.docbook.extensions.xslt20.ImageIntrinsics/extensionFunction extensionFunctionorg.docbook.extensions.xslt20.Pygmenter/extensionFunction /resources Anyway, thanks in advance. -Andreas - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
Juri Memmert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Mike wrote: (Bump.) Has *anyone* been able to successfully get syntax highlighting to work in linux with the latest DocBook, Saxon 6.5.5, and xslthl-2.0.1? I want to know if this is even possible or a fatal bug... Yes, I have gotten it to work for Java code in one of my articles. I could send you a version of my build scripts (using ANT) with an example, if that helps. Yes please. At this point I need all the help I can get. I'm following all directions 100% and I still get XSLT Highlighter: Cannot read xslthl-config.xml, no custom highlighters will be available. thanks - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
Juri Memmert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Mike wrote: I could send you a version of my build scripts (using ANT) with an example, if that helps. Yes please. At this point I need all the help I can get. I'm following all directions 100% and I still get XSLT Highlighter: Cannot read xslthl-config.xml, no custom highlighters will be available. thanks Sure. Here goes. And I can tell you what the problem is right away (with 90% accuracy): You're missing a file:// in front of the path to the config file. It's described in the build.xml in a comment labeled IMPORTANT!. As for the example. Please review both the build.xml and the .xsl files and change all paths to match your environment. Otherwise, it won't work. Thanks, but if you look further up in the thread here, I am using file:// in my path, here's an excerpt: If I copy and paste the path I gave it into firefox (linux), firefox finds the file fine and displays it. That path is CORRECT! -Dxslthl.config=file:///www/notlive/docbook/xslthldamnit/highlighters/xslthl-config.xml I also tried giving it the path to the xslthl-config.xml file that comes with the docbook xsl: -Dxslthl.config=file:///www/notlive/docbook/docbook-xsl-1.74.3-pre/highlighting/xslthl-config.xml \ Which is also a valid path, and I can also cut and paste into firefox (including the file:// part) and see the file. Still get the error message and no highlighting. I've also tried without the quotes... Here's my line command: java -cp /www/notlive/docbook/docbook-xsl-1.74.3-pre/extensions/saxon65.jar:/www/notlive/docbook/saxondamnit/saxon.jar:/www/notlive/docbook/xslthldamnit/xslthl-2.0.1.jar -Dxslthl.config=file:///www/notlive/docbook/docbook-xsl-1.74.3-pre/highlighting/xslthl-config.xml com.icl.saxon.StyleSheet ./test.xml /www/notlive/docbook/docbook-xsl-1.74.3-pre/chunkohp.xsl Based on your build.xml, I tried using xslthl.config.file instead. Still get the same error and no higlighting. - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Mike wrote: Hi Mike, Could you send me the following file (if possible): /www/notlive/docbook/docbook-xsl-1.74.3-pre/chunkohp.xsl It is not part of the official Stylesheet release, it seems, so I am assuming that that's your custimization layer, right? Juri - -- The unrecognized minister of propaganda, E -- seen in an email from Ean Schuessler -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREDAAYFAkmkROwACgkQeKE9NrxdrXygJgCfX4bpbFUdjppyPSPW2s2GlBnx 3ZIAniyT/hhiac+OfJybeaDg3bicBmRE =Smvo -END PGP SIGNATURE- - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
Juri Memmert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Mike wrote: Hi Mike, Could you send me the following file (if possible): /www/notlive/docbook/docbook-xsl-1.74.3-pre/chunkohp.xsl It is not part of the official Stylesheet release, it seems, so I am assuming that that's your custimization layer, right? Sure, actually, now I've switched to this one, mfsite.xsl, here it is: ?xml version='1.0'? xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; version=1.0 xsl:import href=html/chunk.xsl/ xsl:import href=highlighting/common.xsl/ xsl:import href=html/highlight.xsl/ xsl:param name=base.dir select='/www/mfsite/docbook/tdesignerdocs/'/ xsl:param name=highlight.source select=1/ xsl:param name=html.stylesheet select='docbook.css'/ !--xsl:param name=admon.graphics select=1/-- /xsl:stylesheet (btw while I'm typing, I gave website/chunk-website.xsl and website/chunk-tabular.xsl a try instead of html/chunk.xsl, and all they did was output one giant stream of html to the command line, rather than multiple files in my output dir. Anwyay, I guess I should start a different thread for that problem.) - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
Juri Memmert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Mike wrote: Sure, actually, now I've switched to this one, mfsite.xsl, here it is: This is most peculiar. I replaced the stylesheet styles/custimization.html.xsl with the one you provided and adjusted the paths so that chunk.xsl, common.xsl and highlight.xsl can be found in my configuration and... guess what? I get properly marked-up HTML. Now, what I do NOT have is the stylesheet (docbook.css), of course. And I don't even dare asking whether you're overriding the b tag in there, for that's what makes up the whole markup... But that's about the last idea... for when I use your command-line in the test directory (with adjusted paths), I do get the highlights. So, even if you think I am a moron for even suggesting it, could you check your stylesheet for any formatting on the b? No no, at this point I've run out of ideas anyway! I appreciate the attempt, I only just added the docbook.css recently. It's the bsd docbook, first on the list here: http://wiki.docbook.org/topic/DocBookCssStylesheets Before that I had no css, and still no highlighting. Does the syntax highlighting need a specific docbook? I was thinking it might, but when I view source on the html, there's no, like span tags in the code or anything anyway. And of course, I still get that error when I do the tansform. There's probably something else in your build.xml that I need to add to my line command... some flag or something... - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Mike wrote: But that's about the last idea... for when I use your command-line in the test directory (with adjusted paths), I do get the highlights. So, even if you think I am a moron for even suggesting it, could you check your stylesheet for any formatting on the b? No no, at this point I've run out of ideas anyway! I appreciate the attempt, I only just added the docbook.css recently. It's the bsd docbook, first on the list here: http://wiki.docbook.org/topic/DocBookCssStylesheets Before that I had no css, and still no highlighting. Does the syntax highlighting need a specific docbook? I was thinking it might, but when I view source on the html, there's no, like span tags in the code or anything anyway. And of course, I still get that error when I do the tansform. There's probably something else in your build.xml that I need to add to my line command... some flag or something... Alright... let's see... I'll try to summarize what I have in terms of settings... maybe you can spot what's missing: The Java call to transform from Docbook to HTML: java \ - -classpath [Path to saxon.jar]:[Path to xslthl.jar]:[Path to saxon65.jar] \ - -Dxslthl.config=file://[Path to xslthl-config.xml] \ com.icl.saxon.StyleSheet [Path to input.xml] [Path to stylesheet] In the customization stylesheet: xsl:import href=[Path to chunk.xsl]/ xsl:import href=[Path to highlighting/common.xsl]/ xsl:import href=[Path to html/highlight.xsl]/ xsl:param name=base.dir select='[Path to your basedir]/ xsl:param name=highlight.source select=1/ And, as a last resort... The MD5SUM of the xslthl-config.xml c64c7a25b6c62422f6b4653f4f6174c2 xslthl-config.xml In case you haven't checked that your xslthl library isn't broken somehow... And that's it. All I can suggest now is that you copy some of your data into the test I sent, configure the paths in the build.xml and try to find out whether the ANT build does produce the correct output... for if it does then we know that it's a problem with your normal setup. Otherwise, all bets are off and it could be broken JARs or something similar... Juri - -- All the really good ideas I ever had came to me while I was milking a cow. -- Grant Wood -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREDAAYFAkmkVesACgkQeKE9NrxdrXzAJQCfVHCJLWU89InCIZRvug6zEQCO j88An23J8KTERRePUhJhgxdcY+vel/PJ =Em4m -END PGP SIGNATURE- - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
Juri Memmert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Mike wrote: But that's about the last idea... for when I use your command-line in the test directory (with adjusted paths), I do get the highlights. So, even if you think I am a moron for even suggesting it, could you check your stylesheet for any formatting on the b? No no, at this point I've run out of ideas anyway! I appreciate the attempt, I only just added the docbook.css recently. It's the bsd docbook, first on the list here: http://wiki.docbook.org/topic/DocBookCssStylesheets Before that I had no css, and still no highlighting. Does the syntax highlighting need a specific docbook? I was thinking it might, but when I view source on the html, there's no, like span tags in the code or anything anyway. And of course, I still get that error when I do the tansform. There's probably something else in your build.xml that I need to add to my line command... some flag or something... Alright... let's see... I'll try to summarize what I have in terms of settings... maybe you can spot what's missing: The Java call to transform from Docbook to HTML: java \ - -classpath [Path to saxon.jar]:[Path to xslthl.jar]:[Path to saxon65.jar] \ - -Dxslthl.config=file://[Path to xslthl-config.xml] \ com.icl.saxon.StyleSheet [Path to input.xml] [Path to stylesheet] In the customization stylesheet: xsl:import href=[Path to chunk.xsl]/ xsl:import href=[Path to highlighting/common.xsl]/ xsl:import href=[Path to html/highlight.xsl]/ xsl:param name=base.dir select='[Path to your basedir]/ xsl:param name=highlight.source select=1/ And, as a last resort... The MD5SUM of the xslthl-config.xml c64c7a25b6c62422f6b4653f4f6174c2 xslthl-config.xml In case you haven't checked that your xslthl library isn't broken somehow... And that's it. All I can suggest now is that you copy some of your data into the test I sent, configure the paths in the build.xml and try to find out whether the ANT build does produce the correct output... for if it does then we know that it's a problem with your normal setup. Otherwise, all bets are off and it could be broken JARs or something similar... Thanks very much for trying, here are my checksums of both the xslthl-config.xml I've tried: md5sum /www/notlive/docbook/docbook-xsl-1.74.3-pre/highlighting/xslthl-config.xml c64c7a25b6c62422f6b4653f4f6174c2 /www/notlive/docbook/docbook-xsl-1.74.3-pre/highlighting/xslthl-config.xml md5sum /www/notlive/docbook/xslthldamnit/highlighters/xslthl-config.xml c64c7a25b6c62422f6b4653f4f6174c2 /www/notlive/docbook/xslthldamnit/highlighters/xslthl-config.xml OK I've never used ANT before, I'll look into how to try yours out. Actually, can you try one more thing for me- have you tried doing yours from the command line instead of ANT? (Or do you mean you just tried that already). If you get yours to run from command line then I give up too! thanks Juri - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
Juri Memmert wrote: -BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Mike wrote: Alright... let's see... I'll try to summarize what I have in terms of settings... maybe you can spot what's missing: The Java call to transform from Docbook to HTML: java \ - -classpath [Path to saxon.jar]:[Path to xslthl.jar]:[Path to saxon65.jar] \ - -Dxslthl.config=file://[Path to xslthl-config.xml] \ com.icl.saxon.StyleSheet [Path to input.xml] [Path to stylesheet] In the customization stylesheet: xsl:import href=[Path to chunk.xsl]/ xsl:import href=[Path to highlighting/common.xsl]/ xsl:import href=[Path to html/highlight.xsl]/ xsl:param name=base.dir select='[Path to your basedir]/ xsl:param name=highlight.source select=1/ And, as a last resort... The MD5SUM of the xslthl-config.xml c64c7a25b6c62422f6b4653f4f6174c2 xslthl-config.xml In case you haven't checked that your xslthl library isn't broken somehow... And that's it. All I can suggest now is that you copy some of your data into the test I sent, configure the paths in the build.xml and try to find out whether the ANT build does produce the correct output... for if it does then we know that it's a problem with your normal setup. Otherwise, all bets are off and it could be broken JARs or something similar... Thanks very much for trying, here are my checksums of both the xslthl-config.xml I've tried: md5sum /www/notlive/docbook/docbook-xsl-1.74.3-pre/highlighting/xslthl-config.xml c64c7a25b6c62422f6b4653f4f6174c2 /www/notlive/docbook/docbook-xsl-1.74.3-pre/highlighting/xslthl-config.xml md5sum /www/notlive/docbook/xslthldamnit/highlighters/xslthl-config.xml c64c7a25b6c62422f6b4653f4f6174c2 /www/notlive/docbook/xslthldamnit/highlighters/xslthl-config.xml OK I've never used ANT before, I'll look into how to try yours out. All you would need is to install it, look at the paths at the beginning of the build.xml and then run ant in the directory with the build.xml It should produce its files in the output directory. Actually, can you try one more thing for me- have you tried doing yours from the command line instead of ANT? (Or do you mean you just tried that already). And yes, I have tried that already (since you sent your command line). If you get yours to run from command line then I give up too! thanks Juri As for giving up... ANT is not the only way this could be done... writing a bash script would serve the same purpose. Would that be of more use to you? Yea, er sure, but what would the bash script be doing that the command line isn't? (I mean, isn't a bash script just a series of command line calls?) I'll try and get ant installed. Still, seems weird that this isn't possible from command line... If I can only get it working by using ant then I should file that as a bug with the xslthl project. thanks - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Alright... my last attempt for today since it's getting late over here. Attached you'll find a new version of my example project. It now has a build.sh file. I added all paths you mentioned in your previous mails and it should produce an index.html in the output directory that, hopefully, has highlighting enabled... Good luck with that one. Juri - -- Everyone is more or less mad on one point. -- Rudyard Kipling -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREDAAYFAkmkX/wACgkQeKE9NrxdrXwTHACfVwiZsjcrjzBLmSLItD6j2zGh QMYAn2QRs6SZfyADQxjX9Hv1q6Tc7RAw =LD+9 -END PGP SIGNATURE- highlight_bash.tar.bz2 Description: application/bzip - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
Mike wrote: Mauritz Jeanson wrote: | -Original Message- | From: Mike | | I'm following the instructions here to make syntax | highlighting work, | are these the wrong instructions to follow? | | http://www.sagehill.net/docbookxsl/SyntaxHighlighting.html That documentation is not completely up-to-date, unfortunately. | java -cp | /www/notlive/docbook/docbook-xsl-1.74.3-pre/extensions/saxon 65.jar:/www/notlive/docbook/saxondamnit/saxon.jar:/www/notlive/docbook/xslth ldamnit/xslthl-2.0.1.jar | \ | -Dhighlight.source=1 \ Here you pass highlight.source=1 as a Java system property, but that won't work since it is an XSLT parameter. But you also added it as parameter in chunkohp.xsl, so that's OK. | -Dxslthl.config=file:///www/notlive/docbook/xslthldamnit/hig | hlighters/xslthl-config.xml | \ | com.icl.saxon.StyleSheet ./text.xml | /www/notlive/docbook/docbook-xsl-1.74.3-pre/html/chunkohp.xsl There are some changes in DocBook-XSL 1.74.3 that haven't been properly announced and documented yet. This is what's needed to use the syntax higlighting extension: 1. Use a processor that works with the extension: Saxon 6 or Xalan-J. 2. Add the latest version of xslthl-2.X.X.jar to your classpath. 3. Set the highlight.source parameter to 1. 4. Import two stylesheet modules, highlighting/common.xsl and either html/highlight.xsl (for HTML output) or fo/highlight.xsl (for FO output), into your customization layer. So you need to fix item 4. Thank you, it's still not working but I feel like I'm closer. Here's what's wrong now. I still get the same output (no highlighting), but during the transform it says: XSLT Highlighter: Cannot read xslthl-config.xml, no custom highlighters will be available. If I copy and paste the path I gave it into firefox (linux), firefox finds the file fine and displays it. That path is CORRECT! -Dxslthl.config=file:///www/notlive/docbook/xslthldamnit/highlighters/xslthl-config.xml I also tried giving it the path to the xslthl-config.xml file that comes with the docbook xsl: -Dxslthl.config=file:///www/notlive/docbook/docbook-xsl-1.74.3-pre/highlighting/xslthl-config.xml \ Which is also a valid path, and I can also cut and paste into firefox (including the file:// part) and see the file. Still get the error message and no highlighting. (Bump.) Has *anyone* been able to successfully get syntax highlighting to work in linux with the latest DocBook, Saxon 6.5.5, and xslthl-2.0.1? I want to know if this is even possible or a fatal bug... - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
-BEGIN PGP SIGNED MESSAGE- Hash: RIPEMD160 Mike wrote: (Bump.) Has *anyone* been able to successfully get syntax highlighting to work in linux with the latest DocBook, Saxon 6.5.5, and xslthl-2.0.1? I want to know if this is even possible or a fatal bug... Yes, I have gotten it to work for Java code in one of my articles. I could send you a version of my build scripts (using ANT) with an example, if that helps. With kind regards, Juri Memmert - -- The test of a first-rate intelligence is the ability to hold two opposed ideas in the mind at the same time and still retain the ability to function. -- F. Scott Fitzgerald -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEAREDAAYFAkmjiZoACgkQeKE9NrxdrXzXzgCfcEe5qf7EID7PVQNHFAhbPlKo JBAAoIxR72nIEwSBWGWirzxH2VUjLztb =8E55 -END PGP SIGNATURE- - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
[docbook-apps] syntax highlighting doesn't work, nor throws errors.
I'm following the instructions here to make syntax highlighting work, are these the wrong instructions to follow? http://www.sagehill.net/docbookxsl/SyntaxHighlighting.html java -cp /www/notlive/docbook/docbook-xsl-1.74.3-pre/extensions/saxon65.jar:/www/notlive/docbook/saxondamnit/saxon.jar:/www/notlive/docbook/xslthldamnit/xslthl-2.0.1.jar \ -Dhighlight.source=1 \ -Dxslthl.config=file:///www/notlive/docbook/xslthldamnit/highlighters/xslthl-config.xml \ com.icl.saxon.StyleSheet ./text.xml /www/notlive/docbook/docbook-xsl-1.74.3-pre/html/chunkohp.xsl I've also tried without the saxon65.jar in there. also the -Dhighlight.source=1 \ was a recent attempt to get it to work, so I've tried without that too. here's my text.xml file: ?xml version=1.0 encoding=UTF-8? !DOCTYPE book PUBLIC -//OASIS//DTD DocBook XML V4.5//EN http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd; ?altova_sps http://www.altova.com/sps/Template/Publishing/docbook.sps? book titleBook Title/title part titlePart Title/title chapter titleChapter Title/title sect1 titleSection1 Title/title paraText/para programlisting language=php![CDATA[ function dostuff($now=false) { if ($this-redo !$force) return; $this-redo=true; foreach ($this-abas $r= $a) { $a-dostuff($force); } } ]]/programlisting /sect1 /chapter /part /book My chunkohp.xsl file is the same as chunk.xsl except I added xsl:param name=highlight.source select=1/ after xsl:import href=chunk-common.xsl/ I get html output with no syntax highlighting. Saxon 6.5.5. - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
RE: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
| -Original Message- | From: Mike | | I'm following the instructions here to make syntax | highlighting work, | are these the wrong instructions to follow? | | http://www.sagehill.net/docbookxsl/SyntaxHighlighting.html That documentation is not completely up-to-date, unfortunately. | java -cp | /www/notlive/docbook/docbook-xsl-1.74.3-pre/extensions/saxon 65.jar:/www/notlive/docbook/saxondamnit/saxon.jar:/www/notlive/docbook/xslth ldamnit/xslthl-2.0.1.jar | \ | -Dhighlight.source=1 \ Here you pass highlight.source=1 as a Java system property, but that won't work since it is an XSLT parameter. But you also added it as parameter in chunkohp.xsl, so that's OK. | -Dxslthl.config=file:///www/notlive/docbook/xslthldamnit/hig | hlighters/xslthl-config.xml | \ | com.icl.saxon.StyleSheet ./text.xml | /www/notlive/docbook/docbook-xsl-1.74.3-pre/html/chunkohp.xsl There are some changes in DocBook-XSL 1.74.3 that haven't been properly announced and documented yet. This is what's needed to use the syntax higlighting extension: 1. Use a processor that works with the extension: Saxon 6 or Xalan-J. 2. Add the latest version of xslthl-2.X.X.jar to your classpath. 3. Set the highlight.source parameter to 1. 4. Import two stylesheet modules, highlighting/common.xsl and either html/highlight.xsl (for HTML output) or fo/highlight.xsl (for FO output), into your customization layer. So you need to fix item 4. Mauritz - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
Re: [docbook-apps] syntax highlighting doesn't work, nor throws errors.
Mauritz Jeanson wrote: | -Original Message- | From: Mike | | I'm following the instructions here to make syntax | highlighting work, | are these the wrong instructions to follow? | | http://www.sagehill.net/docbookxsl/SyntaxHighlighting.html That documentation is not completely up-to-date, unfortunately. | java -cp | /www/notlive/docbook/docbook-xsl-1.74.3-pre/extensions/saxon 65.jar:/www/notlive/docbook/saxondamnit/saxon.jar:/www/notlive/docbook/xslth ldamnit/xslthl-2.0.1.jar | \ | -Dhighlight.source=1 \ Here you pass highlight.source=1 as a Java system property, but that won't work since it is an XSLT parameter. But you also added it as parameter in chunkohp.xsl, so that's OK. | -Dxslthl.config=file:///www/notlive/docbook/xslthldamnit/hig | hlighters/xslthl-config.xml | \ | com.icl.saxon.StyleSheet ./text.xml | /www/notlive/docbook/docbook-xsl-1.74.3-pre/html/chunkohp.xsl There are some changes in DocBook-XSL 1.74.3 that haven't been properly announced and documented yet. This is what's needed to use the syntax higlighting extension: 1. Use a processor that works with the extension: Saxon 6 or Xalan-J. 2. Add the latest version of xslthl-2.X.X.jar to your classpath. 3. Set the highlight.source parameter to 1. 4. Import two stylesheet modules, highlighting/common.xsl and either html/highlight.xsl (for HTML output) or fo/highlight.xsl (for FO output), into your customization layer. So you need to fix item 4. Thank you, it's still not working but I feel like I'm closer. Here's what's wrong now. I still get the same output (no highlighting), but during the transform it says: XSLT Highlighter: Cannot read xslthl-config.xml, no custom highlighters will be available. If I copy and paste the path I gave it into firefox (linux), firefox finds the file fine and displays it. That path is CORRECT! -Dxslthl.config=file:///www/notlive/docbook/xslthldamnit/highlighters/xslthl-config.xml I also tried giving it the path to the xslthl-config.xml file that comes with the docbook xsl: -Dxslthl.config=file:///www/notlive/docbook/docbook-xsl-1.74.3-pre/highlighting/xslthl-config.xml \ Which is also a valid path, and I can also cut and paste into firefox (including the file:// part) and see the file. Still get the error message and no highlighting. - To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org
[docbook-apps] Syntax Highlighting in Code Samples
I'm trying to get the syntax highlighting stuff to work but I'm running into a few problems: 1. My callouts are not working. They produce errors and the graphics don't show up in the code listings. 2. Places where I've added emphasis elements to my code listing to callout a particular line are creating errors. The samples are output but, they are wrapped in things like emcodeoutputDir/code/em. What did I miss in my set up?
AW: [docbook-apps] Syntax Highlighting in synopsis elements
Oops, I thought synopsis included all types of synopsis elements. Thank you for your answer! Mathias -Ursprüngliche Nachricht- Von: Jirka Kosek [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 25. November 2008 15:25 An: Mathias Schindler Cc: docbook-apps@lists.oasis-open.org Betreff: Re: [docbook-apps] Syntax Highlighting in synopsis elements Mathias Schindler wrote: In Bob Stayton's DocBook XSL: The Complete Guide it says that Highlighting works with programlisting, screen, and synopsis elements that have a language attribute.. But in your source there is no synopsis element, only classsynopsis etc. Generally syntax highlighting is working in verbatim elements. I suppose that in classsynopsis you can quite easily add highlighting by overriding templates for nested elements like ooclass, modifier, ... In theory syntax highlighting could be combined with the current classsynopsis code, but I'm not sure how well will highlighting fit into templates for nested elements. You can file new RFE at SourceForge site, so once developers have free time (;-)) they might try to implement this feature. Jirka -- -- Jirka Kosek e-mail: [EMAIL PROTECTED] http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member -- - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[docbook-apps] Syntax Highlighting in synopsis elements
Dear docbook users, I use the xslthl.jar file to highlight my Java and XML programlistings and it works very well. I also generate an Appendix of my JavaDoc-Documentation with the dbdoclet(www.dbdoclet.org) and include it at the end of my document. In this Appendix, every class is written into a classsynopsis tag with constructorsynopsis and methodsynopsis child tags, but they are not highlighted although every tag has a language attribute, they just have the formatting of my monospace.verbatim.properties attribute-set! In Bob Stayton's DocBook XSL: The Complete Guide it says that Highlighting works with programlisting, screen, and synopsis elements that have a language attribute.. Here you have an example of the structure: classsynopsis class=class language=java ooclass modifierpublic/modifier classnamecom.matrixware.xx.core.BaseBundle/classname /ooclass classsynopsisinfo role=comment// Public Constructors/classsynopsisinfo constructorsynopsis language=java modifierpublic/modifier methodnameBaseBundle/methodname void/ /constructorsynopsis classsynopsisinfo role=comment// Public Methods/classsynopsisinfo methodsynopsis language=java modifierpublic/modifier typevoid/type methodnameregisterReadDataAccessor/methodname methodparamtypejava.lang.String/typeparameterid/parameter/met hodparam methodparamtypeT extends lt;anygt;/typeparameterdataAccessor/parameter/methodparam /methodsynopsis /classsynopsis What did I do wrong? Thanks in advance. Mathias
Re: [docbook-apps] Syntax Highlighting in synopsis elements
Mathias Schindler wrote: In Bob Stayton's DocBook XSL: The Complete Guide it says that Highlighting works with programlisting, screen, and synopsis elements that have a language attribute.. But in your source there is no synopsis element, only classsynopsis etc. Generally syntax highlighting is working in verbatim elements. I suppose that in classsynopsis you can quite easily add highlighting by overriding templates for nested elements like ooclass, modifier, ... In theory syntax highlighting could be combined with the current classsynopsis code, but I'm not sure how well will highlighting fit into templates for nested elements. You can file new RFE at SourceForge site, so once developers have free time (;-)) they might try to implement this feature. Jirka -- -- Jirka Kosek e-mail: [EMAIL PROTECTED] http://xmlguru.cz -- Professional XML consulting and training services DocBook customization, custom XSLT/XSL-FO document processing -- OASIS DocBook TC member, W3C Invited Expert, ISO JTC1/SC34 member -- signature.asc Description: OpenPGP digital signature
Re: [docbook-apps] syntax highlighting with xslthl.jar
Mauritz Jeanson a écrit : -Original Message- From: Thierry B. just to avoid that someone else search for a long time like me: - use java = 1.5, not 1.4 or 1.6. While all other docbook things I do works with my previous java 1.4.2, I got a java error with xslthl.jar with this java version and 1.6.01. I use 1.5.06 I'm using Java 1.6.0_01, and XSLTHL highlighting works fine. Can you please tell us exactly what Java error you got? Sorry, problem gone after 1.6.0_01-b06 uninstall and install again. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[docbook-apps] syntax highlighting with xslthl.jar
Hi, just to avoid that someone else search for a long time like me: - use java = 1.5, not 1.4 or 1.6. While all other docbook things I do works with my previous java 1.4.2, I got a java error with xslthl.jar with this java version and 1.6.01. I use 1.5.06 - With the correct java runtime, I get no highlighting. It take some times for me to find that /xhtml/highlight.xsl is wrong, it contains span class=ERROR strings. Changing them to span style=color: xxx works fine! Thierry B. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [docbook-apps] Syntax Highlighting
On 3/15/07, Bob Stayton [EMAIL PROTECTED] wrote: I've used xslthl.jar with 1.72.0 and Saxon 6.5.5. I think it is the best approach. Ah, glad to see that someone got it going.[1] :-) Can you provide more details on how you are using it? Yeah, here is my Saxon6.5 attempt: $ ./highlight-fo.sh -o ch09.fo ch09.xml /work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl Making portrait pages on USletter paper (8.5inx11in) potentially highlighting? false FOOO! Error at xsl:apply-templates on line 29 of file:/work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl: The URI java:net.sf.xslthl.ConnectorSaxon6 does not identify an external Java class Transformation failed: Run-time errors were reported $ less highlight-fo.sh #!/bin/sh #SAXON=/usr/share/saxon/lib/saxon8.jar #CP8=/work/tools/keith/scratch/xslthl-cvs/build/classes/net/sf/xslthl/ConnectorSaxon8.class:/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar OLD_CP=$CLASSPATH export CLASSPATH= SAXON=/usr/share/saxon/lib/old/6.5/saxon.jar CP6=/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar XSLTHL_CONFIG=/work/tools/docbook/highlighting/xslthl-config.xml /usr/bin/java -classpath $CP6 -Dxslthl.config=$XSLTHL_CONFIG -Xmx1024m -jar $SAXON $* export CLASSPATH=$OLD_CP $ less /work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl ?xml version=1.0? xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:xslthl=http://xslthl.sf.net; xmlns:hl=java:net.sf.xslthl.ConnectorSaxon6 xmlns:axf=http://www.antennahouse.com/names/XSL/Extensions; xmlns:exsl=http://exslt.org/common; version=1.0 exclude-result-prefixes=xslthl exsl hl xsl:import href=../docbook-xsl/fo/docbook.xsl/ !-- cool stuff here -- xsl:param name=highlight.source select=1/ xsl:template name=apply-highlighting xsl:messagepotentially highlighting? xsl:value-of select=function-available('hl-highlight')/ /xsl:message xsl:choose !-- Blow up if you can't highlight-- xsl:when test=$highlight.source != 0 !--and function-available('hl:highlight') -- xsl:variable name=language xsl:call-template name=language.to.xslthl xsl:with-param name=context select=./ /xsl:call-template /xsl:variable xsl:choose xsl:when test=$language != '' xsl:variable name=content xsl:apply-templates/ /xsl:variable xsl:apply-templates select=hl:highlight($language, exsl:node-set($content))/ /xsl:when xsl:otherwise xsl:apply-templates/ /xsl:otherwise /xsl:choose /xsl:when !-- No syntax highlighting -- xsl:otherwise xsl:apply-templates/ /xsl:otherwise /xsl:choose /xsl:template xsl:template name=language.to.xslthl xsl:param name=context/ !-- Expand content (to handle e.g. textdata fileref=.../) -- xsl:variable name=content xsl:apply-templates select=$context/node()/ /xsl:variable xsl:messageFOOO! /xsl:message xsl:choose xsl:when test=$context/@language != '' xsl:value-of select=$context/@language/ /xsl:when !-- Files containing / are considered to be XML files -- xsl:when test=contains($content, 'lt;/')xml/xsl:when xsl:otherwise xsl:textc/xsl:text /xsl:otherwise /xsl:choose /xsl:template /xsl:stylesheet (I tried building a JAR from the CVS repo of XSLTHL and using a Saxon8 Connector described here[1], but that failed in a similar way). Keith 1. http://sourceforge.net/forum/forum.php?thread_id=1652381forum_id=513404 2. http://sourceforge.net/forum/forum.php?thread_id=1606945forum_id=513404 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [docbook-apps] Syntax Highlighting
Well, I tried your command and it did not work. When I replaced the -jar $SAXON with the classname com.icl.saxon.StyleSheet, it worked. Anyone know why that would happen? Bob Stayton Sagehill Enterprises DocBook Consulting [EMAIL PROTECTED] - Original Message - From: Keith Fahlgren [EMAIL PROTECTED] To: Bob Stayton [EMAIL PROTECTED] Cc: apps docbook docbook-apps@lists.oasis-open.org Sent: Thursday, March 15, 2007 7:47 AM Subject: Re: [docbook-apps] Syntax Highlighting On 3/15/07, Bob Stayton [EMAIL PROTECTED] wrote: I've used xslthl.jar with 1.72.0 and Saxon 6.5.5. I think it is the best approach. Ah, glad to see that someone got it going.[1] :-) Can you provide more details on how you are using it? Yeah, here is my Saxon6.5 attempt: $ ./highlight-fo.sh -o ch09.fo ch09.xml /work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl Making portrait pages on USletter paper (8.5inx11in) potentially highlighting? false FOOO! Error at xsl:apply-templates on line 29 of file:/work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl: The URI java:net.sf.xslthl.ConnectorSaxon6 does not identify an external Java class Transformation failed: Run-time errors were reported $ less highlight-fo.sh #!/bin/sh #SAXON=/usr/share/saxon/lib/saxon8.jar #CP8=/work/tools/keith/scratch/xslthl-cvs/build/classes/net/sf/xslthl/ConnectorSaxon8.class:/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar OLD_CP=$CLASSPATH export CLASSPATH= SAXON=/usr/share/saxon/lib/old/6.5/saxon.jar CP6=/work/tools/keith/scratch/xslthl-cvs/build/xslthl.jar XSLTHL_CONFIG=/work/tools/docbook/highlighting/xslthl-config.xml /usr/bin/java -classpath $CP6 -Dxslthl.config=$XSLTHL_CONFIG -Xmx1024m -jar $SAXON $* export CLASSPATH=$OLD_CP $ less /work/tools/keith/devprod/trunk/oneoffs/highlight6.xsl ?xml version=1.0? xsl:stylesheet xmlns:xsl=http://www.w3.org/1999/XSL/Transform; xmlns:fo=http://www.w3.org/1999/XSL/Format; xmlns:xslthl=http://xslthl.sf.net; xmlns:hl=java:net.sf.xslthl.ConnectorSaxon6 xmlns:axf=http://www.antennahouse.com/names/XSL/Extensions; xmlns:exsl=http://exslt.org/common; version=1.0 exclude-result-prefixes=xslthl exsl hl xsl:import href=../docbook-xsl/fo/docbook.xsl/ !-- cool stuff here -- xsl:param name=highlight.source select=1/ xsl:template name=apply-highlighting xsl:messagepotentially highlighting? xsl:value-of select=function-available('hl-highlight')/ /xsl:message xsl:choose !-- Blow up if you can't highlight-- xsl:when test=$highlight.source != 0 !--and function-available('hl:highlight') -- xsl:variable name=language xsl:call-template name=language.to.xslthl xsl:with-param name=context select=./ /xsl:call-template /xsl:variable xsl:choose xsl:when test=$language != '' xsl:variable name=content xsl:apply-templates/ /xsl:variable xsl:apply-templates select=hl:highlight($language, exsl:node-set($content))/ /xsl:when xsl:otherwise xsl:apply-templates/ /xsl:otherwise /xsl:choose /xsl:when !-- No syntax highlighting -- xsl:otherwise xsl:apply-templates/ /xsl:otherwise /xsl:choose /xsl:template xsl:template name=language.to.xslthl xsl:param name=context/ !-- Expand content (to handle e.g. textdata fileref=.../) -- xsl:variable name=content xsl:apply-templates select=$context/node()/ /xsl:variable xsl:messageFOOO! /xsl:message xsl:choose xsl:when test=$context/@language != '' xsl:value-of select=$context/@language/ /xsl:when !-- Files containing / are considered to be XML files -- xsl:when test=contains($content, 'lt;/')xml/xsl:when xsl:otherwise xsl:textc/xsl:text /xsl:otherwise /xsl:choose /xsl:template /xsl:stylesheet (I tried building a JAR from the CVS repo of XSLTHL and using a Saxon8 Connector described here[1], but that failed in a similar way). Keith 1. http://sourceforge.net/forum/forum.php?thread_id=1652381forum_id=513404 2. http://sourceforge.net/forum/forum.php?thread_id=1606945forum_id=513404 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
[docbook-apps] Syntax Highlighting
Hey, Just wanted to get the current consensus on the state of syntax highlight for FO. XSLTHL[1] looks nice, but I can't get it running...[2]. Bob mentions JEdit Syntax[3], which I think I can find more on in the archives[4]. Does anyone have a syntax coloring technique that they particularly like? Does it add some semantic richness, or is all code/@role based? Thanks, Keith 1. http://xmlguru.cz/2006/07/docbook-syntax-highlighting 2. Using 1.72.0, various saxons, apparently proper class path and -D setting... ( The URI java:net.sf.xslthl.ConnectorSaxon6 does not identify an external Java class) 3. http://www.sagehill.net/docbookxsl/SyntaxHighlighting.html 4. And other, older solutions like http://sources.redhat.com/ml/docbook-apps/2003-q3/msg00421.html - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]