Convert a Docbook-structured Scaml file to single-page/multi-page HTML Raw
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// convert the HAML/SCAML layout file to Docbook XML | |
val engine = new org.fusesource.scalate.TemplateEngine | |
val output = engine.layout("src/main/docbook/handbook.scaml") | |
val file = (target in Compile).value / "handbook.xml" | |
IO.write(file, output) | |
// create Docbook HTML | |
import scala.sys.process._ | |
// TODO make this independent of local user's environment | |
val xsltool = "xsltproc" | |
val dbPath = "/usr/share/xml/docbook/stylesheet/nwalsh5/1.79.0/html" | |
val dbOptions = "--stringparam" :: "section.autolabel" :: "1" :: | |
"--stringparam" :: "section.label.includes.component.label" :: "1" :: | |
"--stringparam" :: "chunker.output.encoding" :: "UTF-8" :: | |
Nil | |
val singlePageCmd: List[String] = xsltool :: dbOptions ++ | |
List("-o", "handbook/index.html", | |
s"$dbPath/onechunk.xsl", file.toString) | |
singlePageCmd.! | |
val multiPageCmd: List[String] = xsltool :: dbOptions ++ | |
List("-o", "handbook-pages/", | |
s"$dbPath/chunk.xsl", file.toString) | |
multiPageCmd.! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment