├── .gitignore ├── LICENSE ├── README.adoc ├── asciidoctor-fopub.gemspec ├── bin └── fopub ├── build.gradle ├── docbook-xsl-content.png ├── fopub ├── fopub.bat ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── lib └── asciidoctor │ ├── fopub.rb │ └── fopub │ └── version.rb ├── sample-pdf-screenshot.png ├── settings.gradle └── src ├── dist ├── catalog.xml ├── db5.ent └── docbook-xsl │ ├── callouts.xsl │ ├── common.xsl │ ├── fo-pdf.xsl │ ├── fop-config.xml │ ├── highlight.xsl │ ├── xhtml.xsl │ ├── xslthl-config.xml │ └── xslthl │ ├── asciidoc-hl.xml │ ├── bourne-hl.xml │ ├── c-hl.xml │ ├── cpp-hl.xml │ ├── csharp-hl.xml │ ├── css-hl.xml │ ├── html-hl.xml │ ├── ini-hl.xml │ ├── java-hl.xml │ ├── javascript-hl.xml │ ├── perl-hl.xml │ ├── php-hl.xml │ ├── python-hl.xml │ ├── ruby-hl.xml │ ├── rust-hl.xml │ └── sql2003-hl.xml └── main └── java └── org └── apache └── fop └── cli └── InputHandler.java /.gitignore: -------------------------------------------------------------------------------- 1 | /.gradle/ 2 | /build/ 3 | /.idea 4 | *.iml -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright (C) 2013 Dan Allen 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.adoc: -------------------------------------------------------------------------------- 1 | = asciidoctor-fopub 2 | Dan Allen 3 | v0.2.0, 2013-11-27 4 | ifdef::basebackend-docbook[:doctype: book] 5 | :license: https://github.com/asciidoctor/asciidoctor-fopub/blob/master/LICENSE[MIT] 6 | :idprefix: 7 | :idseparator: - 8 | :experimental: 9 | 10 | DocBook-to-PDF conversion using free software made easy! (based on DocBook XSL and Apache FOP) 11 | 12 | Using the asciidoctor-fopub project, you can convert any DocBook file into a nicely formatted PDF with nothing more than a Java runtime (JVM) and development kit (JDK). 13 | All the open source software required to perform the conversion is automatically fetched from the internet the first time you run it. 14 | 15 | [NOTE,caption=Scope] 16 | fopub is a replacement for `a2x` command from AsciiDoc Python. 17 | a2x is a standalone frontend to the DocBook toolchain. 18 | fopub (like a2x) is meant to be used when you don't have a Gradle (or Maven) build. 19 | Once you are in the Gradle world, you can simply leverage the jDocBook plugin to accomplish what fopub is doing (as seen in the Spring and Hibernate builds). 20 | 21 | == Doing is believing 22 | 23 | Before we get into the goals and the technical details of the project, let's see the conversion in action! 24 | 25 | === Prerequisites 26 | 27 | The only prerequisite to perform the DocBook to PDF conversion is a Java Development Kit (JDK), which includes the Java runtime (and, naturally, an internet connection). 28 | You can use any recent JDK (i.e., Java SE 8 or better). 29 | 30 | If Java runtime (JVM) is setup correctly, you should be able to type: 31 | 32 | $ java -version 33 | 34 | or 35 | 36 | $ "$JAVA_HOME/bin/java -version" 37 | 38 | and see output that looks like: 39 | 40 | .... 41 | openjdk version "1.8.0_181" 42 | OpenJDK Runtime Environment (build 1.8.0_181-b15) 43 | OpenJDK 64-Bit Server VM (build 25.181-b15, mixed mode) 44 | .... 45 | 46 | If the Java Devlopment Kit (JDK) is setup correctly, you should be able to type: 47 | 48 | $ javac -version 49 | 50 | or 51 | 52 | $ "$JAVA_HOME"/bin/javac -version" 53 | 54 | and see output that looks like: 55 | 56 | .... 57 | javac 1.8.0_181 58 | .... 59 | 60 | If not, you can install a JDK using your system's package manager or by downloading a distribution from the http://www.oracle.com/technetwork/java/javase/downloads/index.html[Java for developers download site]. 61 | 62 | WARNING: You may encounter problems if you attempt to use the GNU compiler for Java (gcj). 63 | We recommend using OpenJDK or Oracle Java. 64 | 65 | TIP: It's not even necessary to install the JDK on your system. 66 | Simply set the `JAVA_HOME` environment variable to the location where you extract the distribution. 67 | 68 | Next, you need to retrieve the asciidoctor-fopub project. 69 | 70 | === Retrieve the project 71 | 72 | You can retrieve the asciidoctor-fopub project in one of two ways: 73 | 74 | . Clone the git repository 75 | . Download a zip archive of the repository 76 | 77 | ==== Option 1: Fetch using git clone 78 | 79 | If you want to clone the git repository, simply copy the URL of the repository on GitHub and pass it to `git clone` command: 80 | 81 | $ git clone https://github.com/asciidoctor/asciidoctor-fopub 82 | 83 | Next, change to the project directory: 84 | 85 | $ cd asciidoctor-fopub 86 | 87 | ==== Option 2: Download the archive 88 | 89 | If you want to download a zip archive, click on the btn:[Download Zip] button on the right-hand side of the repository page on GitHub. 90 | Once the download finishes, extract the archive, open a console and change to that directory. 91 | 92 | TIP: Instead of working out of the asciidoctor-fopub directory, you can simply add the directory to your `PATH` environment variable. 93 | 94 | Next, let's grab a file to convert. 95 | 96 | === Generate a DocBook file 97 | 98 | If you don't already have a DocBook file, you can generate one using http://asciidoctor.org[Asciidoctor] (or your tool of choice). 99 | 100 | To create a DocBook file using Asciidoctor, first create an AsciiDoc file named [file]_sample.adoc_ in the current directory and populate it with the sample content below. 101 | 102 | .sample.adoc 103 | [source,asciidoc] 104 | .... 105 | = Document Title 106 | Doc Writer 107 | 108 | A sample http://asciidoc.org[AsciiDoc] document. 109 | 110 | == Introduction 111 | 112 | A paragraph followed by a simple list. 113 | 114 | * item 1 115 | * item 2 116 | 117 | Here's how you say "`Hello, World!`" in Ruby. 118 | 119 | .A basic Ruby application 120 | [source,ruby] 121 | ---- 122 | puts "Hello, World!" 123 | ---- 124 | 125 | TIP: asciidoctor-fopub takes the pain out of converting a DocBook file to a PDF file like this one. 126 | All you need is a Java Development Kit (JDK) and this project. 127 | The rest of the software is fetched and configured by Gradle. 128 | .... 129 | 130 | Convert the AsciiDoc file to DocBook using the `asciidoctor` (or `asciidoc`) command: 131 | 132 | $ asciidoctor -b docbook -d book -a data-uri! sample.adoc 133 | 134 | After executing this command, you should now see a new file named [file]_sample.xml_ in the current directory. 135 | 136 | IMPORTANT: We explicitly disable the `data-uri` attribute just in case it's set in the AsciiDoc document. 137 | The PDF processor will choke if it comes across embedded image data in the generated DocBook. 138 | 139 | It's time to convert it to PDF! 140 | 141 | TIP: You could also try these steps using the [file]_README.adoc_ file in the root directory of the project. 142 | 143 | === Convert DocBook to PDF 144 | 145 | We're now ready to do the conversion! 146 | It's as simple as running the `fopub` script in the current directory on our DocBook file. 147 | 148 | On Unix-based systems (e.g., Linux, OSX), run: 149 | 150 | $ ./fopub sample.xml 151 | 152 | IMPORTANT: Since we're executing a local script, you need to prefix the name of the command with `./`. 153 | 154 | TIP: If you've added the path to asciidoctor-fopub to your `PATH` environment variable, you can leave off the `./` and execute it from any directory. 155 | 156 | On Windows, run: 157 | 158 | $ fopub sample.xml 159 | 160 | NOTE: The first time you run the command, asciidoctor-fopub has to retrieve the software from the repositories and setup the conversion application, so be patient. 161 | 162 | TIP: To use the `fopub` command from behind a proxy, you'll need to configure the Gradle proxy settings as described in http://www.gradle.org/docs/current/userguide/build_environment.html[Chapter 20 of the Gradle Reference Guide]. 163 | 164 | When it's all said and done, you should now see the file [file]_sample.pdf_ in the current directory. 165 | Open that file with a PDF viewer to see the result. 166 | 167 | .Sample PDF document rendered in viewer 168 | image::sample-pdf-screenshot.png[Screenshot of sample PDF document] 169 | 170 | As you can see, all the details of the conversion are hidden behind the scenes. 171 | You get to focus on getting the job done, not worry about the mess that has to be sorted out to use Apache FOP correctly and get a decent-looking document. 172 | 173 | === Custom XSL parameters 174 | 175 | Any arguments that follow the source file name are passed directly to the Apache FO processor (fop). 176 | This feature allows you to assign XSL parameters, among other things. 177 | 178 | Let's say you want to set the orientation of the PDF to landscape. 179 | The DocBook XSL templates recognize the parameter named `page.orientation`. 180 | Here's how you would pass that through fopub to fop. 181 | 182 | $ ./fopub sample.xml -param page.orientation landscape 183 | 184 | You'll now notice that the PDF generated is rendered in landscape mode. 185 | 186 | NOTE: See http://docbook.sourceforge.net/release/xsl/1.79.1/doc/param.html[DocBook XSL parameter reference] for a list of all XSL parameters you can set. 187 | 188 | === Custom XSL templates 189 | 190 | When you work on many documentations projets in *parallel*, you will probably need different outputs. 191 | 192 | .Use cases for different templates 193 | 194 | structure:: 195 | 196 | . One needs a picture in the book title page 197 | . The other needs a special text at the bottom of this page 198 | 199 | style:: 200 | 201 | . One needs the default Asciidoctor style 202 | . The other uses the Colony style 203 | 204 | In order to work on different documentation projects _in parallel_, you need to have different docbook-xsl directories. 205 | 206 | How it works: 207 | 208 | . Copy the `docbook-xsl` directory from the fopub install directory to your documentation path, [file]_/path/to/custom/fopub_. 209 | + 210 | .Content of the docbook-xsl directory 211 | image::docbook-xsl-content.png[Content of docbook-xsl directory] 212 | 213 | . Update the files you want in this directory 214 | + 215 | For example if you want to use Colony style:: 216 | You delete Asciidoctor theme, Foundation theme and you uncomment Colony theme in the `common.xsl` file. 217 | 218 | . Then you specify this directory when you launch the output generation : 219 | 220 | $ /path/to/fopub/fopub -t /path/to/custom/fopub/docbook-xsl sample.xml 221 | 222 | === fopub option flags 223 | 224 | -t :: 225 | tells fopub which docbook-xsl directory to use (optional, defaults to location inside fopub installation) 226 | -f [pdf|ps|fo|xhtml]:: 227 | tells fopub which output to produce (optional, defaults to `pdf`) 228 | -h:: 229 | prints usage 230 | 231 | == Motivation 232 | 233 | The asciidoctor-fopub project aims to provide a simple mechanism for converting DocBook to PDF. 234 | The plan is to use some form of this project to handle the DocBook to PDF conversion in http://asciidoctor.org[Asciidoctor]. 235 | We hope it's generally useful outside of Asciidoctor as well. 236 | 237 | If you've ever had to do this conversion, you will appreciate how overly-complex it is. 238 | It requires fetching the right combination of software (including the right versions), putting all the files in the right location and associating them together using a catalog and passing in the correct parameters. 239 | _It's boring and tedious._ 240 | This project handles all that magic so you don't have to. 241 | 242 | In addition to making the conversion work, the project includes the following features that are often left out: 243 | 244 | * Works with DocBook generated by AsciiDoc (supports all AsciiDoc processing instructions) 245 | * Syntax highlights source code listings using http://sourceforge.net/projects/xslthl[XSLTHL] (including a highlighter for AsciiDoc source) 246 | * Scales down images to fit within the width of the page 247 | * Applies (configurable) formatting and styling that's consistent with the Asciidoctor themes 248 | * Loads and embeds system fonts necessary to support the themes (Arial, Georgia and Liberation Mono) 249 | * Applies configuration to embed SVG-based admonition icons and callout marks 250 | * Works without an internet connection (once the initial run is complete); _drastically speeds up execution_ 251 | * Works from any directory (planned) 252 | 253 | There's a lot of research that went into making all that happen for you :) 254 | 255 | NOTE: One of the most important features of this tool--and one of the most difficult to get right--is that it works offline. 256 | By default, XSL processors fetch all necessary resources from the internet. 257 | Since these files are large and reference many other files, fetching them from the internet is exceptionally slow and a waste of network bandwidth. 258 | The `fopub` tool carefully ensures that the processor has all the files it needs (on the first run) and thus keeps it from reaching out to the internet while it performs the conversion. 259 | 260 | == Technical details 261 | 262 | Let's talk tech. 263 | 264 | === The conversion's key players: Apache FOP and DocBook XSL 265 | 266 | The main goal of this project is to download, configure and execute http://xmlgraphics.apache.org/fop[Apache FOP] to handle the conversion from DocBook to PDF using the http://en.wikipedia.org/wiki/DocBook_XSL[DocBook XSL] stylesheets. 267 | You can see from the first part of the http://www.sagehill.net/docbookxsl[DocBook XSL book] what a complex proposition this is. 268 | 269 | DocBook XSL:: The purpose of DocBook XSL is to provide a standard set of XML transformations (XSLT) from DocBook to several presentational formats, one of which is XSL-FO. 270 | 271 | Apache FOP:: Apache FOP (Formatting Objects Processor) is a print formatter driven by XSL formatting objects (XSL-FO) and an output independent formatter. 272 | It is a Java application that reads a formatting object (FO) tree and renders the resulting pages to a specified output. 273 | The primary output target is PDF. 274 | 275 | Apache FOP also includes an XSLT processor (Xalan) that handles the conversion from DocBook into the intermediatory XSL-FO format that the print formatter uses to create the PDF. 276 | 277 | When the software is all setup, we are ultimately running a command in the `fopub` script similar to this one: 278 | 279 | $ fop -xml sample.xml -xsl docbook-xsl/fo-pdf.xsl -pdf sample.pdf 280 | 281 | In reality, it's more complex. 282 | You can see the full command at the bottom of the `fopub` script. 283 | 284 | === Source highlighting using XSLTHL 285 | 286 | Readers have come to expect source code to be highlighted so it looks the same way in the document as it does in their source code editors. 287 | http://sourceforge.net/projects/xslthl[XSLTHL] provides source highlighting for PDF output. 288 | 289 | XSLTHL integration is a well-hidden feature in the DocBook XSL project. 290 | It requires a Java-based XSLT processor (like the one embedded in Apache FOP) to use it. 291 | Activating it requires passing special parameters to the processor that specify the location of the configuration file and a flag to turn it on. 292 | 293 | When everything falls into place, as it does with the `fopub` script, you get nice syntax highlighting in your PDF file and happy readers. 294 | 295 | === MathML rendering using JEuclid 296 | 297 | If you have MathML in your DocBook, it will be rendered using the http://jeuclid.sourceforge.net/jeuclid-fop/index.html[JEuclid plugin for Apache FOP]. 298 | 299 | Asciidoctor automatically converts AsciiMath to MathML when the asciimath gem is available. 300 | 301 | First, install the asciimath gem. 302 | 303 | $ gem install asciimath 304 | 305 | Then, enable the `stem` attribute when converting to DocBook using Asciidoctor. 306 | 307 | $ asciidoctor -b docbook -a stem sample.adoc 308 | 309 | Finally, run `fopub` on the DocBook file as documented above. 310 | 311 | WARNING: Asciidoctor 1.5.3 only converts AsciiMath blocks. 312 | Asciidoctor 1.5.4 will also convert inline AsciiMath elements. 313 | See asciidoctor/asciidoctor#1622. 314 | 315 | WARNING: At this time, conversion of LaTeX to MathML is not supported. 316 | However, if you have a DocBook file that contains MathML, asciidoctor-fopub will convert it. 317 | 318 | TIP: The font used for the rendered math is selected by the pickfont-math template. 319 | 320 | === Priming the pump with Gradle 321 | 322 | Setting up a Java application is no small feat. 323 | So what fetches the software and puts it all in the right place? 324 | That handywork is performed by Gradle. 325 | 326 | http://www.gradle.org[Gradle] is a Java-based automation and build tool that specializes in setting up Java applications (among other capabilities). 327 | Gradle can fetch files from remote repositories, move them around, create start scripts and assemble an application distribution. 328 | 329 | We are using Gradle to prepare a Java application into the `build/fopub` directory that the `fopub` script can execute. 330 | 331 | You may be wondering why Gradle isn't a prerequisite of this project. 332 | The answer is that the Gradle project provides a tool that can bootstrap Gradle from nothing. 333 | That tool, `gradlew`, is included with the project. 334 | It gets invoked the first time you run the `fopub` script. 335 | *Magic.* 336 | 337 | And that's essentially what this project is all about, *magic*. 338 | Converting from DocBook to PDF shouldn't be hard. 339 | We are doing our best to hide those details so that it's as simple as it should be. 340 | 341 | == Software versions 342 | 343 | [cols="2*", options="header"] 344 | |=== 345 | |Software Project |Version 346 | 347 | |Apache FOP 348 | |2.1 349 | 350 | |DocBook XSL 351 | |1.79.1 352 | 353 | |Apache Commons XML Resolver 354 | |1.2 355 | 356 | |Xalan 357 | |2.6.0 358 | 359 | |JEuclid 360 | |3.1.9 361 | 362 | |XSLTHL 363 | |2.1.0 364 | 365 | |Gradle 366 | |4.9 367 | |=== 368 | 369 | == Contributing 370 | 371 | In the spirit of free software, _everyone_ is encouraged to help improve this project. 372 | 373 | To contribute code, simply fork the project on GitHub, hack away and send a pull request with your proposed changes. 374 | 375 | Feel free to use the https://github.com/asciidoctor/asciidoctor-fopub/issues[issue tracker] or http://discuss.asciidoctor.org[Asciidoctor mailing list] to provide feedback or suggestions in other ways. 376 | 377 | == Authors 378 | 379 | *asciidoctor-fopub* was written by https://github.com/mojavelinux[Dan Allen]. 380 | It builds on prior work done by authors of the http://asciidoc.org[AsciiDoc], https://github.com/pressgang/jdocbook-core[jDocBook] and http://www.jboss.org/pressgang[PressGang] projects. 381 | 382 | == Copyright 383 | 384 | Copyright (C) 2013-2018 Dan Allen. 385 | Free use of this software is granted under the terms of the MIT License. 386 | 387 | See the link:LICENSE[LICENSE] file for details. 388 | -------------------------------------------------------------------------------- /asciidoctor-fopub.gemspec: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | lib = File.expand_path('../lib', __FILE__) 3 | $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib) 4 | require 'asciidoctor/fopub/version' 5 | 6 | Gem::Specification.new do |spec| 7 | spec.name = "asciidoctor-fopub" 8 | spec.version = Asciidoctor::Fopub::VERSION 9 | spec.authors = ["Dan Allen"] 10 | spec.email = ['dan.j.allen@gmail.com'] 11 | spec.summary = %q{A portable DocBook-to-PDF build command that wraps DocBook XSL and Apache FOP} 12 | spec.description = %q{DocBook-to-PDF conversion using free software made easy! (based on DocBook XSL and Apache FOP) 13 | 14 | Using the asciidoctor-fopub project, you can convert any DocBook file into a nicely formatted PDF with nothing more than a Java runtime (JVM) and development kit (JDK). All the open source software required to perform the conversion is automatically fetched from the internet the first time you run it.} 15 | spec.homepage = "https://github.com/asciidoctor/asciidoctor-fopub" 16 | spec.license = "MIT" 17 | 18 | spec.files = `git ls-files -z`.split("\x0") 19 | spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) } 20 | spec.test_files = spec.files.grep(%r{^(test|spec|features)/}) 21 | spec.require_paths = ["lib"] 22 | 23 | spec.add_development_dependency "bundler", "~> 1.7" 24 | spec.add_development_dependency "rake", "~> 10.0" 25 | end 26 | -------------------------------------------------------------------------------- /bin/fopub: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env ruby 2 | parent_dir = File.dirname(File.absolute_path(File.dirname(__FILE__))) 3 | if /cygwin|mswin|mingw|bccwin|wince|emx/ =~ RUBY_PLATFORM 4 | # TODO: test this code on Windows 5 | command = 'cmd.exe' 6 | args = ['/c', File.join(parent_dir, 'fopub.bat')].concat(ARGV) 7 | else 8 | command = File.join(parent_dir, 'fopub') 9 | args = ARGV 10 | end 11 | exec command, *args 12 | -------------------------------------------------------------------------------- /build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'application' 2 | 3 | group = 'org.asciidoctor' 4 | version = '1.0.0-SNAPSHOT' 5 | 6 | repositories { 7 | mavenCentral() 8 | mavenLocal() // snags valid artifacts from local Maven repository 9 | } 10 | 11 | configurations { 12 | dist 13 | } 14 | 15 | dependencies { 16 | // xml-resolver needed to fix buggy resolver in JDK 17 | runtime 'xml-resolver:xml-resolver:1.2' 18 | // avalon dependencies need to be specified to align with version available 19 | compile 'org.apache.avalon.framework:avalon-framework-api:4.3.1' 20 | compile 'org.apache.avalon.framework:avalon-framework-impl:4.3.1' 21 | compile 'org.apache.xmlgraphics:fop:2.1' 22 | runtime 'net.sourceforge.jeuclid:jeuclid-fop:3.1.9' 23 | runtime 'net.sf.xslthl:xslthl:2.1.0' 24 | // To enable hyphenation, uncomment the next line, then run `./gradlew clean` then use `./fopub` 25 | //runtime 'net.sf.offo:fop-hyph:2.0' 26 | dist 'net.sf.docbook:docbook-xsl:1.79.1:ns-resources@zip' 27 | dist 'org.neo4j.build.plugins:neo4j-docbook-xml:4.5' 28 | } 29 | 30 | mainClassName = 'org.apache.fop.cli.Main' 31 | applicationDefaultJvmArgs = ['-Dxml.catalog.files=APP_DIR/catalog.xml'] 32 | //applicationDefaultJvmArgs = ['-Dxml.catalog.files=/etc/xml/catalog'] 33 | 34 | installDist { 35 | destinationDir = file("$buildDir/${project.name}") 36 | } 37 | 38 | task extractDocbookXsl(type: Copy) { 39 | def archive = configurations.dist.find { it.name.endsWith('docbook-xsl-1.79.1-ns-resources.zip') } 40 | def outputDir = file("$buildDir/unpacked/docbook") 41 | from(zipTree(archive)) { 42 | // strip root docbook/ directory 43 | eachFile { it.path = it.path.substring(it.relativePath.segments[0].length()) } 44 | } 45 | into outputDir 46 | includeEmptyDirs = false 47 | } 48 | 49 | task extractDocbookXml(type: Copy) { 50 | def archive = configurations.dist.find { it.name.endsWith('docbook-xml-4.5.jar') } 51 | def outputDir = file("$buildDir/unpacked/docbook-dtds") 52 | from(zipTree(archive)) 53 | into outputDir 54 | } 55 | 56 | // put the official DocBook resources (XSL, images, etc) into the dist 57 | applicationDistribution.from(extractDocbookXsl) { 58 | into "docbook" 59 | } 60 | 61 | // put the DocBook DTDs into the dist 62 | applicationDistribution.from(extractDocbookXml) { 63 | into "docbook/xml-dtd-4.5" 64 | } 65 | 66 | CreateStartScripts startScripts = project.startScripts 67 | startScripts.with { 68 | doLast { 69 | unixScript.text = unixScript.text.replaceFirst('APP_DIR', '\\$APP_DIR') 70 | windowsScript.text = windowsScript.text.replaceFirst('APP_DIR', '%APP_DIR%') 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /docbook-xsl-content.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/asciidoctor-fopub/c5e24f7706d866f9fe374be377198a635193daf9/docbook-xsl-content.png -------------------------------------------------------------------------------- /fopub: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | abspath() { 4 | PATH_REL_DIRNAME=`dirname "$1"` 5 | PATH_ABS_DIRNAME=`cd "$PATH_REL_DIRNAME"; pwd` 6 | PATH_BASENAME=`basename "$1"` 7 | if [ "$PATH_BASENAME" == "." ]; then 8 | echo "$PATH_ABS_DIRNAME" 9 | else 10 | echo "$PATH_ABS_DIRNAME/$PATH_BASENAME" 11 | fi 12 | } 13 | 14 | usage() { 15 | echo "Usage: $0 [-t ] [-f FORMAT] [-H] FILE" 16 | echo "Example: $0 -t /path/to/custom/docbook-xsl mydoc.xml" 17 | } 18 | 19 | sedi() { 20 | sed --version >/dev/null 2>&1 && sed -i -- "$@" || sed -i "" "$@" 21 | } 22 | 23 | CONVERT_ARGS="" 24 | 25 | while getopts ':f:hHt:' opt; do 26 | case $opt in 27 | f) 28 | FORMAT=$OPTARG 29 | ;; 30 | h) 31 | usage 32 | exit 0 33 | ;; 34 | H) 35 | CONVERT_ARGS="-param hyphenate true" 36 | ;; 37 | t) 38 | DOCBOOK_XSL_DIR=$OPTARG 39 | ;; 40 | \?) 41 | echo "$0: unrecognized option '$1'" 42 | usage 43 | exit 1 44 | esac 45 | done 46 | 47 | shift $(( $OPTIND -1 )) 48 | 49 | if [ ! -r "$1" ]; then 50 | echo "$0: You must specify a DocBook v4.5 or DocBook v5 XML source file as the first command argument" 51 | usage 52 | exit 1 53 | fi 54 | 55 | SOURCE_FILE="$1" 56 | SOURCE_EXTENSION="${SOURCE_FILE##*.}" 57 | shift 58 | 59 | if [ "$SOURCE_EXTENSION" != "xml" ] && [ "$SOURCE_EXTENSION" != "fo" ]; then 60 | echo $0: Invalid source file name: "$SOURCE_FILE" 61 | echo "$0: The source file name must end in .fo (XSL-FO) or .xml (DocBook)" 62 | usage 63 | echo "Try \`asciidoctor -b docbook $1\` to convert your AsciiDoc source file to DocBook" 64 | exit 1 65 | fi 66 | 67 | if [ -z "$FORMAT" ]; then 68 | FORMAT=pdf 69 | fi 70 | 71 | PRG_DIR=`dirname "$0"` 72 | PRG_ABS_DIR=`abspath "$PRG_DIR"` 73 | GRADLEW_CMD="$PRG_DIR/gradlew" 74 | FOPUB_DIR="$PRG_DIR/build/fopub" 75 | FOPUB_ABS_DIR="$PRG_ABS_DIR/build/fopub" 76 | FOPUB_CMD="$FOPUB_DIR/bin/fopub" 77 | # APP_DIR allows this script to invoke a distributed version of the application 78 | if [ -z "$APP_DIR" ]; then 79 | export APP_DIR="$FOPUB_DIR" 80 | fi 81 | 82 | if [ ! -e "$FOPUB_CMD" ]; then 83 | echo Initializing application... 84 | "$GRADLEW_CMD" -p "$PRG_DIR" -s -q -u installDist 85 | if [ $? != 0 ]; then 86 | echo Failed to initialize application 87 | exit 1 88 | fi 89 | echo Application initialized! 90 | fi 91 | 92 | SOURCE_ROOTNAME="${SOURCE_FILE%.*}" 93 | OUT_FILE="$SOURCE_ROOTNAME.$FORMAT" 94 | 95 | DOCBOOK_DIR="$FOPUB_DIR/docbook" 96 | 97 | if [ ! -z "$DOCBOOK_XSL_DIR" ]; then 98 | DOCBOOK_XSL_ABS_DIR=`readlink -f "$DOCBOOK_XSL_DIR" 2>/dev/null` 99 | if [ $? -ne 0 ]; then 100 | DOCBOOK_XSL_ABS_DIR=`greadlink -f "$DOCBOOK_XSL_DIR" 2>/dev/null` 101 | if [ $? -ne 0 ]; then 102 | DOCBOOK_XSL_ABS_DIR="$DOCBOOK_XSL_DIR" 103 | fi 104 | fi 105 | else 106 | DOCBOOK_XSL_DIR="$FOPUB_DIR/docbook-xsl" 107 | DOCBOOK_XSL_ABS_DIR="$FOPUB_ABS_DIR/docbook-xsl" 108 | fi 109 | 110 | XSLTHL_CONFIG_URI="file://$DOCBOOK_XSL_ABS_DIR/xslthl-config.xml" 111 | 112 | CONVERT_ARGS="$CONVERT_ARGS -$SOURCE_EXTENSION \"$SOURCE_FILE\"" 113 | 114 | if [ "$SOURCE_EXTENSION" == "xml" ]; then 115 | CONVERT_ARGS="$CONVERT_ARGS -xsl \"$DOCBOOK_XSL_DIR/fo-pdf.xsl\"" 116 | if [ `grep -c '^ %db5ent;]>\n<\1:" "$SOURCE_FILE" 119 | fi 120 | fi 121 | 122 | case $FORMAT in 123 | pdf|ps) 124 | CONVERT_ARGS="$CONVERT_ARGS -$FORMAT \"$OUT_FILE\"" 125 | ;; 126 | fo) 127 | CONVERT_ARGS="$CONVERT_ARGS -foout \"$OUT_FILE\"" 128 | ;; 129 | xhtml) 130 | CONVERT_ARGS="${CONVERT_ARGS/fo-pdf/xhtml} -foout \"$OUT_FILE\"" 131 | ;; 132 | *) 133 | echo Unexpected output format: "$FORMAT" 134 | echo Valid options: pdf, ps, fo 135 | usage 136 | exit 1 137 | ;; 138 | esac 139 | 140 | eval \"$FOPUB_CMD\" -q -catalog \ 141 | -c \"$DOCBOOK_XSL_DIR/fop-config.xml\" \ 142 | $CONVERT_ARGS \ 143 | -param highlight.xslthl.config \"$XSLTHL_CONFIG_URI\" \ 144 | -param admon.graphics.path \"$DOCBOOK_DIR/images/\" \ 145 | -param callout.graphics.path \"$DOCBOOK_DIR/images/callouts/\" "$@" 146 | 147 | # NOTE use ignore.image.scaling to disable the image scaling logic in fo-pdf.xsl 148 | # -param ignore.image.scaling \"1\" \ 149 | 150 | exit 0 151 | -------------------------------------------------------------------------------- /fopub.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem fopub script for Windows 5 | @rem 6 | @rem WARNING: This script has had limited testing! 7 | @rem 8 | @rem ########################################################################## 9 | 10 | if "%OS%"=="Windows_NT" setlocal 11 | 12 | @rem Store full-qualified drive + path of this script 13 | set PRG_DIR=%~dps0 14 | if "%PRG_DIR%" == "" set PRG_DIR=. 15 | 16 | set GRADLEW_CMD=%PRG_DIR%gradlew 17 | set FOPUB_DIR=%PRG_DIR%\build\fopub 18 | set FOPUB_CMD=%FOPUB_DIR%\bin\fopub.bat 19 | set APP_DIR=%FOPUB_DIR% 20 | set DOCBOOK_DIR=%FOPUB_DIR%\docbook 21 | 22 | @rem Default output type and config dir. These may be overridden by options 23 | set TYPE=pdf 24 | set DOCBOOK_XSL_DIR=%FOPUB_DIR%\docbook-xsl 25 | 26 | @rem Parse command line options 27 | :opt_parse 28 | 29 | @rem Check for -H help 30 | if "%~1" == "-h" GOTO :usage 31 | 32 | @rem Check for -t XSL dir 33 | if NOT "%~1" == "-t" GOTO :opt_output_type 34 | shift 35 | if "%~1" == "" GOTO :usage_error 36 | set DOCBOOK_XSL_DIR=%~f1 37 | shift 38 | goto :opt_parse 39 | 40 | :opt_output_type 41 | @rem Check for -f output format type 42 | if NOT "%~1" == "-f" GOTO :opt_hyphenate 43 | shift 44 | if "%1" == "" GOTO :usage_error 45 | set TYPE=%~1 46 | shift 47 | goto :opt_parse 48 | 49 | :opt_hyphenate 50 | if NOT "%~1" == "-H" GOTO :opt_done 51 | shift 52 | set CONVERT_ARGS="-param hyphenate true" 53 | 54 | :opt_done 55 | @rem Done with parsing options 56 | set XSLTHL_CONFIG_URI=file:///%DOCBOOK_XSL_DIR%\xslthl-config.xml 57 | 58 | @rem Store fully-qualified drive+path+name+extension of source file 59 | set SOURCE_FILE=%~f1 60 | if "%SOURCE_FILE%" == "" goto :usage_error 61 | @rem Store fully-qualified drive+path+name of first argument 62 | set SOURCE_ROOTNAME=%~dpn1 63 | shift 64 | 65 | @rem collect any additional arguments to be passed on to FOP 66 | :collect 67 | if [%1] == [] goto :install 68 | set CONVERT_ARGS=%CONVERT_ARGS% %1 69 | shift 70 | goto :collect 71 | 72 | :install 73 | if exist "%FOPUB_CMD%" goto endInstall 74 | echo . 75 | echo Initializing application... 76 | "%GRADLEW_CMD%" -q -u installDist 77 | if not "%ERRORLEVEL%"=="0" goto fail 78 | echo Application initialized! 79 | echo . 80 | :endInstall 81 | 82 | SETLOCAL ENABLEDELAYEDEXPANSION 83 | 84 | @rem Add file protocol 85 | set DOCBOOK_DIR_PARAM=file:///%DOCBOOK_DIR% 86 | @rem replacing \ with / 87 | set DOCBOOK_DIR_PARAM=!DOCBOOK_DIR_PARAM:\=/! 88 | set XSLTHL_CONFIG_URI=!XSLTHL_CONFIG_URI:\=/! 89 | 90 | if "%TYPE%" == "pdf" ( 91 | set OUTPUT_FILE=%SOURCE_ROOTNAME%.pdf 92 | set OUTPUT_OPT=-pdf 93 | ) 94 | 95 | if "%TYPE%" == "ps" ( 96 | set OUTPUT_FILE=%SOURCE_ROOTNAME%.ps 97 | set OUTPUT_OPT=-ps 98 | ) 99 | 100 | if "%TYPE%" == "fo" ( 101 | set OUTPUT_FILE=%SOURCE_ROOTNAME%.fo 102 | set OUTPUT_OPT=-foout 103 | ) 104 | 105 | if NOT "%OUTPUT_FILE%" == "" ( 106 | %FOPUB_CMD% -q -catalog -c "%DOCBOOK_XSL_DIR%\fop-config.xml" -xml "%SOURCE_FILE%" -xsl "%DOCBOOK_XSL_DIR%\fo-pdf.xsl" !OUTPUT_OPT! "!OUTPUT_FILE!" -param highlight.xslthl.config "%XSLTHL_CONFIG_URI%" -param admon.graphics.path "%DOCBOOK_DIR_PARAM%/images/" -param callout.graphics.path "%DOCBOOK_DIR_PARAM%/images/callouts/" %CONVERT_ARGS% 107 | if not "%ERRORLEVEL%"=="0" goto fail else goto mainEnd 108 | ) 109 | 110 | echo "Unsupported output type '%TYPE%'. Must be pdf, ps or fo." 111 | 112 | :fail 113 | exit /b 1 114 | 115 | :usage_error 116 | echo Syntax error! 117 | :usage 118 | @rem Don't use %FOPUB_CMD% here as that points somewhere else! 119 | echo Usage: fopub [-t PATH] [-f FORMAT] [-H] FILE 120 | echo Example: fopub -t \path\to\custom\docbook-xsl mydoc.xml 121 | exit /b 1 122 | 123 | :mainEnd 124 | if "%OS%"=="Windows_NT" endlocal 125 | 126 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/asciidoctor-fopub/c5e24f7706d866f9fe374be377198a635193daf9/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.10-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /gradlew: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env sh 2 | 3 | ############################################################################## 4 | ## 5 | ## Gradle start up script for UN*X 6 | ## 7 | ############################################################################## 8 | 9 | # Attempt to set APP_HOME 10 | # Resolve links: $0 may be a link 11 | PRG="$0" 12 | # Need this for relative symlinks. 13 | while [ -h "$PRG" ] ; do 14 | ls=`ls -ld "$PRG"` 15 | link=`expr "$ls" : '.*-> \(.*\)$'` 16 | if expr "$link" : '/.*' > /dev/null; then 17 | PRG="$link" 18 | else 19 | PRG=`dirname "$PRG"`"/$link" 20 | fi 21 | done 22 | SAVED="`pwd`" 23 | cd "`dirname \"$PRG\"`/" >/dev/null 24 | APP_HOME="`pwd -P`" 25 | cd "$SAVED" >/dev/null 26 | 27 | APP_NAME="Gradle" 28 | APP_BASE_NAME=`basename "$0"` 29 | 30 | # Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 31 | DEFAULT_JVM_OPTS="" 32 | 33 | # Use the maximum available, or set MAX_FD != -1 to use that value. 34 | MAX_FD="maximum" 35 | 36 | warn () { 37 | echo "$*" 38 | } 39 | 40 | die () { 41 | echo 42 | echo "$*" 43 | echo 44 | exit 1 45 | } 46 | 47 | # OS specific support (must be 'true' or 'false'). 48 | cygwin=false 49 | msys=false 50 | darwin=false 51 | nonstop=false 52 | case "`uname`" in 53 | CYGWIN* ) 54 | cygwin=true 55 | ;; 56 | Darwin* ) 57 | darwin=true 58 | ;; 59 | MINGW* ) 60 | msys=true 61 | ;; 62 | NONSTOP* ) 63 | nonstop=true 64 | ;; 65 | esac 66 | 67 | CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar 68 | 69 | # Determine the Java command to use to start the JVM. 70 | if [ -n "$JAVA_HOME" ] ; then 71 | if [ -x "$JAVA_HOME/jre/sh/java" ] ; then 72 | # IBM's JDK on AIX uses strange locations for the executables 73 | JAVACMD="$JAVA_HOME/jre/sh/java" 74 | else 75 | JAVACMD="$JAVA_HOME/bin/java" 76 | fi 77 | if [ ! -x "$JAVACMD" ] ; then 78 | die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME 79 | 80 | Please set the JAVA_HOME variable in your environment to match the 81 | location of your Java installation." 82 | fi 83 | else 84 | JAVACMD="java" 85 | which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 86 | 87 | Please set the JAVA_HOME variable in your environment to match the 88 | location of your Java installation." 89 | fi 90 | 91 | # Increase the maximum file descriptors if we can. 92 | if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then 93 | MAX_FD_LIMIT=`ulimit -H -n` 94 | if [ $? -eq 0 ] ; then 95 | if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then 96 | MAX_FD="$MAX_FD_LIMIT" 97 | fi 98 | ulimit -n $MAX_FD 99 | if [ $? -ne 0 ] ; then 100 | warn "Could not set maximum file descriptor limit: $MAX_FD" 101 | fi 102 | else 103 | warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT" 104 | fi 105 | fi 106 | 107 | # For Darwin, add options to specify how the application appears in the dock 108 | if $darwin; then 109 | GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\"" 110 | fi 111 | 112 | # For Cygwin, switch paths to Windows format before running java 113 | if $cygwin ; then 114 | APP_HOME=`cygpath --path --mixed "$APP_HOME"` 115 | CLASSPATH=`cygpath --path --mixed "$CLASSPATH"` 116 | JAVACMD=`cygpath --unix "$JAVACMD"` 117 | 118 | # We build the pattern for arguments to be converted via cygpath 119 | ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null` 120 | SEP="" 121 | for dir in $ROOTDIRSRAW ; do 122 | ROOTDIRS="$ROOTDIRS$SEP$dir" 123 | SEP="|" 124 | done 125 | OURCYGPATTERN="(^($ROOTDIRS))" 126 | # Add a user-defined pattern to the cygpath arguments 127 | if [ "$GRADLE_CYGPATTERN" != "" ] ; then 128 | OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)" 129 | fi 130 | # Now convert the arguments - kludge to limit ourselves to /bin/sh 131 | i=0 132 | for arg in "$@" ; do 133 | CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -` 134 | CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option 135 | 136 | if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition 137 | eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"` 138 | else 139 | eval `echo args$i`="\"$arg\"" 140 | fi 141 | i=$((i+1)) 142 | done 143 | case $i in 144 | (0) set -- ;; 145 | (1) set -- "$args0" ;; 146 | (2) set -- "$args0" "$args1" ;; 147 | (3) set -- "$args0" "$args1" "$args2" ;; 148 | (4) set -- "$args0" "$args1" "$args2" "$args3" ;; 149 | (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;; 150 | (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;; 151 | (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;; 152 | (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;; 153 | (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;; 154 | esac 155 | fi 156 | 157 | # Escape application args 158 | save () { 159 | for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done 160 | echo " " 161 | } 162 | APP_ARGS=$(save "$@") 163 | 164 | # Collect all arguments for the java command, following the shell quoting and substitution rules 165 | eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS" 166 | 167 | # by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong 168 | if [ "$(uname)" = "Darwin" ] && [ "$HOME" = "$PWD" ]; then 169 | cd "$(dirname "$0")" 170 | fi 171 | 172 | exec "$JAVACMD" "$@" 173 | -------------------------------------------------------------------------------- /gradlew.bat: -------------------------------------------------------------------------------- 1 | @if "%DEBUG%" == "" @echo off 2 | @rem ########################################################################## 3 | @rem 4 | @rem Gradle startup script for Windows 5 | @rem 6 | @rem ########################################################################## 7 | 8 | @rem Set local scope for the variables with windows NT shell 9 | if "%OS%"=="Windows_NT" setlocal 10 | 11 | set DIRNAME=%~dp0 12 | if "%DIRNAME%" == "" set DIRNAME=. 13 | set APP_BASE_NAME=%~n0 14 | set APP_HOME=%DIRNAME% 15 | 16 | @rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script. 17 | set DEFAULT_JVM_OPTS= 18 | 19 | @rem Find java.exe 20 | if defined JAVA_HOME goto findJavaFromJavaHome 21 | 22 | set JAVA_EXE=java.exe 23 | %JAVA_EXE% -version >NUL 2>&1 24 | if "%ERRORLEVEL%" == "0" goto init 25 | 26 | echo. 27 | echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 28 | echo. 29 | echo Please set the JAVA_HOME variable in your environment to match the 30 | echo location of your Java installation. 31 | 32 | goto fail 33 | 34 | :findJavaFromJavaHome 35 | set JAVA_HOME=%JAVA_HOME:"=% 36 | set JAVA_EXE=%JAVA_HOME%/bin/java.exe 37 | 38 | if exist "%JAVA_EXE%" goto init 39 | 40 | echo. 41 | echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 42 | echo. 43 | echo Please set the JAVA_HOME variable in your environment to match the 44 | echo location of your Java installation. 45 | 46 | goto fail 47 | 48 | :init 49 | @rem Get command-line arguments, handling Windows variants 50 | 51 | if not "%OS%" == "Windows_NT" goto win9xME_args 52 | 53 | :win9xME_args 54 | @rem Slurp the command line arguments. 55 | set CMD_LINE_ARGS= 56 | set _SKIP=2 57 | 58 | :win9xME_args_slurp 59 | if "x%~1" == "x" goto execute 60 | 61 | set CMD_LINE_ARGS=%* 62 | 63 | :execute 64 | @rem Setup the command line 65 | 66 | set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar 67 | 68 | @rem Execute Gradle 69 | "%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS% 70 | 71 | :end 72 | @rem End local scope for the variables with windows NT shell 73 | if "%ERRORLEVEL%"=="0" goto mainEnd 74 | 75 | :fail 76 | rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of 77 | rem the _cmd.exe /c_ return code! 78 | if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1 79 | exit /b 1 80 | 81 | :mainEnd 82 | if "%OS%"=="Windows_NT" endlocal 83 | 84 | :omega 85 | -------------------------------------------------------------------------------- /lib/asciidoctor/fopub.rb: -------------------------------------------------------------------------------- 1 | require "asciidoctor/fopub/version" 2 | 3 | module Asciidoctor 4 | module Fopub 5 | # Your code goes here... 6 | end 7 | end 8 | -------------------------------------------------------------------------------- /lib/asciidoctor/fopub/version.rb: -------------------------------------------------------------------------------- 1 | module Asciidoctor 2 | module Fopub 3 | VERSION = "0.0.1" 4 | end 5 | end 6 | -------------------------------------------------------------------------------- /sample-pdf-screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/asciidoctor/asciidoctor-fopub/c5e24f7706d866f9fe374be377198a635193daf9/sample-pdf-screenshot.png -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | rootProject.name = 'fopub' 2 | -------------------------------------------------------------------------------- /src/dist/catalog.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /src/dist/db5.ent: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | %dbcent; 6 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/callouts.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 8 | 9 | 1 10 | 60 11 | 9pt 12 | 1 13 | 10 14 | .svg 15 | 18 | 21 | 22 | 23 | 24 | 25 | 26 | images/icons/callouts/ 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/common.xsl: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | #222222 7 | #005498 8 | #DDDDDD 9 | normal 10 | #BA3925 11 | 12 | 13 | #7A2518 14 | 15 | normal 16 | #EEEEEE 17 | 18 | 19 | 32 | 33 | 34 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 1 69 | 0 70 | 71 | 72 | 73 | 74 | 1 75 | 0 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 2 90 | 91 | 92 | 2 93 | 94 | 95 | 96 | 97 | 0 98 | .png 99 | 0 100 | images/icons/ 101 | 0 102 | 103 | 0 104 | 105 | 106 | none 107 | #E0E0E0 108 | 109 | 110 | 115 | 116 | 1 117 | images/icons/ 118 | .svg 119 | 122 | 127 | 0 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 | 140 | 141 | 142 | 143 | 144 | 145 | 146 | 0 147 | 148 | 149 | 150 | 151 | article toc,title 152 | book toc,title,figure,table,example,equation 153 | 154 | 155 | article nop 156 | book nop 157 | 158 | 159 | 160 | 161 | 162 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/fo-pdf.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 1 27 | 28 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 49 | 50 | 51 | Arial,sans-serif 52 | 53 | 54 | 55 | Georgia,serif 56 | 57 | 58 | 59 | Liberation Mono,Courier New,Courier,monospace 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | Symbol,ZapfDingbats 68 | 69 | 70 | 71 | Liberation Serif,Times-Roman 72 | 73 | 74 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 111 | 112 | false 113 | 1.5 114 | 117 | justify 118 | 12 119 | 120 | pt 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 0 130 | 0 131 | 0 132 | 1em 133 | 0.8em 134 | 1.2em 135 | 138 | 139 | 140 | 141 | 142 | 143 | 148 | 149 | 150 | 151 | .3em .25em .1em .25em 152 | 0 153 | 154 | 155 | 156 | 157 | 158 | 159 | normal 160 | dotted 161 | dotted 162 | 1pt 163 | #BFBFBF 164 | 0 165 | .2em 166 | .4em 167 | 1em 168 | 1.2em 169 | 1.4em 170 | false 171 | wrap 172 | false 173 | preserve 174 | preserve 175 | start 176 | 177 | 178 | 180 | 183 | 10pt 184 | start 185 | wrap 186 | 189 | 190 | 191 | 192 | 1 193 | 194 | 195 | transparent 196 | 220 | 221 | 245 | 1em .5em .75em .5em 246 | 247 | 248 | 249 | 250 | 253 | 254 | A4 255 | 1 256 | 1 257 | 10mm 258 | 10mm 259 | 20mm 260 | 20mm 261 | 15mm 262 | 15mm 263 | 4mm 264 | 6mm 265 | 0 266 | 0 267 | 10mm 268 | 10mm 269 | 1 5 1 270 | 271 | 274 | 275 | 0 276 | 2 277 | 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 289 | 290 | 291 | 292 | 299 | 300 | 303 | 304 | 305 | 306 | 307 | 308 | 309 | 310 | 311 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 325 | 326 | 327 | 0.8em 328 | 1em 329 | 1.2em 330 | 0.8em 331 | 1em 332 | 1.2em 333 | 334 | auto 335 | 336 | 337 | 338 | figure after 339 | example before 340 | table before 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 36pt 349 | 350 | 351 | 352 | #6F6F6F 353 | 18pt 354 | .75pt 355 | solid 356 | 357 | 0 358 | 359 | 360 | 361 | 12pt 362 | 12pt 363 | 364 | 365 | 366 | 1pt 367 | solid 368 | #E6E6E6 369 | 12pt 370 | 12pt 371 | 0 372 | 12pt 373 | 0 374 | 0 375 | 376 | 377 | 378 | solid 379 | 1pt 380 | #D9D9D9 381 | #F2F2F2 382 | 16pt 383 | 16pt 384 | 18pt 385 | 0 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | pt 394 | 395 | 396 | pt 397 | 398 | 399 | 400 | 403 | 404 | 405 | 4pt 406 | 4pt 407 | 2pt 408 | 2pt 409 | 410 | 411 | 0.3pt 412 | 0.15pt 413 | #5c5c4f 414 | #5c5c4f 415 | white 416 | white 417 | white 418 | white 419 | 420 | 421 | 4pt 422 | 4pt 423 | 2pt 424 | 2pt 425 | 426 | 427 | 430 | 431 | 432 | 435 | 6.3in 436 | 1em 437 | 438 | 439 | 440 | 441 | 442 | 0 443 | 0 444 | 0 445 | 0 446 | 447 | 448 | 449 | 1 450 | 0 451 | 452 | 453 | 454 | 455 | 456 | 0 457 | 1.0 458 | 459 | 460 | 461 | 1.0 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 470 | 471 | 472 | 473 | 474 | 475 | 476 | 477 | 478 | 479 | 480 | 481 | 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 504 | 505 | 506 | 507 | 508 | auto 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | auto 525 | 526 | 527 | 528 | 529 | 530 | auto 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | 543 | 544 | 545 | 546 | auto 547 | 548 | 549 | 550 | 551 | 552 | auto 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | % 565 | 566 | scale-to-fit 567 | scale-down-to-fit 568 | 569 | 570 | 571 | 572 | 573 | auto 574 | 575 | 576 | 577 | 578 | 579 | 580 | 581 | 582 | 583 | 584 | 585 | % 586 | 587 | scale-to-fit 588 | scale-down-to-fit 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 606 | 607 | 608 | 609 | 610 | 611 | 612 | 613 | before 614 | center 615 | after 616 | auto 617 | 618 | 619 | 620 | 621 | 622 | 623 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 640 | 641 | 642 | 643 | 644 | 645 | 646 | always 647 | 0.8em 648 | 1.0em 649 | 1.2em 650 | 0.8em 651 | 1.0em 652 | 1.2em 653 | left 654 | 655 | 656 | 657 | 658 | 659 | 660 | pt 661 | 662 | 663 | 664 | 665 | 666 | pt 667 | 668 | 669 | 670 | 671 | 672 | pt 673 | 674 | 675 | 676 | 677 | 678 | pt 679 | 680 | 681 | 682 | 683 | 684 | pt 685 | 686 | 687 | 688 | 689 | 690 | pt 691 | 692 | 693 | 694 | 695 | always 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 708 | 709 | 710 | 711 | 712 | 713 | 714 | false 715 | 716 | 717 | 718 | 728 | 729 | 730 | center 731 | left 732 | 733 | 734 | 735 | 736 | 737 | 738 | 739 | 740 | 741 | 742 | 743 | 744 | 745 | 746 | 747 | 748 | 749 | 750 | 751 | 752 | 753 | 754 | 755 | 756 | 757 | 758 | 759 | 763 | 764 | 765 | 766 | 767 | 768 |   769 | 770 | 771 | 772 | 775 | 776 | 777 | 778 | 779 | 780 | 781 | 782 | 783 | 784 | 787 | 788 | 0 789 | 1 790 | 791 | 792 | 0.4em 793 | 794 | 795 | 796 | 1.2em 797 | 1em 798 | 1.4em 799 | 1.2em 800 | 1em 801 | 1.4em 802 | 803 | 804 | 805 | 0.5em 806 | 0.2em 807 | 0.8em 808 | 809 | 810 | 811 | bold 812 | 813 | 814 | 815 | 816 | 817 | 818 | 819 | 820 | 821 | 822 | 823 | 824 | 825 | 826 | 827 | 828 | 829 | 830 | 831 | 832 | 833 | 834 | 835 | 836 | 837 | 838 | 839 | 840 | 841 | 842 | 843 | 844 | 845 | 846 | 849 | 850 | #6F6F6F 851 | 854 | 855 | 856 | 857 | 858 | normal 859 | 12pt 860 | center 861 | 862 | 863 | 864 | 865 | white 866 | 24pt 867 | normal 868 | left 869 | 870 | 874 | 875 | 876 | 877 | 878 | 879 | 880 | 881 | 882 | center 883 | 884 | 885 | 886 | 887 | 888 | 889 | black 890 | 891 | 892 | 893 | 894 | 895 | 896 | 897 | 898 | 899 | 900 | 901 | 902 | 903 | 904 | 905 | 906 | 907 | 908 | 909 | 910 | 911 | 912 | 913 | 914 | 915 | 916 | 917 | 918 | 919 | 920 | 921 | 922 | 923 | 924 | 925 | 926 | 927 | 928 | 929 | 930 | 931 | 932 | 933 | 934 | 935 | 936 | 937 | 938 | 939 | 940 | 941 | 942 | 943 | 944 | 945 | 946 | 947 | 948 | 949 | 950 | 951 | 952 | 953 | 954 | 955 | 956 | 957 | 958 | 959 | 960 | 963 | 964 | 1 965 | 966 | 967 | 968 | pt 969 | 970 | 971 | 972 | 973 | 974 | 975 | pt 976 | 977 | 978 | bold 979 | 0 1pt 980 | 981 | 982 | 983 | 984 | 985 | left 986 | 987 | 988 | 989 | 990 | rule 991 | 2in 992 | 0.5pt 993 | 994 | 995 | 996 | 1005 | 1006 | 1007 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/fop-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | true 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/highlight.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xhtml.xsl: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 16 | 17 | 18 | 19 | 20 | 21 | 24 | 25 | 26 |
27 |
28 | 29 | 30 |
31 |
32 | 33 | 34 |
35 |
36 |
37 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl-config.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/asciidoc-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | //// 10 | //// 11 | 12 | 13 | // 14 | 15 | 16 | 17 | ^(={1,6} .+)$ 18 | 19 | MULTILINE 20 | 21 | 22 | ^(\.[^\.\s].+)$ 23 | 24 | MULTILINE 25 | 26 | 27 | ^(:!?\w.*?:) 28 | 29 | MULTILINE 30 | 31 | 32 | ^(-|\*{1,5}|\d*\.{1,5})(?= .+$) 33 | 34 | MULTILINE 35 | 36 | 37 | ^(\[.+\])$ 38 | 39 | MULTILINE 40 | 41 | 42 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/bourne-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | # 29 | 30 | << 31 | ' 32 | " 33 | - 34 | 35 | 36 | 37 | 38 | " 39 | \ 40 | 41 | 42 | ' 43 | \ 44 | 45 | 46 | 47 | 0x 48 | 49 | 50 | 51 | . 52 | 53 | 54 | 55 | 56 | 57 | if 58 | then 59 | else 60 | elif 61 | fi 62 | case 63 | esac 64 | for 65 | while 66 | until 67 | do 68 | done 69 | 70 | exec 71 | shift 72 | exit 73 | times 74 | break 75 | export 76 | trap 77 | continue 78 | readonly 79 | wait 80 | eval 81 | return 82 | 83 | cd 84 | echo 85 | hash 86 | pwd 87 | read 88 | set 89 | test 90 | type 91 | ulimit 92 | umask 93 | unset 94 | 95 | 96 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/c-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 29 | 30 | 31 | /** 32 | */ 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | /* 41 | */ 42 | 43 | // 44 | 45 | 46 | # 47 | \ 48 | 49 | 50 | 51 | 52 | " 53 | \ 54 | 55 | 56 | ' 57 | \ 58 | 59 | 60 | 0x 61 | ul 62 | lu 63 | u 64 | l 65 | 66 | 67 | 68 | . 69 | 70 | e 71 | ul 72 | lu 73 | u 74 | f 75 | l 76 | 77 | 78 | 79 | auto 80 | _Bool 81 | break 82 | case 83 | char 84 | _Complex 85 | const 86 | continue 87 | default 88 | do 89 | double 90 | else 91 | enum 92 | extern 93 | float 94 | for 95 | goto 96 | if 97 | _Imaginary 98 | inline 99 | int 100 | long 101 | register 102 | restrict 103 | return 104 | short 105 | signed 106 | sizeof 107 | static 108 | struct 109 | switch 110 | typedef 111 | union 112 | unsigned 113 | void 114 | volatile 115 | while 116 | 117 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/cpp-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | /** 34 | */ 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /* 43 | */ 44 | 45 | // 46 | 47 | 48 | # 49 | \ 50 | 51 | 52 | 53 | 54 | " 55 | \ 56 | 57 | 58 | ' 59 | \ 60 | 61 | 62 | 0x 63 | ul 64 | lu 65 | u 66 | l 67 | 68 | 69 | 70 | . 71 | 72 | e 73 | ul 74 | lu 75 | u 76 | f 77 | l 78 | 79 | 80 | 81 | 82 | auto 83 | _Bool 84 | break 85 | case 86 | char 87 | _Complex 88 | const 89 | continue 90 | default 91 | do 92 | double 93 | else 94 | enum 95 | extern 96 | float 97 | for 98 | goto 99 | if 100 | _Imaginary 101 | inline 102 | int 103 | long 104 | register 105 | restrict 106 | return 107 | short 108 | signed 109 | sizeof 110 | static 111 | struct 112 | switch 113 | typedef 114 | union 115 | unsigned 116 | void 117 | volatile 118 | while 119 | 120 | asm 121 | dynamic_cast 122 | namespace 123 | reinterpret_cast 124 | try 125 | bool 126 | explicit 127 | new 128 | static_cast 129 | typeid 130 | catch 131 | false 132 | operator 133 | template 134 | typename 135 | class 136 | friend 137 | private 138 | this 139 | using 140 | const_cast 141 | inline 142 | public 143 | throw 144 | virtual 145 | delete 146 | mutable 147 | protected 148 | true 149 | wchar_t 150 | 151 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/csharp-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | /** 34 | */ 35 | 36 | 37 | 38 | /// 39 | 40 | 41 | 42 | /* 43 | */ 44 | 45 | // 46 | 47 | 48 | [ 49 | ] 50 | ( 51 | ) 52 | 53 | 54 | 55 | # 56 | \ 57 | 58 | 59 | 60 | 61 | 62 | @" 63 | " 64 | \ 65 | 66 | 67 | 68 | " 69 | \ 70 | 71 | 72 | ' 73 | \ 74 | 75 | 76 | 0x 77 | ul 78 | lu 79 | u 80 | l 81 | 82 | 83 | 84 | . 85 | 86 | e 87 | ul 88 | lu 89 | u 90 | f 91 | d 92 | m 93 | l 94 | 95 | 96 | 97 | abstract 98 | as 99 | base 100 | bool 101 | break 102 | byte 103 | case 104 | catch 105 | char 106 | checked 107 | class 108 | const 109 | continue 110 | decimal 111 | default 112 | delegate 113 | do 114 | double 115 | else 116 | enum 117 | event 118 | explicit 119 | extern 120 | false 121 | finally 122 | fixed 123 | float 124 | for 125 | foreach 126 | goto 127 | if 128 | implicit 129 | in 130 | int 131 | interface 132 | internal 133 | is 134 | lock 135 | long 136 | namespace 137 | new 138 | null 139 | object 140 | operator 141 | out 142 | override 143 | params 144 | private 145 | protected 146 | public 147 | readonly 148 | ref 149 | return 150 | sbyte 151 | sealed 152 | short 153 | sizeof 154 | stackalloc 155 | static 156 | string 157 | struct 158 | switch 159 | this 160 | throw 161 | true 162 | try 163 | typeof 164 | uint 165 | ulong 166 | unchecked 167 | unsafe 168 | ushort 169 | using 170 | virtual 171 | void 172 | volatile 173 | while 174 | 175 | 176 | 177 | add 178 | alias 179 | from 180 | get 181 | global 182 | group 183 | into 184 | join 185 | orderby 186 | partial 187 | remove 188 | select 189 | set 190 | value 191 | where 192 | yield 193 | 194 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/css-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 32 | 33 | 34 | /* 35 | */ 36 | 37 | 38 | " 39 | \ 40 | 41 | 42 | 43 | ' 44 | \ 45 | 46 | 47 | 48 | . 49 | 50 | 51 | 52 | @charset 53 | @import 54 | @media 55 | @page 56 | 57 | 58 | 59 | - 60 | azimuth 61 | background-attachment 62 | background-color 63 | background-image 64 | background-position 65 | background-repeat 66 | background 67 | border-collapse 68 | border-color 69 | border-spacing 70 | border-style 71 | border-top 72 | border-right 73 | border-bottom 74 | border-left 75 | border-top-color 76 | border-right-color 77 | border-bottom-color 78 | border-left-color 79 | border-top-style 80 | border-right-style 81 | border-bottom-style 82 | border-left-style 83 | border-top-width 84 | border-right-width 85 | border-bottom-width 86 | border-left-width 87 | border-width 88 | border 89 | bottom 90 | caption-side 91 | clear 92 | clip 93 | color 94 | content 95 | counter-increment 96 | counter-reset 97 | cue-after 98 | cue-before 99 | cue 100 | cursor 101 | direction 102 | display 103 | elevation 104 | empty-cells 105 | float 106 | font-family 107 | font-size 108 | font-style 109 | font-variant 110 | font-weight 111 | font 112 | height 113 | left 114 | letter-spacing 115 | line-height 116 | list-style-image 117 | list-style-position 118 | list-style-type 119 | list-style 120 | margin-right 121 | margin-left 122 | margin-top 123 | margin-bottom 124 | margin 125 | max-height 126 | max-width 127 | min-height 128 | min-width 129 | orphans 130 | outline-color 131 | outline-style 132 | outline-width 133 | outline 134 | overflow 135 | padding-top 136 | padding-right 137 | padding-bottom 138 | padding-left 139 | padding 140 | page-break-after 141 | page-break-before 142 | page-break-inside 143 | pause-after 144 | pause-before 145 | pause 146 | pitch-range 147 | pitch 148 | play-during 149 | position 150 | quotes 151 | richness 152 | right 153 | speak-header 154 | speak-numeral 155 | speak-punctuation 156 | speak 157 | speech-rate 158 | stress 159 | table-layout 160 | text-align 161 | text-decoration 162 | text-indent 163 | text-transform 164 | top 165 | unicode-bidi 166 | vertical-align 167 | visibility 168 | voice-family 169 | volume 170 | white-space 171 | widows 172 | width 173 | word-spacing 174 | z-index 175 | 176 | 177 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/html-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | a 17 | abbr 18 | address 19 | area 20 | article 21 | aside 22 | audio 23 | b 24 | base 25 | bdi 26 | blockquote 27 | body 28 | br 29 | button 30 | caption 31 | canvas 32 | cite 33 | code 34 | command 35 | col 36 | colgroup 37 | dd 38 | del 39 | dialog 40 | div 41 | dl 42 | dt 43 | em 44 | embed 45 | fieldset 46 | figcaption 47 | figure 48 | font 49 | form 50 | footer 51 | h1 52 | h2 53 | h3 54 | h4 55 | h5 56 | h6 57 | head 58 | header 59 | hr 60 | html 61 | i 62 | iframe 63 | img 64 | input 65 | ins 66 | kbd 67 | label 68 | legend 69 | li 70 | link 71 | map 72 | mark 73 | menu 74 | menu 75 | meta 76 | nav 77 | noscript 78 | object 79 | ol 80 | optgroup 81 | option 82 | p 83 | param 84 | pre 85 | q 86 | samp 87 | script 88 | section 89 | select 90 | small 91 | source 92 | span 93 | strong 94 | style 95 | sub 96 | summary 97 | sup 98 | table 99 | tbody 100 | td 101 | textarea 102 | tfoot 103 | th 104 | thead 105 | time 106 | title 107 | tr 108 | track 109 | u 110 | ul 111 | var 112 | video 113 | wbr 114 | xmp 115 | 116 | 117 | 118 | 119 | xsl: 120 | 121 | 122 | 123 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/ini-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | ; 33 | 34 | 35 | ^(\[.+\]\s*)$ 36 | 37 | MULTILINE 38 | 39 | 40 | 41 | ^(.+)(?==) 42 | 43 | MULTILINE 44 | 45 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/java-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | /** 34 | */ 35 | 36 | 37 | 38 | /* 39 | */ 40 | 41 | // 42 | 43 | " 44 | \ 45 | 46 | 47 | ' 48 | \ 49 | 50 | 51 | @ 52 | ( 53 | ) 54 | 55 | 56 | 0x 57 | 58 | 59 | 60 | . 61 | e 62 | f 63 | d 64 | l 65 | 66 | 67 | 68 | abstract 69 | boolean 70 | break 71 | byte 72 | case 73 | catch 74 | char 75 | class 76 | const 77 | continue 78 | default 79 | do 80 | double 81 | else 82 | extends 83 | final 84 | finally 85 | float 86 | for 87 | goto 88 | if 89 | implements 90 | import 91 | instanceof 92 | int 93 | interface 94 | long 95 | native 96 | new 97 | package 98 | private 99 | protected 100 | public 101 | return 102 | short 103 | static 104 | strictfp 105 | super 106 | switch 107 | synchronized 108 | this 109 | throw 110 | throws 111 | transient 112 | try 113 | void 114 | volatile 115 | while 116 | 117 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/javascript-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | /* 34 | */ 35 | 36 | // 37 | 38 | " 39 | \ 40 | 41 | 42 | ' 43 | \ 44 | 45 | 46 | 0x 47 | 48 | 49 | 50 | . 51 | e 52 | 53 | 54 | 55 | break 56 | case 57 | catch 58 | continue 59 | default 60 | delete 61 | do 62 | else 63 | finally 64 | for 65 | function 66 | if 67 | in 68 | instanceof 69 | new 70 | return 71 | switch 72 | this 73 | throw 74 | try 75 | typeof 76 | var 77 | void 78 | while 79 | with 80 | 81 | abstract 82 | boolean 83 | byte 84 | char 85 | class 86 | const 87 | debugger 88 | double 89 | enum 90 | export 91 | extends 92 | final 93 | float 94 | goto 95 | implements 96 | import 97 | int 98 | interface 99 | long 100 | native 101 | package 102 | private 103 | protected 104 | public 105 | short 106 | static 107 | super 108 | synchronized 109 | throws 110 | transient 111 | volatile 112 | 113 | 114 | prototype 115 | 116 | Array 117 | Boolean 118 | Date 119 | Error 120 | EvalError 121 | Function 122 | Math 123 | Number 124 | Object 125 | RangeError 126 | ReferenceError 127 | RegExp 128 | String 129 | SyntaxError 130 | TypeError 131 | URIError 132 | 133 | decodeURI 134 | decodeURIComponent 135 | encodeURI 136 | encodeURIComponent 137 | eval 138 | isFinite 139 | isNaN 140 | parseFloat 141 | parseInt 142 | 143 | Infinity 144 | NaN 145 | undefined 146 | 147 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/perl-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | # 33 | 34 | << 35 | ' 36 | " 37 | 38 | 39 | 40 | " 41 | \ 42 | 43 | 44 | ' 45 | \ 46 | 47 | 48 | 49 | 0x 50 | 51 | 52 | 53 | . 54 | 55 | 56 | 57 | 58 | if 59 | unless 60 | while 61 | until 62 | foreach 63 | else 64 | elsif 65 | for 66 | when 67 | default 68 | given 69 | 70 | caller 71 | continue 72 | die 73 | do 74 | dump 75 | eval 76 | exit 77 | goto 78 | last 79 | next 80 | redo 81 | return 82 | sub 83 | wantarray 84 | 85 | caller 86 | import 87 | local 88 | my 89 | package 90 | use 91 | 92 | do 93 | import 94 | no 95 | package 96 | require 97 | use 98 | 99 | bless 100 | dbmclose 101 | dbmopen 102 | package 103 | ref 104 | tie 105 | tied 106 | untie 107 | use 108 | 109 | and 110 | or 111 | not 112 | eq 113 | ne 114 | lt 115 | gt 116 | le 117 | ge 118 | cmp 119 | 120 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/php-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | /** 34 | */ 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /* 43 | */ 44 | 45 | // 46 | # 47 | 48 | " 49 | \ 50 | 51 | 52 | 53 | ' 54 | \ 55 | 56 | 57 | 58 | <<< 59 | 60 | 61 | 0x 62 | 63 | 64 | 65 | . 66 | e 67 | 68 | 69 | 70 | and 71 | or 72 | xor 73 | __FILE__ 74 | exception 75 | __LINE__ 76 | array 77 | as 78 | break 79 | case 80 | class 81 | const 82 | continue 83 | declare 84 | default 85 | die 86 | do 87 | echo 88 | else 89 | elseif 90 | empty 91 | enddeclare 92 | endfor 93 | endforeach 94 | endif 95 | endswitch 96 | endwhile 97 | eval 98 | exit 99 | extends 100 | for 101 | foreach 102 | function 103 | global 104 | if 105 | include 106 | include_once 107 | isset 108 | list 109 | new 110 | print 111 | require 112 | require_once 113 | return 114 | static 115 | switch 116 | unset 117 | use 118 | var 119 | while 120 | __FUNCTION__ 121 | __CLASS__ 122 | __METHOD__ 123 | final 124 | php_user_filter 125 | interface 126 | implements 127 | extends 128 | public 129 | private 130 | protected 131 | abstract 132 | clone 133 | try 134 | catch 135 | throw 136 | cfunction 137 | old_function 138 | true 139 | false 140 | 141 | namespace 142 | __NAMESPACE__ 143 | goto 144 | __DIR__ 145 | 146 | 147 | 148 | 149 | ?> 150 | <?php 151 | <?= 152 | 153 | 154 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/python-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | 34 | @ 35 | ( 36 | ) 37 | 38 | # 39 | 40 | """ 41 | 42 | 43 | 44 | ''' 45 | 46 | 47 | 48 | " 49 | \ 50 | 51 | 52 | ' 53 | \ 54 | 55 | 56 | 0x 57 | l 58 | 59 | 60 | 61 | . 62 | 63 | e 64 | l 65 | 66 | 67 | 68 | and 69 | del 70 | from 71 | not 72 | while 73 | as 74 | elif 75 | global 76 | or 77 | with 78 | assert 79 | else 80 | if 81 | pass 82 | yield 83 | break 84 | except 85 | import 86 | print 87 | class 88 | exec 89 | in 90 | raise 91 | continue 92 | finally 93 | is 94 | return 95 | def 96 | for 97 | lambda 98 | try 99 | 100 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/ruby-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | # 33 | 34 | << 35 | 36 | 37 | 38 | " 39 | \ 40 | 41 | 42 | %Q{ 43 | } 44 | \ 45 | 46 | 47 | %/ 48 | / 49 | \ 50 | 51 | 52 | ' 53 | \ 54 | 55 | 56 | %q{ 57 | } 58 | \ 59 | 60 | 61 | 0x 62 | 63 | 64 | 65 | . 66 | e 67 | 68 | 69 | 70 | alias 71 | and 72 | BEGIN 73 | begin 74 | break 75 | case 76 | class 77 | def 78 | defined 79 | do 80 | else 81 | elsif 82 | END 83 | end 84 | ensure 85 | false 86 | for 87 | if 88 | in 89 | module 90 | next 91 | nil 92 | not 93 | or 94 | redo 95 | rescue 96 | retry 97 | return 98 | self 99 | super 100 | then 101 | true 102 | undef 103 | unless 104 | until 105 | when 106 | while 107 | yield 108 | 109 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/rust-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 31 | 32 | 33 | /** 34 | */ 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | /* 43 | */ 44 | 45 | // 46 | 47 | 48 | # 49 | \ 50 | 51 | 52 | 53 | 54 | " 55 | \ 56 | 57 | 58 | 59 | ' 60 | \ 61 | 62 | 63 | r##" 64 | "## 65 | 66 | 67 | r###" 68 | "### 69 | 70 | 71 | r#" 72 | "# 73 | 74 | 75 | 0x 76 | _ 77 | u8 78 | i8 79 | u16 80 | i16 81 | u32 82 | i32 83 | u64 84 | i64 85 | isize 86 | usize 87 | 88 | 89 | 0o 90 | _ 91 | u8 92 | i8 93 | u16 94 | i16 95 | u32 96 | i32 97 | u64 98 | i64 99 | isize 100 | usize 101 | 102 | 103 | 0b 104 | _ 105 | u8 106 | i8 107 | u16 108 | i16 109 | u32 110 | i32 111 | u64 112 | i64 113 | isize 114 | usize 115 | 116 | 117 | . 118 | _ 119 | u8 120 | i8 121 | u16 122 | i16 123 | u32 124 | i32 125 | u64 126 | i64 127 | isize 128 | usize 129 | E 130 | f32 131 | f64 132 | _f32 133 | _f64 134 | 135 | 136 | 137 | match 138 | if 139 | else 140 | for 141 | loop 142 | while 143 | type 144 | struct 145 | enum 146 | union 147 | as 148 | break 149 | box 150 | continue 151 | extern 152 | fn 153 | in 154 | impl 155 | let 156 | pub 157 | return 158 | super 159 | unsafe 160 | where 161 | mod 162 | trait 163 | move 164 | mut 165 | ref 166 | static 167 | const 168 | crate 169 | isize 170 | usize 171 | char 172 | bool 173 | u8 174 | u16 175 | u32 176 | u64 177 | f32 178 | f64 179 | i8 180 | i32 181 | i64 182 | str 183 | Self 184 | Copy 185 | Send 186 | Sized 187 | Sync 188 | Drop 189 | Fn 190 | FnMut 191 | FnOnce 192 | Box 193 | ToOwned 194 | Clone 195 | PartialEq 196 | PartialOrd 197 | Eq 198 | Ord 199 | AsRef 200 | AsMut 201 | Into 202 | From 203 | Default 204 | Iterator 205 | Extend 206 | IntoIterator 207 | DoubleEndedIterator 208 | ExactSizeIterator 209 | Option 210 | Some 211 | None 212 | Result 213 | Ok 214 | Err 215 | SliceConcatExt 216 | String 217 | ToString 218 | Vec 219 | self 220 | true 221 | false 222 | 223 | 224 | alignof 225 | become 226 | offsetof 227 | priv 228 | pure 229 | sizeof 230 | typeof 231 | unsized 232 | yield 233 | abstract 234 | virtual 235 | final 236 | override 237 | macro 238 | 239 | 240 | -------------------------------------------------------------------------------- /src/dist/docbook-xsl/xslthl/sql2003-hl.xml: -------------------------------------------------------------------------------- 1 | 2 | 27 | 28 | -- 29 | 30 | /* 31 | */ 32 | 33 | 34 | ' 35 | 36 | 37 | 38 | U' 39 | ' 40 | 41 | 42 | 43 | B' 44 | ' 45 | 46 | 47 | 48 | N' 49 | ' 50 | 51 | 52 | 53 | X' 54 | ' 55 | 56 | 57 | 58 | . 59 | 60 | e 61 | 62 | 63 | 64 | 65 | 66 | A 67 | ABS 68 | ABSOLUTE 69 | ACTION 70 | ADA 71 | ADMIN 72 | AFTER 73 | ALWAYS 74 | ASC 75 | ASSERTION 76 | ASSIGNMENT 77 | ATTRIBUTE 78 | ATTRIBUTES 79 | AVG 80 | BEFORE 81 | BERNOULLI 82 | BREADTH 83 | C 84 | CARDINALITY 85 | CASCADE 86 | CATALOG_NAME 87 | CATALOG 88 | CEIL 89 | CEILING 90 | CHAIN 91 | CHAR_LENGTH 92 | CHARACTER_LENGTH 93 | CHARACTER_SET_CATALOG 94 | CHARACTER_SET_NAME 95 | CHARACTER_SET_SCHEMA 96 | CHARACTERISTICS 97 | CHARACTERS 98 | CHECKED 99 | CLASS_ORIGIN 100 | COALESCE 101 | COBOL 102 | CODE_UNITS 103 | COLLATION_CATALOG 104 | COLLATION_NAME 105 | COLLATION_SCHEMA 106 | COLLATION 107 | COLLECT 108 | COLUMN_NAME 109 | COMMAND_FUNCTION_CODE 110 | COMMAND_FUNCTION 111 | COMMITTED 112 | CONDITION_NUMBER 113 | CONDITION 114 | CONNECTION_NAME 115 | CONSTRAINT_CATALOG 116 | CONSTRAINT_NAME 117 | CONSTRAINT_SCHEMA 118 | CONSTRAINTS 119 | CONSTRUCTORS 120 | CONTAINS 121 | CONVERT 122 | CORR 123 | COUNT 124 | COVAR_POP 125 | COVAR_SAMP 126 | CUME_DIST 127 | CURRENT_COLLATION 128 | CURSOR_NAME 129 | DATA 130 | DATETIME_INTERVAL_CODE 131 | DATETIME_INTERVAL_PRECISION 132 | DEFAULTS 133 | DEFERRABLE 134 | DEFERRED 135 | DEFINED 136 | DEFINER 137 | DEGREE 138 | DENSE_RANK 139 | DEPTH 140 | DERIVED 141 | DESC 142 | DESCRIPTOR 143 | DIAGNOSTICS 144 | DISPATCH 145 | DOMAIN 146 | DYNAMIC_FUNCTION_CODE 147 | DYNAMIC_FUNCTION 148 | EQUALS 149 | EVERY 150 | EXCEPTION 151 | EXCLUDE 152 | EXCLUDING 153 | EXP 154 | EXTRACT 155 | FINAL 156 | FIRST 157 | FLOOR 158 | FOLLOWING 159 | FORTRAN 160 | FOUND 161 | FUSION 162 | G 163 | GENERAL 164 | GO 165 | GOTO 166 | GRANTED 167 | HIERARCHY 168 | IMPLEMENTATION 169 | INCLUDING 170 | INCREMENT 171 | INITIALLY 172 | INSTANCE 173 | INSTANTIABLE 174 | INTERSECTION 175 | INVOKER 176 | ISOLATION 177 | K 178 | KEY_MEMBER 179 | KEY_TYPE 180 | KEY 181 | LAST 182 | LENGTH 183 | LEVEL 184 | LN 185 | LOCATOR 186 | LOWER 187 | M 188 | MAP 189 | MATCHED 190 | MAX 191 | MAXVALUE 192 | MESSAGE_LENGTH 193 | MESSAGE_OCTET_LENGTH 194 | MESSAGE_TEXT 195 | MIN 196 | MINVALUE 197 | MOD 198 | MORE 199 | MUMPS 200 | NAME 201 | NAMES 202 | NESTING 203 | NEXT 204 | NORMALIZE 205 | NORMALIZED 206 | NULLABLE 207 | NULLIF 208 | NULLS 209 | NUMBER 210 | OBJECT 211 | OCTET_LENGTH 212 | OCTETS 213 | OPTION 214 | OPTIONS 215 | ORDERING 216 | ORDINALITY 217 | OTHERS 218 | OVERLAY 219 | OVERRIDING 220 | PAD 221 | PARAMETER_MODE 222 | PARAMETER_NAME 223 | PARAMETER_ORDINAL_POSITION 224 | PARAMETER_SPECIFIC_CATALOG 225 | PARAMETER_SPECIFIC_NAME 226 | PARAMETER_SPECIFIC_SCHEMA 227 | PARTIAL 228 | PASCAL 229 | PATH 230 | PERCENT_RANK 231 | PERCENTILE_CONT 232 | PERCENTILE_DISC 233 | PLACING 234 | PLI 235 | POSITION 236 | POWER 237 | PRECEDING 238 | PRESERVE 239 | PRIOR 240 | PRIVILEGES 241 | PUBLIC 242 | RANK 243 | READ 244 | RELATIVE 245 | REPEATABLE 246 | RESTART 247 | RETURNED_CARDINALITY 248 | RETURNED_LENGTH 249 | RETURNED_OCTET_LENGTH 250 | RETURNED_SQLSTATE 251 | ROLE 252 | ROUTINE_CATALOG 253 | ROUTINE_NAME 254 | ROUTINE_SCHEMA 255 | ROUTINE 256 | ROW_COUNT 257 | ROW_NUMBER 258 | SCALE 259 | SCHEMA_NAME 260 | SCHEMA 261 | SCOPE_CATALOG 262 | SCOPE_NAME 263 | SCOPE_SCHEMA 264 | SECTION 265 | SECURITY 266 | SELF 267 | SEQUENCE 268 | SERIALIZABLE 269 | SERVER_NAME 270 | SESSION 271 | SETS 272 | SIMPLE 273 | SIZE 274 | SOURCE 275 | SPACE 276 | SPECIFIC_NAME 277 | SQRT 278 | STATE 279 | STATEMENT 280 | STDDEV_POP 281 | STDDEV_SAMP 282 | STRUCTURE 283 | STYLE 284 | SUBCLASS_ORIGIN 285 | SUBSTRING 286 | SUM 287 | TABLE_NAME 288 | TABLESAMPLE 289 | TEMPORARY 290 | TIES 291 | TOP_LEVEL_COUNT 292 | TRANSACTION_ACTIVE 293 | TRANSACTION 294 | TRANSACTIONS_COMMITTED 295 | TRANSACTIONS_ROLLED_BACK 296 | TRANSFORM 297 | TRANSFORMS 298 | TRANSLATE 299 | TRIGGER_CATALOG 300 | TRIGGER_NAME 301 | TRIGGER_SCHEMA 302 | TRIM 303 | TYPE 304 | UNBOUNDED 305 | UNCOMMITTED 306 | UNDER 307 | UNNAMED 308 | USAGE 309 | USER_DEFINED_TYPE_CATALOG 310 | USER_DEFINED_TYPE_CODE 311 | USER_DEFINED_TYPE_NAME 312 | USER_DEFINED_TYPE_SCHEMA 313 | VIEW 314 | WORK 315 | WRITE 316 | ZONE 317 | 318 | ADD 319 | ALL 320 | ALLOCATE 321 | ALTER 322 | AND 323 | ANY 324 | ARE 325 | ARRAY 326 | AS 327 | ASENSITIVE 328 | ASYMMETRIC 329 | AT 330 | ATOMIC 331 | AUTHORIZATION 332 | BEGIN 333 | BETWEEN 334 | BIGINT 335 | BINARY 336 | BLOB 337 | BOOLEAN 338 | BOTH 339 | BY 340 | CALL 341 | CALLED 342 | CASCADED 343 | CASE 344 | CAST 345 | CHAR 346 | CHARACTER 347 | CHECK 348 | CLOB 349 | CLOSE 350 | COLLATE 351 | COLUMN 352 | COMMIT 353 | CONNECT 354 | CONSTRAINT 355 | CONTINUE 356 | CORRESPONDING 357 | CREATE 358 | CROSS 359 | CUBE 360 | CURRENT_DATE 361 | CURRENT_DEFAULT_TRANSFORM_GROUP 362 | CURRENT_PATH 363 | CURRENT_ROLE 364 | CURRENT_TIME 365 | CURRENT_TIMESTAMP 366 | CURRENT_TRANSFORM_GROUP_FOR_TYPE 367 | CURRENT_USER 368 | CURRENT 369 | CURSOR 370 | CYCLE 371 | DATE 372 | DAY 373 | DEALLOCATE 374 | DEC 375 | DECIMAL 376 | DECLARE 377 | DEFAULT 378 | DELETE 379 | DEREF 380 | DESCRIBE 381 | DETERMINISTIC 382 | DISCONNECT 383 | DISTINCT 384 | DOUBLE 385 | DROP 386 | DYNAMIC 387 | EACH 388 | ELEMENT 389 | ELSE 390 | END 391 | END-EXEC 392 | ESCAPE 393 | EXCEPT 394 | EXEC 395 | EXECUTE 396 | EXISTS 397 | EXTERNAL 398 | FALSE 399 | FETCH 400 | FILTER 401 | FLOAT 402 | FOR 403 | FOREIGN 404 | FREE 405 | FROM 406 | FULL 407 | FUNCTION 408 | GET 409 | GLOBAL 410 | GRANT 411 | GROUP 412 | GROUPING 413 | HAVING 414 | HOLD 415 | HOUR 416 | IDENTITY 417 | IMMEDIATE 418 | IN 419 | INDICATOR 420 | INNER 421 | INOUT 422 | INPUT 423 | INSENSITIVE 424 | INSERT 425 | INT 426 | INTEGER 427 | INTERSECT 428 | INTERVAL 429 | INTO 430 | IS 431 | ISOLATION 432 | JOIN 433 | LANGUAGE 434 | LARGE 435 | LATERAL 436 | LEADING 437 | LEFT 438 | LIKE 439 | LOCAL 440 | LOCALTIME 441 | LOCALTIMESTAMP 442 | MATCH 443 | MEMBER 444 | MERGE 445 | METHOD 446 | MINUTE 447 | MODIFIES 448 | MODULE 449 | MONTH 450 | MULTISET 451 | NATIONAL 452 | NATURAL 453 | NCHAR 454 | NCLOB 455 | NEW 456 | NO 457 | NONE 458 | NOT 459 | NULL 460 | NUMERIC 461 | OF 462 | OLD 463 | ON 464 | ONLY 465 | OPEN 466 | OR 467 | ORDER 468 | OUT 469 | OUTER 470 | OUTPUT 471 | OVER 472 | OVERLAPS 473 | PARAMETER 474 | PARTITION 475 | PRECISION 476 | PREPARE 477 | PRIMARY 478 | PROCEDURE 479 | RANGE 480 | READS 481 | REAL 482 | RECURSIVE 483 | REF 484 | REFERENCES 485 | REFERENCING 486 | REGR_AVGX 487 | REGR_AVGY 488 | REGR_COUNT 489 | REGR_INTERCEPT 490 | REGR_R2 491 | REGR_SLOPE 492 | REGR_SXX 493 | REGR_SXY 494 | REGR_SYY 495 | RELEASE 496 | RESULT 497 | RETURN 498 | RETURNS 499 | REVOKE 500 | RIGHT 501 | ROLLBACK 502 | ROLLUP 503 | ROW 504 | ROWS 505 | SAVEPOINT 506 | SCROLL 507 | SEARCH 508 | SECOND 509 | SELECT 510 | SENSITIVE 511 | SESSION_USER 512 | SET 513 | SIMILAR 514 | SMALLINT 515 | SOME 516 | SPECIFIC 517 | SPECIFICTYPE 518 | SQL 519 | SQLEXCEPTION 520 | SQLSTATE 521 | SQLWARNING 522 | START 523 | STATIC 524 | SUBMULTISET 525 | SYMMETRIC 526 | SYSTEM_USER 527 | SYSTEM 528 | TABLE 529 | THEN 530 | TIME 531 | TIMESTAMP 532 | TIMEZONE_HOUR 533 | TIMEZONE_MINUTE 534 | TO 535 | TRAILING 536 | TRANSLATION 537 | TREAT 538 | TRIGGER 539 | TRUE 540 | UESCAPE 541 | UNION 542 | UNIQUE 543 | UNKNOWN 544 | UNNEST 545 | UPDATE 546 | UPPER 547 | USER 548 | USING 549 | VALUE 550 | VALUES 551 | VAR_POP 552 | VAR_SAMP 553 | VARCHAR 554 | VARYING 555 | WHEN 556 | WHENEVER 557 | WHERE 558 | WIDTH_BUCKET 559 | WINDOW 560 | WITH 561 | WITHIN 562 | WITHOUT 563 | YEAR 564 | 565 | 566 | -------------------------------------------------------------------------------- /src/main/java/org/apache/fop/cli/InputHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Licensed to the Apache Software Foundation (ASF) under one or more 3 | * contributor license agreements. See the NOTICE file distributed with 4 | * this work for additional information regarding copyright ownership. 5 | * The ASF licenses this file to You under the Apache License, Version 2.0 6 | * (the "License"); you may not use this file except in compliance with 7 | * the License. You may obtain a copy of the License at 8 | * 9 | * http://www.apache.org/licenses/LICENSE-2.0 10 | * 11 | * Unless required by applicable law or agreed to in writing, software 12 | * distributed under the License is distributed on an "AS IS" BASIS, 13 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | * See the License for the specific language governing permissions and 15 | * limitations under the License. 16 | */ 17 | 18 | /* $Id$ */ 19 | 20 | package org.apache.fop.cli; 21 | 22 | import java.io.File; 23 | import java.io.FileNotFoundException; 24 | import java.io.InputStream; 25 | import java.io.OutputStream; 26 | import java.net.URI; 27 | import java.util.Vector; 28 | 29 | import javax.xml.parsers.ParserConfigurationException; 30 | import javax.xml.parsers.SAXParserFactory; 31 | import javax.xml.transform.ErrorListener; 32 | import javax.xml.transform.Result; 33 | import javax.xml.transform.Source; 34 | import javax.xml.transform.Transformer; 35 | import javax.xml.transform.TransformerException; 36 | import javax.xml.transform.TransformerFactory; 37 | import javax.xml.transform.URIResolver; 38 | import javax.xml.transform.sax.SAXResult; 39 | import javax.xml.transform.sax.SAXSource; 40 | import javax.xml.transform.stream.StreamResult; 41 | import javax.xml.transform.stream.StreamSource; 42 | 43 | import org.apache.fop.apps.*; 44 | import org.xml.sax.EntityResolver; 45 | import org.xml.sax.InputSource; 46 | import org.xml.sax.SAXException; 47 | import org.xml.sax.XMLReader; 48 | 49 | import org.apache.commons.logging.Log; 50 | import org.apache.commons.logging.LogFactory; 51 | 52 | import org.apache.fop.ResourceEventProducer; 53 | import org.apache.fop.render.awt.viewer.Renderable; 54 | 55 | /** 56 | * Class for handling files input from command line 57 | * either with XML and XSLT files (and optionally xsl 58 | * parameters) or FO File input alone. 59 | */ 60 | public class InputHandler implements ErrorListener, Renderable { 61 | 62 | /** original source file */ 63 | protected File sourcefile; 64 | private File stylesheet; // for XML/XSLT usage 65 | private Vector xsltParams; // for XML/XSLT usage 66 | private EntityResolver entityResolver = null; 67 | private URIResolver uriResolver = null; 68 | 69 | /** the logger */ 70 | protected Log log = LogFactory.getLog(InputHandler.class); 71 | 72 | /** 73 | * Constructor for XML->XSLT->FO input 74 | * 75 | * @param xmlfile XML file 76 | * @param xsltfile XSLT file 77 | * @param params Vector of command-line parameters (name, value, 78 | * name, value, ...) for XSL stylesheet, null if none 79 | */ 80 | public InputHandler(File xmlfile, File xsltfile, Vector params) { 81 | sourcefile = xmlfile; 82 | stylesheet = xsltfile; 83 | xsltParams = params; 84 | } 85 | 86 | /** 87 | * Constructor for FO input 88 | * @param fofile the file to read the FO document. 89 | */ 90 | public InputHandler(File fofile) { 91 | sourcefile = fofile; 92 | } 93 | 94 | /** 95 | * Generate a document, given an initialized Fop object 96 | * @param userAgent the user agent 97 | * @param outputFormat the output format to generate (MIME type, see MimeConstants) 98 | * @param out the output stream to write the generated output to (may be null if not applicable) 99 | * @throws FOPException in case of an error during processing 100 | */ 101 | public void renderTo(FOUserAgent userAgent, String outputFormat, OutputStream out) 102 | throws FOPException { 103 | 104 | String baseURL = null; 105 | 106 | try { 107 | baseURL = new File(sourcefile.getAbsolutePath()) 108 | .getParentFile().toURI().toURL().toExternalForm(); 109 | } catch (Exception e) { 110 | baseURL = ""; 111 | } 112 | 113 | FopFactory factory = new FopFactoryBuilder(URI.create(baseURL)) 114 | .build(); 115 | 116 | Fop fop; 117 | if (out != null) { 118 | fop = factory.newFop(outputFormat, userAgent, out); 119 | } else { 120 | fop = factory.newFop(outputFormat, userAgent); 121 | } 122 | 123 | // Resulting SAX events (the generated FO) must be piped through to FOP 124 | Result res = new SAXResult(fop.getDefaultHandler()); 125 | 126 | transformTo(res); 127 | } 128 | 129 | /** {@inheritDoc} */ 130 | public void renderTo(FOUserAgent userAgent, String outputFormat) throws FOPException { 131 | renderTo(userAgent, outputFormat, null); 132 | } 133 | 134 | /** 135 | * In contrast to render(Fop) this method only performs the XSLT stage and saves the 136 | * intermediate XSL-FO file to the output file. 137 | * @param out OutputStream to write the transformation result to. 138 | * @throws FOPException in case of an error during processing 139 | */ 140 | public void transformTo(OutputStream out) throws FOPException { 141 | Result res = new StreamResult(out); 142 | transformTo(res); 143 | } 144 | 145 | /** 146 | * Creates a Source for the main input file. Processes XInclude if 147 | * available in the XML parser. 148 | * 149 | * @return the Source for the main input file 150 | */ 151 | protected Source createMainSource() { 152 | Source source; 153 | InputStream in; 154 | String uri; 155 | if (this.sourcefile != null) { 156 | try { 157 | in = new java.io.FileInputStream(this.sourcefile); 158 | uri = this.sourcefile.toURI().toASCIIString(); 159 | } catch (FileNotFoundException e) { 160 | //handled elsewhere 161 | return new StreamSource(this.sourcefile); 162 | } 163 | } else { 164 | in = System.in; 165 | uri = null; 166 | } 167 | try { 168 | InputSource is = new InputSource(in); 169 | is.setSystemId(uri); 170 | XMLReader xr = getXMLReader(); 171 | if (entityResolver != null) { 172 | xr.setEntityResolver(entityResolver); 173 | } 174 | source = new SAXSource(xr, is); 175 | } catch (SAXException e) { 176 | if (this.sourcefile != null) { 177 | source = new StreamSource(this.sourcefile); 178 | } else { 179 | source = new StreamSource(in, uri); 180 | } 181 | } catch (ParserConfigurationException e) { 182 | if (this.sourcefile != null) { 183 | source = new StreamSource(this.sourcefile); 184 | } else { 185 | source = new StreamSource(in, uri); 186 | } 187 | } 188 | return source; 189 | } 190 | 191 | /** 192 | * Creates a catalog resolver and uses it for XML parsing and XSLT URI resolution. 193 | * Tries the Apache Commons Resolver, and if unsuccessful, 194 | * tries the same built into Java 6. 195 | * @param userAgent the user agent instance 196 | */ 197 | public void createCatalogResolver(FOUserAgent userAgent) { 198 | String[] classNames = new String[] { 199 | "org.apache.xml.resolver.tools.CatalogResolver", 200 | "com.sun.org.apache.xml.internal.resolver.tools.CatalogResolver"}; 201 | ResourceEventProducer eventProducer 202 | = ResourceEventProducer.Provider.get(userAgent.getEventBroadcaster()); 203 | Class resolverClass = null; 204 | for (int i = 0; i < classNames.length && resolverClass == null; ++i) { 205 | try { 206 | resolverClass = Class.forName(classNames[i]); 207 | } catch (ClassNotFoundException e) { 208 | // No worries 209 | } 210 | } 211 | if (resolverClass == null) { 212 | eventProducer.catalogResolverNotFound(this); 213 | return; 214 | } 215 | try { 216 | entityResolver = (EntityResolver) resolverClass.newInstance(); 217 | uriResolver = (URIResolver) resolverClass.newInstance(); 218 | } catch (InstantiationException e) { 219 | log.error("Error creating the catalog resolver: " + e.getMessage()); 220 | eventProducer.catalogResolverNotCreated(this, e.getMessage()); 221 | } catch (IllegalAccessException e) { 222 | log.error("Error creating the catalog resolver: " + e.getMessage()); 223 | eventProducer.catalogResolverNotCreated(this, e.getMessage()); 224 | } 225 | } 226 | 227 | /** 228 | * Creates a Source for the selected stylesheet. 229 | * 230 | * @return the Source for the selected stylesheet or null if there's no stylesheet 231 | */ 232 | protected Source createXSLTSource() { 233 | Source xslt = null; 234 | if (this.stylesheet != null) { 235 | if (entityResolver != null) { 236 | try { 237 | InputSource is = new InputSource(this.stylesheet.getPath()); 238 | XMLReader xr = getXMLReader(); 239 | xr.setEntityResolver(entityResolver); 240 | xslt = new SAXSource(xr, is); 241 | } catch (SAXException e) { 242 | // return StreamSource 243 | } catch (ParserConfigurationException e) { 244 | // return StreamSource 245 | } 246 | } 247 | if (xslt == null) { 248 | xslt = new StreamSource(this.stylesheet); 249 | } 250 | } 251 | return xslt; 252 | } 253 | 254 | private XMLReader getXMLReader() throws ParserConfigurationException, SAXException { 255 | SAXParserFactory spf = SAXParserFactory.newInstance(); 256 | spf.setFeature("http://xml.org/sax/features/namespaces", true); 257 | spf.setFeature("http://apache.org/xml/features/xinclude", true); 258 | XMLReader xr = spf.newSAXParser().getXMLReader(); 259 | return xr; 260 | } 261 | 262 | /** 263 | * Transforms the input document to the input format expected by FOP using XSLT. 264 | * @param result the Result object where the result of the XSL transformation is sent to 265 | * @throws FOPException in case of an error during processing 266 | */ 267 | protected void transformTo(Result result) throws FOPException { 268 | try { 269 | // Setup XSLT 270 | TransformerFactory factory = TransformerFactory.newInstance(); 271 | if (uriResolver != null) { 272 | factory.setURIResolver(uriResolver); 273 | } 274 | factory.setErrorListener(this); 275 | Transformer transformer; 276 | 277 | Source xsltSource = createXSLTSource(); 278 | if (xsltSource == null) { // FO Input 279 | transformer = factory.newTransformer(); 280 | } else { // XML/XSLT input 281 | transformer = factory.newTransformer(xsltSource); 282 | 283 | // Set the value of parameters, if any, defined for stylesheet 284 | if (xsltParams != null) { 285 | for (int i = 0; i < xsltParams.size(); i += 2) { 286 | transformer.setParameter((String) xsltParams.elementAt(i), 287 | (String) xsltParams.elementAt(i + 1)); 288 | } 289 | } 290 | } 291 | transformer.setErrorListener(this); 292 | 293 | // Create a SAXSource from the input Source file 294 | Source src = createMainSource(); 295 | 296 | // Start XSLT transformation and FOP processing 297 | transformer.transform(src, result); 298 | 299 | } catch (Exception e) { 300 | throw new FOPException(e); 301 | } 302 | } 303 | 304 | // --- Implementation of the ErrorListener interface --- 305 | 306 | /** 307 | * {@inheritDoc} 308 | */ 309 | public void warning(TransformerException exc) { 310 | log.warn(exc.getLocalizedMessage()); 311 | } 312 | 313 | /** 314 | * {@inheritDoc} 315 | */ 316 | public void error(TransformerException exc) { 317 | log.error(exc.toString()); 318 | } 319 | 320 | /** 321 | * {@inheritDoc} 322 | */ 323 | public void fatalError(TransformerException exc) 324 | throws TransformerException { 325 | throw exc; 326 | } 327 | 328 | } 329 | --------------------------------------------------------------------------------