How to pass single topics in a map? #4485
-
Hi there! This is a follow-up of https://github.com/orgs/dita-ot/discussions/4484. I feel like I'm so close to the solution, but docs and existing plugins aren't entirely clear on this. Context: I want to pass each DITA topic in a map to the Vale linter using an statement in the Ant script. For that, I need a variable that allows me to iterate through each file in the ditamap I'm providing. Command: dita --input=sample.ditamap --format=html5 Plugin.xml: <?xml version="1.0" encoding="UTF-8"?>
<?xml-model href="dita-ot/plugin.rnc" type="application/relax-ng-compact-syntax"?>
<plugin id="org.splunk.vale.check" version="1.0">
<feature extension="package.support.name" value="Fabrizio Ferri Benedetti"/>
<feature extension="package.support.email" value="fferribenedetti@splunk.com"/>
<feature extension="package.version" value="1.0"/>
<feature extension="ant.import" file="vale.xml"/>
<feature extension="depend.preprocess.post" value="vale-check"/>
</plugin> vale.xml: <?xml version='1.0' encoding='UTF-8'?>
<project name="vale-check" default="vale-check" basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant">
<target name="vale-check">
<ditafileset format="dita"/>
<echo>Checking: </echo>
<echo>${dita.input.filename}</echo>
<exec executable="vale" failonerror="true" spawn="false" logError="true" outputproperty="cmdOutput" errorproperty="cmdError" dir="${dita.temp.dir}">
<arg value="${dita.input.filename}" />
</exec>
<!-- Print the standard output to the console -->
<echo>Standard Output:</echo>
<echo>${cmdOutput}</echo>
<!-- Print the error output to the console, if any -->
<echo>Standard Error:</echo>
<echo>${cmdError}</echo>
</target>
</project> The current out I'm getting shows that the script is processing the ditamap itself, not each topic: Checking:
sample.ditamap
Standard Output:
sample.ditamap
1:109 warning Use American-style formatting Splunk.Decimals
for commas and decimal points
in numbers.
1:200 warning Use American-style formatting Splunk.Decimals
for commas and decimal points
in numbers.
✖ 0 errors, 2 warnings and 0 suggestions in 1 file.
Standard Error: |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
On what files do you want to apply the vale executable:
? |
Beta Was this translation helpful? Give feedback.
The DITA OT is a publishing engine which processes DITA XML content, it transforms the DITA XML content to various outputs, this is its main purpose, so its main purpose is not to apply an external process on each of the original DITA files. This processing is usually done with Java pre-processing steps and XSLT steps which can use the "ditafileset format="dita"". Again, you do not need that, the ditafileset format="dita" returns the pre-processed DITA XML files from the temporary files folder with all content references expanded, keys resolved, which again is not something you want.
Maybe the closest plugin I created similar to what you want is this one:
https://github.com/oxygenxml/dita…