Skip to content

Commit

Permalink
GRAILS-7231 Internal documentation engine produces broken links in in…
Browse files Browse the repository at this point in the history
…dex.html and grails doc -pdf does not work anymore

- fix broken links in generated index.html
- fix path for PDF generation
  • Loading branch information
slaunay authored and pledbrook committed Feb 14, 2011
1 parent 71488ba commit 627d529
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
6 changes: 3 additions & 3 deletions scripts/_GrailsDocs.groovy
Expand Up @@ -271,12 +271,12 @@ target(createIndex: "Produces an index.html page in the root directory") {
"""

if (createdManual) {
writer.write '\t\t<a href="manual/index.html">Manual (Frames)</a><br />\n'
writer.write '\t\t<a href="manual/guide/single.html">Manual (Single)</a><br />\n'
writer.write '\t\t<a href="guide/index.html">Manual (Frames)</a><br />\n'
writer.write '\t\t<a href="guide/single.html">Manual (Single)</a><br />\n'
}

if (createdPdf) {
writer.write '\t\t<a href="manual/guide/single.pdf">Manual (PDF)</a><br />\n'
writer.write '\t\t<a href="guide/single.pdf">Manual (PDF)</a><br />\n'
}

writer.write """\
Expand Down
12 changes: 6 additions & 6 deletions src/java/grails/doc/PdfBuilder.groovy
Expand Up @@ -32,9 +32,9 @@ class PdfBuilder {
/**
* Builds a PDF file from the manual's single.html file.<p>
* The following directories are assumed to exist:<ul>
* <li> $basedir/manual/guide/single.html</li>
* <li> $basedir/manual/css/</li>
* <li> $basedir/manual/img/</li>
* <li> $basedir/guide/single.html</li>
* <li> $basedir/guide/css/</li>
* <li> $basedir/guide/img/</li>
* <li> $home/src/$tool/docs/style</li>
* </ul>
*
Expand All @@ -49,12 +49,12 @@ class PdfBuilder {
String home = options.home
String tool = options.tool ?: 'grails'

File htmlFile = new File("${baseDir}/manual/guide/single.html")
File outputFile = new File("${baseDir}/manual/guide/single.pdf")
File htmlFile = new File("${baseDir}/guide/single.html")
File outputFile = new File("${baseDir}/guide/single.pdf")
File homeFile = new File(home).canonicalFile
String urlBase = "file://${homeFile.absolutePath}/src/${tool}/docs/style"

String xml = createXml(htmlFile, "${baseDir}/manual")
String xml = createXml(htmlFile, "${baseDir}")
createPdf xml, outputFile, urlBase
}

Expand Down

0 comments on commit 627d529

Please sign in to comment.