I cannot create a PDF from a Markdown input.
Maybe I am doing something wrong. Maybe there is a bug in DITA-OT. Or the documentation is incomplete.
Background: I am a DITA-OT beginner. I want to evaluate if DITA-OT can be something useful for our project. I want to verify that DITA-OT can export and import Markdown.
Steps to reproduce
Test 1
First create some folders:
mkdir test1
cd ./test1
mkdir in
mkdir out
mkdir temp
mkdir log
Manual Steps:
- Download develop.zip from: https://github.com/dita-ot/docs/archive/develop.zip
- Extract the samples subfolder from develop.zip to /test1/in
You now have a folder /test1/in/samples, containing hierarchy.ditamap. Let's run DITA-OT.
$DITA_HOME/bin/dita --input=in/samples/hierarchy.ditamap --format=pdf --output=out/pdf/ --temp=temp/pdf -Dclean.temp=no
$DITA_HOME/bin/dita --input=in/samples/hierarchy.ditamap --format=markdown_gitbook --output=out/md --temp=temp/md -Dclean.temp=no
Result: The 2 DITA statements work. They produce valid output: PDF and Markdown.
Test 2
Create some folders:
cd ..
mkdir test2
cd test2
mkdir in
mkdir out
mkdir temp
mkdir log
mkdir in/md
Create a folder /test2/in/md that is a copy of /test1/out/md/. In other words: Let's use the output of test1 as an input for test2.
cp -r ../test1/out/md/ in
Create a file test.ditamap in /test2/in. The content of /test2/in/test.ditamap is:
<map>
<topicref href="md/SUMMARY.md" format="markdown"/>
</map>
Note: This file was inspired by https://www.dita-ot.org/dev/topics/markdown-input.html
$DITA_HOME/bin/dita --input=in/test.ditamap --format=pdf --output=out/pdf/ --temp=temp/run1/ -Dclean.temp=no
Result: No PDF is created and the following error is displayed: "Error: Failed to run pipeline: [DOTJ022F][FATAL] Failed to parse the input file '/test2/in/test.ditamap' because all of its content has been filtered out. This will happen if the input file has filter conditions on the root element, and a ditaval excludes all content based on those conditions."
Because of the error I want to see some debug information.
$DITA_HOME/bin/dita --input=in/test.ditamap --format=pdf --output=out/pdf/ --temp=temp/run1/ -Dclean.temp=no --logfile=log/log.txt --debug
This produces only a file named "--debug" in /test2/
$DITA_HOME/bin/dita --input=in/test.ditamap --format=pdf --output=out/pdf/ --temp=temp/run1/ -Dclean.temp=no -l log/log.txt -d
Now a log file /test2/log/log.txt is created but it does not give much help
Test 2, 2nd Version
Create a second file test2.ditamap in /test2/in. As is /test1/in/samples/hierarchy.ditamap add now a DOCTYPE. The content of /test2/in/test2.ditamap looks like:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map>
<topicref href="md/SUMMARY.md" format="markdown"/>
</map>
Now run:
$DITA_HOME/bin/dita --input=in/test2.ditamap --format=pdf --output=out/pdf/ --temp=temp/run2/ -Dclean.temp=no -l log/log2.txt -d
Result: No PDF output but a different error.
In log/log2.txt there seems to be a problem with /test2/in/md/SUMMARY.md or temp\run2\0ea31965dc6fe7a884b6eedc38b4659184ec7094.md
map-reader:
[map-reader] Using Xerces grammar pool for DTD and schema caching.
[map-reader] Processing file:.../test2/in/test2.ditamap to file:.../test2/temp/run2/b3c5ad391073aab6f15d53aaf079cd09d3aa07f4.ditamap
[map-reader] Serializing job specification
[map-reader] MapReaderModule processing took 960 ms
[job-helper] Using class org.apache.tools.ant.taskdefs.optional.TraXLiaison
[job-helper] Processing ...\test2\temp\run2\.job.xml to ...\test2\temp\run2\fullditamap.list
[job-helper] Loading stylesheet C:\DEV\dita-ot-3.0.3\xsl\job-helper.xsl
[delete] Deleting: ...\test2\temp\run2\fullditamap.list
...
topic-reader:
[topic-reader] Using Xerces grammar pool for DTD and schema caching.
[topic-reader] Reading file:.../test2/temp/run2/b3c5ad391073aab6f15d53aaf079cd09d3aa07f4.ditamap
[topic-reader] Loading subject schemes
[topic-reader] Reading file:.../test2/temp/run2/b3c5ad391073aab6f15d53aaf079cd09d3aa07f4.ditamap
[topic-reader] Processing file:.../test2/in/md/SUMMARY.md to file:.../test2/temp/run2/0ea31965dc6fe7a884b6eedc38b4659184ec7094.md
[topic-reader] [DOTJ013E][ERROR] Failed to parse the referenced file 'file:.../test2/in/md/SUMMARY.md'.: com.elovirta.dita.markdown.MarkdownReader
[topic-reader] Serializing job specification
[topic-reader] TopicReaderModule processing took 129 ms
...
[move-meta] I/O error reported by XML parser processing file:.../test2/temp/run2/0ea31965dc6fe7a884b6eedc38b4659184ec7094.md: ...\test2\temp\run2\0ea31965dc6fe7a884b6eedc38b4659184ec7094.md (The system cannot find the file specified)
[move-meta] file:.../test2/in.../test2.ditamap:4:53: [DOTX023W][WARN]: Unable to retrieve navtitle from target: '0ea31965dc6fe7a884b6eedc38b4659184ec7094.md'.
[move-meta] file:.../test2/in.../test2.ditamap:4:53: [DOTX027W][WARN]: Unable to retrieve linktext from target: '0ea31965dc6fe7a884b6eedc38b4659184ec7094.md'.
There is a b3c5ad391073aab6f15d53aaf079cd09d3aa07f4.ditamap but no 0ea31965dc6fe7a884b6eedc38b4659184ec7094.md in my folder /test2/temp/run2/.
Could it be that some copy job has failed?
I have invested a few hours and I am at a loss. I cannot accomplish anything with Markdown input. That's a pity, because DITA-OT looks extremely promising. You really have made a lot of efforts for a complex but mature solution.
Just an idea: How about making a beginner's documentation in the form of some examples, similar to what I do above. Folders: in, out, temp, log, plugin etc. and a file README.md with a short description and the command line statements. If you then put the command line statements into a shell script, you could even re-use it for your test automation.
I cannot create a PDF from a Markdown input.
Maybe I am doing something wrong. Maybe there is a bug in DITA-OT. Or the documentation is incomplete.
Background: I am a DITA-OT beginner. I want to evaluate if DITA-OT can be something useful for our project. I want to verify that DITA-OT can export and import Markdown.
Steps to reproduce
Test 1
First create some folders:
Manual Steps:
You now have a folder /test1/in/samples, containing hierarchy.ditamap. Let's run DITA-OT.
Result: The 2 DITA statements work. They produce valid output: PDF and Markdown.
Test 2
Create some folders:
Create a folder /test2/in/md that is a copy of /test1/out/md/. In other words: Let's use the output of test1 as an input for test2.
Create a file test.ditamap in /test2/in. The content of /test2/in/test.ditamap is:
Note: This file was inspired by https://www.dita-ot.org/dev/topics/markdown-input.html
Result: No PDF is created and the following error is displayed: "Error: Failed to run pipeline: [DOTJ022F][FATAL] Failed to parse the input file '/test2/in/test.ditamap' because all of its content has been filtered out. This will happen if the input file has filter conditions on the root element, and a ditaval excludes all content based on those conditions."
Because of the error I want to see some debug information.
This produces only a file named "--debug" in /test2/
Now a log file /test2/log/log.txt is created but it does not give much help
Test 2, 2nd Version
Create a second file test2.ditamap in /test2/in. As is /test1/in/samples/hierarchy.ditamap add now a DOCTYPE. The content of /test2/in/test2.ditamap looks like:
Now run:
Result: No PDF output but a different error.
In log/log2.txt there seems to be a problem with /test2/in/md/SUMMARY.md or temp\run2\0ea31965dc6fe7a884b6eedc38b4659184ec7094.md
There is a b3c5ad391073aab6f15d53aaf079cd09d3aa07f4.ditamap but no 0ea31965dc6fe7a884b6eedc38b4659184ec7094.md in my folder /test2/temp/run2/.
Could it be that some copy job has failed?
I have invested a few hours and I am at a loss. I cannot accomplish anything with Markdown input. That's a pity, because DITA-OT looks extremely promising. You really have made a lot of efforts for a complex but mature solution.
Just an idea: How about making a beginner's documentation in the form of some examples, similar to what I do above. Folders: in, out, temp, log, plugin etc. and a file README.md with a short description and the command line statements. If you then put the command line statements into a shell script, you could even re-use it for your test automation.