dita-ot / dita-ot

DITA Open Toolkit — the open-source publishing engine for content authored in the Darwin Information Typing Architecture.
https://www.dita-ot.org
Apache License 2.0
403 stars 196 forks source link

Using PDF Themes break plugins in 4.1.2 #4301

Open hcw70 opened 1 year ago

hcw70 commented 1 year ago

Expected Behavior

When running with a PDF theme:

dita -f pdf --theme modules/dita-plugins/dita-ot-4.1.2/src/dita-dl/docsrc/samples/themes/dita-ot-docs-theme.yaml --generate.copy.outer=3 --processing-mode=strict -i doc/generic-gateway.ditamap -o out/ only the styling is adapted. Installed plugins should stay workable.

Actual Behavior

If using --theme, the plantuml rendering does not work any longer (see https://github.com/oxygenxml/dita-ot-diagrams-plugin/issues/14). Plantuml diagrams are no longer present.

Also the prismjs plugin does not work any longer. (https://github.com/jason-fox/fox.jason.prismjs). There is no highlighting in code blocks.

Steps to Reproduce

Render a doc with plantuml and code highligting plugins. Watch output if using theme.

Environment

raducoravu commented 1 year ago

Linking to the other issue which was added on the PlantUML plugin: https://github.com/oxygenxml/dita-ot-diagrams-plugin/issues/14 As I said there I do not think there is anything which can be done in the PlantIUML plugin to avoid this. I just use an extension point to add an xsl:template. Not sure why this no longer works with the PDF templates.

hcw70 commented 1 year ago

@jason-fox Pls note

chrispy-snps commented 1 year ago

@hcw70 - let's focus on a single issue and get it fixed. Can you provide a minimized testcase that reproduces the empty internal-destination error?

chrispy-snps commented 1 year ago

For the following testcase:

REMOVED - moved to #4304

if I run the following command:

dita -i map.ditamap -f pdf2 --theme dita-ot-docs-theme.yaml

I do indeed get the failure:

      [fop] [ERROR] Anttask - Error rendering fo file: /tmp/temp20231019065915677/topic.fo <org.apache.fop.apps.FOPException: net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/tmp/temp20231019065915677/topic.fo:5:154: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 5:154)
      [fop] net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/tmp/temp20231019065915677/topic.fo:5:154: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 5:154)>org.apache.fop.apps.FOPException: net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/tmp/temp20231019065915677/topic.fo:5:154: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 5:154)
      [fop] net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/tmp/temp20231019065915677/topic.fo:5:154: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 5:154)

@hcw70, maybe you can change the title for this issue to be something about unresolved references causing themed PDF publication to fail, then open another issue for plugin templates not being applied? I can try to look at that too.

hcw70 commented 1 year ago

Ok, i wil open a separate issue for the XREF case and keep this for the plugin no longer working....

hcw70 commented 1 year ago

See https://github.com/dita-ot/dita-ot/issues/4304 for xref issue.

hcw70 commented 1 year ago

For the following testcase:

4301.zip

if I run the following command:

dita -i map.ditamap -f pdf2 --theme dita-ot-docs-theme.yaml

I do indeed get the failure:

      [fop] [ERROR] Anttask - Error rendering fo file: /tmp/temp20231019065915677/topic.fo <org.apache.fop.apps.FOPException: net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/tmp/temp20231019065915677/topic.fo:5:154: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 5:154)
      [fop] net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/tmp/temp20231019065915677/topic.fo:5:154: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 5:154)>org.apache.fop.apps.FOPException: net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/tmp/temp20231019065915677/topic.fo:5:154: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 5:154)
      [fop] net.sf.saxon.trans.XPathException: org.apache.fop.fo.ValidationException: file:/tmp/temp20231019065915677/topic.fo:5:154: Missing attribute on fo:basic-link: Either external-destination or internal-destination must be specified. (See position 5:154)

@hcw70, maybe you can change the title for this issue to be something about unresolved references causing themed PDF publication to fail, then open another issue for plugin templates not being applied? I can try to look at that too.

Could you move this to the new issue?