jason-fox / fox.jason.passthrough

Abstract base DITA-OT Plug-in to enable files to bypass DITA-OT pre-processing
https://jason-fox.github.io/dita-ot-plugins/passthrough
Apache License 2.0
1 stars 1 forks source link

Cannot create HTML5 or Normalized DITA using test files on Windows #1

Closed lief-erickson closed 4 years ago

lief-erickson commented 5 years ago

Preprocess files on Windows are not recognized as passthrough

With the changes made in bd3a551 I can create a PDF from fox.jason.passthrough.pandoc\test\single-topic\document.ditamap. I have tested various files from the test directory. I have also tested a simple rST file I have. With all of them I can produce a PDF.

But with none of them can I produce HTML or Normalized DITA.

The suspicion is that preprocess may be implicated because preprocess2 is used for PDF.

Quick fix - amend the Normalize DITA plugin to use preprocess2 for now by changing the depends in org.dita.normalize/build.xml line 10.

This suggestion did not work for me.

I'll need the temp job.xml and the intermediate ditamap to look at.

Here you go. Attached is a the temp directory from \single-topic\document.ditamap that may be helpful in debugging the issue.

Also, I notice this directory is sometimes created: test\single-topic\${_dita.map.output.dir}. Yes, that's the actual name of the directory.

Environment:

jason-fox commented 5 years ago

The issue is once again Windows file path processing vs XML paths.

Linux/Mac

Debug log - [read-job.xml]

[read-job.xml] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@77fec3b6 to 
//file[@result='file:/Users/jasonfox/Workspace/dita/dita-ot-3.3.3/plugins/
fox.jason.passthrough.pandoc/test/html-local-file/topic.dita']

.job.xml

<file src="file:/Users/jasonfox/Workspace/dita/dita-ot-3.3.3/plugins/
fox.jason.passthrough.pandoc/test/single-topic/markdown.md" 
 uri="markdown.md" path="markdown.md" 
result="file:/Users/jasonfox/Workspace/dita/dita-ot-3.3.3/plugins/
fox.jason.passthrough.pandoc/test/single-topic/markdown.md'" format="dita" target="true">

Windows

Debug log - [read-job.xml]

[read-job.xml] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@77fec3b6 to 
//file[@result='file:G:\git\dita-ot-3.3.3\plugins\
fox.jason.passthrough.pandoc\test\single-topic\markdown.md']

or even:

[read-job.xml] Applying com.oopsconsultancy.xmltask.AnonymousCallAction@77fec3b6 to 
//file[@result='file:C:\Program%20Files\Oxygen%20XML%20Editor%2021\frameworks\dita\DITA-OT3.x\plugins\
fox.jason.passthrough.pandoc\test\single-topic\markdown.md']

.job.xml

<file src="file:/G:/git/dita-ot-3.3.3/plugins
/fox.jason.passthrough.pandoc/test/single-topic/markdown.md"
 uri="markdown.md" path="markdown.md" 
result="file:/G:/git/dita-ot-3.3.3/plugins/
fox.jason.passthrough.pandoc/test/single-topic/markdown.md"  
format="dita" target="true">

Antlib line 100

<property name="result" value="file:${ditamap.dir}${file.separator}@{href}"/>

Will have to be replaced by a <scriptdef> function

jason-fox commented 5 years ago

@lief-erickson : As I'm fixing Windows blind, could you re-install the necessary plugins on your Windows system and try running again and provide more feedback as necessary. Thanks.

dita --uninstall fox.jason.passthrough
dita --install https://github.com/jason-fox/fox.jason.passthrough/archive/master.zip

Another test could be to place the *.ditamap under C:\Program Files\ or indeed any directory with a space in it.

lief-erickson commented 4 years ago

The potential fix was able to produce valid output using the sample test files from the plugin, but not without some lingering side effects. When trying a more complex rST file I was running into some issues, but I'm not certain that they are the fault of the the passthrough plugin or belong to the preprocessing stage.

I'll gather everything and update this ticket when I have it.

jason-fox commented 4 years ago

@lief-erickson any further progress to report?

lief-erickson commented 4 years ago

Yes. I'll post it later tonight (my time).

lief-erickson commented 4 years ago

I'm going to record a couple of issues that I'm seeing here, but upon reflection not all of them may be with the passthrough or pandoc plugin and instead may be located elsewhere in the processor (although where exactly I'm not certain).

Issues:

This .zip file contains a sample rST file following similar structure as your other test files. Also included are the log file and temp directory as well as the output directory. In the output directory rename the ..rst file to .dita to see the transformed DITA.

This isn't a comprehensive test of what's possible in rST, but it's a start. Also, I'm a neophyte with rST, so there may be rST syntax errors that cause downstream issues. You may use and extend this sample as you wish. rst-sample1.zip

jason-fox commented 4 years ago

None of the remaining issues touch the passthrough plug-in processing, they are all pandoc or dita transform related. I'll close this Windows processing issue, and raise three separate new issues in the pandoc plug-in.