Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gh-958 Use Asciidoctor's PDF generation #1009

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
158 changes: 7 additions & 151 deletions spring-cloud-dataflow-docs/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -144,19 +144,6 @@
</attributes>
</configuration>
<executions>
<execution>
<id>generate-docbook</id>
<phase>prepare-package</phase>
<goals>
<goal>process-asciidoc</goal>
</goals>
<configuration>
<backend>docbook5</backend>
<attributes>
<docinfo>true</docinfo>
</attributes>
</configuration>
</execution>
<execution>
<id>generate-html5</id>
<phase>prepare-package</phase>
Expand Down Expand Up @@ -191,140 +178,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.15</version>
<configuration>
<sourceDirectory>${basedir}/target/generated-docs</sourceDirectory>
<imgSrcPath />
<graphicsize.extension>0</graphicsize.extension>
<includes>index.xml</includes>
<xincludeSupported>true</xincludeSupported>
<chunkedOutput>false</chunkedOutput>
<foCustomization>${basedir}/src/main/docbook/xsl/pdf.xsl</foCustomization>
<useExtensions>1</useExtensions>
<admonGraphics>1</admonGraphics>

<highlightSource>1</highlightSource>
<highlightXslthlConfig>${basedir}/src/main/docbook/xsl/xslthl-config.xml</highlightXslthlConfig>
<preProcess>
<copy todir="${basedir}/target/generated-docs/images">
<fileset dir="${basedir}/src/main/docbook/images" />
</copy>
</preProcess>
</configuration>
<dependencies>
<dependency>
<groupId>net.sf.xslthl</groupId>
<artifactId>xslthl</artifactId>
<version>2.1.0</version>
</dependency>
<dependency>
<groupId>net.sf.docbook</groupId>
<artifactId>docbook-xml</artifactId>
<version>5.0-all</version>
<classifier>resources</classifier>
<type>zip</type>
<scope>runtime</scope>
</dependency>
</dependencies>
<executions>
<execution>
<id>html-single</id>
<goals>
<goal>generate-html</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<htmlCustomization>${basedir}/src/main/docbook/xsl/html-singlepage.xsl</htmlCustomization>
<targetDirectory>${basedir}/target/docbook/htmlsingle</targetDirectory>
<postProcess>
<copy todir="${basedir}/target/contents/reference/htmlsingle">
<fileset dir="${basedir}/target/docbook/htmlsingle">
<include name="**/*.html" />
</fileset>
</copy>
<copy todir="${basedir}/target/contents/reference/htmlsingle/images">
<fileset dir="${basedir}/target/generated-docs/images" />
</copy>
<copy todir="${basedir}/target/contents/reference/htmlsingle/css">
<fileset dir="${basedir}/src/main/docbook/css" />
</copy>
</postProcess>
</configuration>
</execution>
<execution>
<id>html</id>
<goals>
<goal>generate-html</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<htmlCustomization>${basedir}/src/main/docbook/xsl/html-multipage.xsl</htmlCustomization>
<targetDirectory>${basedir}/target/docbook/html</targetDirectory>
<chunkedOutput>true</chunkedOutput>
<postProcess>
<copy todir="${basedir}/target/contents/reference/html">
<fileset dir="${basedir}/target/docbook/html">
<include name="**/*.html" />
</fileset>
</copy>
<copy todir="${basedir}/target/contents/reference/html/images">
<fileset dir="${basedir}/target/generated-docs/images" />
</copy>
<copy todir="${basedir}/target/contents/reference/html/css">
<fileset dir="${basedir}/src/main/docbook/css" />
</copy>
</postProcess>
</configuration>
</execution>
<execution>
<id>pdf</id>
<goals>
<goal>generate-pdf</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<foCustomization>${basedir}/src/main/docbook/xsl/pdf.xsl</foCustomization>
<targetDirectory>${basedir}/target/docbook/pdf</targetDirectory>
<postProcess>
<copy todir="${basedir}/target/contents/reference">
<fileset dir="${basedir}/target/docbook">
<include name="**/*.pdf" />
</fileset>
</copy>
<move file="${basedir}/target/contents/reference/pdf/index.pdf" tofile="${basedir}/target/contents/reference/pdf/spring-cloud-dataflow-reference.pdf" />
</postProcess>
</configuration>
</execution>
<execution>
<id>epub</id>
<goals>
<goal>generate-epub3</goal>
</goals>
<phase>prepare-package</phase>
<configuration>
<epubCustomization>${basedir}/src/main/docbook/xsl/epub.xsl</epubCustomization>
<targetDirectory>${basedir}/target/docbook/epub</targetDirectory>
<preProcess>
<copy todir="${basedir}/target/docbook/epub/images">
<fileset dir="${basedir}/src/main/docbook/images" />
<fileset dir="${basedir}/src/main/asciidoc/images" />
</copy>
</preProcess>
<postProcess>
<copy todir="${basedir}/target/contents/reference/epub">
<fileset dir="${basedir}/target/docbook">
<include name="**/*.epub" />
</fileset>
</copy>
<move file="${basedir}/target/contents/reference/epub/index.epub" tofile="${basedir}/target/contents/reference/epub/spring-cloud-dataflow-reference.epub" />
</postProcess>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
Expand Down Expand Up @@ -361,13 +214,16 @@
</goals>
<configuration>
<target>
<copy file="${project.build.directory}/generated-docs/index.pdf" tofile="${project.build.directory}/contents/reference/pdf/spring-cloud-dataflow-reference.pdf" />
<copy todir="${project.build.directory}/contents/reference/html">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think now that docbook is dropped, it would be better to forget about that contents directory that misleads everyone. Generated docs should be in generated-docs, period. Then, build the zip from there. WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could even argue that the assembly plugin is a more natural fit...

