Skip to content

Commit

Permalink
Merge pull request #241 from AntennaHouse/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
ToshihikoMakita authored Jul 1, 2023
2 parents f3221d6 + fedab53 commit 2ffe4bb
Show file tree
Hide file tree
Showing 19 changed files with 775 additions and 82 deletions.
4 changes: 2 additions & 2 deletions com.antennahouse.pdf5.ml/build_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,8 @@
</condition>

<!-- Make URL for input directory -->
<dirname property="user.input.dir" file="${args.input}"/>
<makeurl property="user.input.dir.url" file="${user.input.dir}"/>
<dirname property="input.file.dir" file="${args.input}"/>
<makeurl property="user.input.dir.url" file="${input.file.dir}"/>

<!-- Make URL for output directory -->
<makeurl property="output.dir.url" file="${dita.map.output.dir}"/>
Expand Down
2 changes: 2 additions & 0 deletions com.antennahouse.pdf5.ml/build_transform_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@
<param name="PRM_OUTPUT_INDEX" expression="${output.index}" if:set="output.index"/>
<param name="PRM_OT_VERSION" expression="${otversion}" if:set="otversion"/>
<param name="PRM_TEMP_DIR_URL" expression="${temp.dir.url}" if:set="temp.dir.url"/>
<param name="PRM_BUILD_MAP" expression="${build.map}" if:set="build.map"/>

<dita:extension id="com.antennahouse.pdf5.ml.param" behavior="org.dita.dost.platform.InsertAction"/>
<sysproperty key="com.innodata.i18n.home" value="${i18n.home}"/>
Expand Down Expand Up @@ -248,6 +249,7 @@
<arg line='"PRM_OUTPUT_INDEX=${output.index}"' if:set="output.index"/>
<arg line='"PRM_OT_VERSION=${otversion}"' if:set="otversion"/>
<arg line='"PRM_TEMP_DIR_URL=${temp.dir.url}"' if:set="temp.dir.url"/>
<arg line='"PRM_BUILD_MAP=${build.map}"' if:set="build.map"/>

<dita:extension id="com.antennahouse.pdf5.ml.saxon.param" behavior="org.dita.dost.platform.InsertAction"/>
<sysproperty key="com.innodata.i18n.home" value="${i18n.home}"/>
Expand Down
38 changes: 38 additions & 0 deletions com.antennahouse.pdf5.ml/config/topic-only-prototype.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<dita-merge xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot"
xmlns:ditaarch="http://dita.oasis-open.org/architecture/2005/">
<?workdir /dummy?>
<?workdir-uri file:/dummy/?>
<?path2project?>
<?path2project-uri ./?>
<?path2rootmap-uri ./?>
<?doctype-public -//OASIS//DTD DITA Map//EN?>
<?doctype-system map.dtd?>
<map cascade="merge"
class="- map/map "
ditaarch:DITAArchVersion="1.3"
domain="(map mapgroup-d) (topic abbrev-d) (topic delay-d) a(props deliveryTarget) (map ditavalref-d) (map glossref-d) (topic hazard-d) (topic hi-d) (topic indexing-d) (topic markup-d) (topic pr-d) (topic relmgmt-d) (topic sw-d) (topic ui-d) (topic ut-d) (topic markup-d xml-d)"
specializations="@props/deliveryTarget"
xtrc="map:1;1:1"
xtrf="file:/dummy.ditamap">
<title class="- topic/title "
xtrc="title:1;1:1"
xtrf="file:/dummy.ditamap">Dummy</title>
<?ditaot gentext?>
<topicref class="- map/topicref "
first_topic_id="#unique_1"
href="#unique_1"
ohref="dummy-topic.dita"
type="topic"
xtrc="topicref:1;1:1"
xtrf="file:/dummy.ditamap">
<!--topicmeta class="- map/topicmeta ">
<navtitle class="- topic/navtitle "><?pdf5.ml insert-navtitle?></navtitle>
<?ditaot gentext?>
<linktext class="- map/linktext "><?pdf5.ml insert-linktext?></linktext>
</topicmeta-->
</topicref>
</map>
<!-- Topic information from here! -->
<!-- Set @id="unique_1", @oid="@id" -->
</dita-merge>
29 changes: 27 additions & 2 deletions com.antennahouse.pdf5.ml/integrator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,36 @@
<target name="dita2pdf5.ml" depends="dita2pdf5.ml.init, build-init, preprocess, map2pdf5.ml, topic2pdf5.ml"/>

<target name="topic2pdf5.ml" if="noMap" depends="preprocess">
<echo message="[pdf5.ml] This plugin does not support topic formatting. Use map or bookmap!"/>
<!-- Generate merged middle file from topic -->
<echo message="[pdf5.ml] Start generating merged middle file from topic."/>
<makeurl file="${dita.temp.dir}${file.separator}${user.input.file}" property="topic.url" validate="yes"/>
<xslt processor="trax"
in="${dita.dir}${file.separator}${pdf5.ml.dir}${file.separator}${pdf5.ml.plugin.folder}${file.separator}config${file.separator}topic-only-prototype.xml"
out="${dita.temp.dir}${file.separator}${dita.topic.filename.root}_MERGED.xml"
style="${dita.dir}${file.separator}${pdf5.ml.dir}${file.separator}${pdf5.ml.plugin.folder}${file.separator}xsl${file.separator}dita2fo_gen_merged_shell.xsl"
force="true">
<factory name="net.sf.saxon.TransformerFactoryImpl">
<attribute name="http://saxon.sf.net/feature/timing" value="true"/>
<!-- Suppress namespace warning -->
<!--attribute name="http://saxon.sf.net/feature/suppressXsltNamespaceCheck" value="true"/-->
<!--Assert-->
<!--attribute name="http://saxon.sf.net/feature/enableAssertions" value="true"/-->
<!-- Trace -->
<!--attribute name="http://saxon.sf.net/feature/traceListenerClass" value="net.sf.saxon.trace.XSLTTraceListener"/-->
</factory>
<param name="PRM_TOPIC_FILE_URL" expression="${topic.url}"/>
</xslt>

<!-- Merged middle file to PDF -->
<ant dir="${dita.dir}${file.separator}${pdf5.ml.dir}${file.separator}${pdf5.ml.plugin.folder}" target="merged2pdf">
<property name="caller.basedir" value="${basedir}"/>
<property name="build.map" value="no"/>
</ant>
</target>

<target name="map2pdf5.ml" unless="noMap" depends="preprocess">
<!-- Call Java TopicMerge -->
<echo message="Start generating merged middle file."/>
<echo message="[pdf5.ml] Start generating merged middle file."/>
<dirname property="dita.temp.dir.fullpath" file="${dita.temp.dir}${file.separator}dummy.file"/>
<pipeline message="topicmerge"
inputmap="${dita.temp.dir.fullpath}${file.separator}${user.input.file}"
Expand All @@ -54,6 +78,7 @@
<!-- Merged middle file to PDF -->
<ant dir="${dita.dir}${file.separator}${pdf5.ml.dir}${file.separator}${pdf5.ml.plugin.folder}" target="merged2pdf">
<property name="caller.basedir" value="${basedir}"/>
<property name="build.map" value="yes"/>
</ant>
</target>
</project>
Loading

0 comments on commit 2ffe4bb

Please sign in to comment.