Closed erichschroeter closed 12 years ago
You probably want to use this as a starting point instead: https://github.com/pressgang/docbook5-poc
Look at the staging stuff.
So, I cloned the docbook5-poc
project and executed the buildDocs
task and it was successfully built. I then:
build.gradle
file to only use the default book config (which is what the docbook5-poc
uses)stylesheet = 'classpath:/xslt/org/jboss/pressgang/xhtml-single.xsl'
src/main/style
to my projectand my project built successfully. The problem with the resources comes in as soon as I try to use multiple book configs.
I want to have at least 2 configs, one for manual and another for devguide. However, I keep getting the resource error mentioned above. Do you have any good examples of multi-book config projects? I'm following the same pattern as that of the multilbooks.gradle sample; is it out-dated?
I'm stumped by this one too. You can't point the stylesheet to "${project.path}/stylesheets/something.xsl" because project isn't defined in the context of the jdocbook plugin.
Ah, found it.
final URL transformationStylesheet = componentRegistry.getEnvironment().getResourceDelegate().requireResource( formatPlan.getStylesheetResource() );
which turns out to require syntax like this:
stylesheet = "file:stylesheets/pdf.xsl"
Steve, can I suggest you add this syntax to the example files to save someone else several hours of going in circles. Thanks for the great plugin.
We probably could (should?) expose 'project' as a scripting variable inside our closure. That's a separate feature request to me. Feel free to make that if you think it is worthwhile.
As far as the URL syntax, you don't have to use the file:
scheme... The code also understands a classpath:
scheme. Again, you have to understand that all these "resources" get staged. You can name them relative to the staging dir using this classpath:
URL scheme.
Since I have multiple docbook documents, the stylesheets aren't inside the src directory for each, so classpath wasn't getting me anywhere. I keep a common set of stylesheets at the top level.
Anyway, file: is working for me. Just took some time to figure it out. Thanks.
Now onto my next problems:
Perhaps the docbook xsl is different to the maven plugin I was previously using. At the very least I can see it is XSL version 1 and not version 2.
I have a docbook project setup similar to the hibernate project (I've been using it as an example to get up and running with this plugin). My
build.gradle
is as follows:However, I am getting errors when running the
buildDocs
task where resources cannot be located:The
xhtml-single.xsl
file is located insrc/main/style/xslt/org/hibernate/jdocbook/xslt/
but it still is not found. I tried just commenting out the classpath, and it appears jdocbook looks for a default stylesheet at/html/docbook.xsl
. So, I tried placing a dummydocbook.xsl
file in the following places within the project, but no matter where I put it, it was not located:src/main/style/html/docbook.xsl
src/main/docbook/html/docbook.xsl
src/main/docbook/manual/en-US/html/docbook.xsl
src/main/html/docbook.xsl
I've tried looking at the plugin code, but I'm fairly new to Groovy and Gradle, so I don't have much confidence in evaluating it. How are resources located in the jdocbook plugin? Do I have to put resources in a special place?