<fileset dir="${project.build.directory}/generated-docs/">
<include name="**/*.html" />
<include name="images/**" />
</fileset>
</copy>
<zip destfile="${project.build.directory}/${project.artifactId}-${project.version}.zip">
<zipfileset src="${project.build.directory}/${project.artifactId}-${project.version}-javadoc.jar" prefix="api" />
<fileset dir="${project.build.directory}/contents" />
<zipfileset dir="${project.build.directory}/generated-docs" prefix="html5">
<include name="index.html" />
<include name="images/**" />
</zipfileset>
</zip>
</target>
</configuration>
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion spring-cloud-dataflow-docs/src/main/asciidoc/index.adoc
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
= Spring Cloud Data Flow Reference Guide
Sabby Anandan; Marius Bogoevici; Eric Bottard; Mark Fisher; Ilayaperumal Gopinathan; Gunnar Hillert; Mark Pollack; Patrick Peralta; Glenn Renfro; Thomas Risberg; Dave Syer; David Turanski; Janne Valkealahti
v{project-version}
:doctype: book
:toc:
:toclevels: 4
:source-highlighter: prettify
:numbered:
:icons: font
:hide-uri-scheme:
:title-logo-image: image:logo.png[top=10%, align=center, pdfwidth=6cm]

:spring-cloud-dataflow-docs: http://docs.spring.io/spring-cloud-dataflow/docs/{project-version}/reference
:spring-cloud-dataflow-docs-current: http://docs.spring.io/spring-cloud-dataflow/docs/current-SNAPSHOT/reference/html/
Expand All @@ -31,5 +33,4 @@ include::api-guide.adoc[]
include::dataflow-template.adoc[]
include::appendix.adoc[]


// ======================================================================================
5 changes: 2 additions & 3 deletions spring-cloud-dataflow-docs/src/main/asciidoc/preface.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@

[[dataflow-documentation-about]]
== About the documentation
The Spring Cloud Data Flow reference guide is available as {spring-cloud-dataflow-docs}/html[html],
{spring-cloud-dataflow-docs}/pdf/spring-cloud-dataflow-reference.pdf[pdf]
and {spring-cloud-dataflow-docs}/epub/spring-cloud-dataflow-reference.epub[epub] documents. The latest copy
The Spring Cloud Data Flow reference guide is available as {spring-cloud-dataflow-docs}/html[html] and
{spring-cloud-dataflow-docs}/pdf/spring-cloud-dataflow-reference.pdf[pdf] documents. The latest copy
is available at {spring-cloud-dataflow-docs-current}.

Copies of this document may be made for your own use and for
Expand Down