Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
jelovirt committed Sep 2, 2020
2 parents ddbdcff + 25e10fe commit e2493ba
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 16 deletions.
31 changes: 16 additions & 15 deletions build_dita2troff.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Copyright 2006 IBM Corporation
See the accompanying LICENSE file for applicable license.
-->
<project name="dita2troff">
<project name="dita2troff" xmlns:if="ant:if">

<target name="dita2troff-ast.init">
<property name="troff-ast.xsl" location="${dita.plugin.org.dita.troff.dir}/xsl/dita2troff-ast-shell.xsl"/>
Expand All @@ -22,16 +22,16 @@ See the accompanying LICENSE file for applicable license.

<target name="dita.topic.troff-ast" unless="noTopic" depends="dita2troff-ast.init"
description="Build Troff-specific AST output from dita topics.">
<pipeline>
<xslt basedir="${dita.temp.dir}"
destdir="${dita.temp.dir}" includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}"
extension=".dita"
classpathref="dost.class.path"
destdir="${dita.temp.dir}"
style="${troff-ast.xsl}">
<excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
<param name="defaultLanguage" expression="${default.language}"/>
<ditafileset format="dita" processingRole="normal"/>
<param name="defaultLanguage" expression="${default.language}"/>
<mapper type="glob" from="*" to="*.ast" />
<xmlcatalog refid="dita.catalog"/>
</xslt>
</pipeline>
<move todir="${dita.temp.dir}">
<fileset dir="${dita.temp.dir}" includes="**/*.ast" />
<mapper type="glob" from="*.ast" to="*" />
Expand All @@ -40,32 +40,33 @@ See the accompanying LICENSE file for applicable license.

<target name="dita.topic.troff" unless="noTopic" if="old.transform"
description="Build troff output from dita inner and outer topics,which will adjust the directory.">
<xslt basedir="${dita.temp.dir}" destdir="${dita.output.dir}"
includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}" extension="${out.ext}"
<pipeline>
<xslt basedir="${dita.temp.dir}" destdir="${dita.output.dir}" extension="${out.ext}"
classpathref="dost.class.path"
style="${troff.step2.xsl}">
<excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
<param name="OUTFORMAT" expression="${troff.outformat}" if="troff.outformat"/>
<ditafileset format="dita" processingRole="normal"/>
<param name="OUTFORMAT" expression="${troff.outformat}" if:set="troff.outformat"/>
<param name="defaultLanguage" expression="${default.language}"/>
<mapper classname="org.dita.dost.ant.types.JobMapper" to="${out.ext}"/>
<xmlcatalog refid="dita.catalog"/>
</xslt>
</pipeline>
</target>

<!--The new solution which divides the whole process into the inner and outer steps -->
<target name="dita.inner.topic.troff" unless="noTopic" if="inner.transform"
description="Build troff output from inner dita topics">
<echo level="info">the ditmapoutputdir is ${dita.map.output.dir}</echo>
<!-- step 2 -->
<xslt basedir="${dita.temp.dir}" destdir="${dita.output.dir}"
includesfile="${dita.temp.dir}${file.separator}${fullditatopicfile}" extension="${out.ext}"
classpathref="dost.class.path"
<pipeline>
<xslt basedir="${dita.temp.dir}" destdir="${dita.output.dir}" extension="${out.ext}"
style="${troff.step2.xsl}">
<excludesfile name="${dita.temp.dir}${file.separator}${resourceonlyfile}" if="resourceonlyfile"/>
<param name="OUTFORMAT" expression="${troff.outformat}" if="troff.outformat"/>
<ditafileset format="dita" processingRole="normal"/>
<param name="OUTFORMAT" expression="${troff.outformat}" if:set="troff.outformat"/>
<mapper classname="org.dita.dost.ant.types.JobMapper" to="${out.ext}"/>
<xmlcatalog refid="dita.catalog"/>
</xslt>
</pipeline>
</target>

</project>
2 changes: 2 additions & 0 deletions xsl/step1-xml-d.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,9 @@ See the accompanying LICENSE file for applicable license.

<xsl:template match="*[contains(@class,' xml-d/xmlpi ')]">
<text style="tt"><xsl:call-template name="commonatts"/>
<xsl:text>&lt;?</xsl:text>
<xsl:apply-templates/>
<xsl:text>?&gt;</xsl:text>
</text>
</xsl:template>

Expand Down
2 changes: 1 addition & 1 deletion xsl/step1.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ See the accompanying LICENSE file for applicable license.

<!-- These titles should come out as bold -->
<xsl:template match="*[contains(@class,' topic/fig ')]/*[contains(@class,' topic/title ')]">
<xsl:variable name="fignum" select="count(preceding::*[contains(@class,' topic/fig ')]) + 1" as="xs:integer"/>
<xsl:variable name="fignum" select="count(preceding::*[contains(@class,' topic/fig ')][*[contains(@class,' topic/title ')]]) + 1" as="xs:integer"/>
<block><xsl:call-template name="commonatts"/>
<text style="bold">
<xsl:call-template name="getVariable"><xsl:with-param name="id" select="'Figure'"/></xsl:call-template>
Expand Down

0 comments on commit e2493ba

Please # to comment.