Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DITA-OT 4.2 compatibility #165

Closed
infotexture opened this issue Jan 28, 2024 · 6 comments
Closed

DITA-OT 4.2 compatibility #165

infotexture opened this issue Jan 28, 2024 · 6 comments
Assignees
Labels
Milestone

Comments

@infotexture
Copy link
Owner

When testing #163 & #164 with the current state of the DITA-OT release/4.2 branch (dita-ot/dita-ot@2a2c3f2), the nav ToC sidebar bs-sidebar appears above the page content at desktop breakpoints, rather than in the left column as intended.

The same code in these PRs works fine when built from the DITA-OT master branch (v4.1.2).

Not sure yet if this is a bug in the current state of the DITA-OT release branch, or whether recent changes have rendered the custom XSL code in the DITA Bootstrap plug-in incompatible with the upcoming DITA-OT 4.2 release.

Can't debug further right now, so filing this as a reminder that it's something we'll need to investigate before we package up the new plug-in versions.

@jason-fox
Copy link
Collaborator

This isn't an issue with the dita-bootstrap, its a problem within the hook to the fox.jason.extend.css dependency. You can confirm this by adding a <fail/> to process_css_extend.xml:

<target name="extend.css.copy">
    <fail/>
</target>

If you run this on 4.1.2 then the build fails since extend.css.copy is being called as an extension point of depend.preprocess.copy-html.pre as defined in the plugin.xml.

<feature extension="depend.preprocess.copy-html.pre" value="extend.css"/>

If you run this on the 4.2 branch then the build runs to completion because extend.css.copy is never called.

Unfortunately extend.css.copy is responsible for generating the CSS file that places the ToC on the right (amongst other things). You will notice that the Prism highlighting has also disappeared for the same reason.

@jason-fox
Copy link
Collaborator

My investigation leads to the idea that the preprocess2 ANT is missing the extension hooks:

Compare build_preprocess_template.xml:

<target name="copy-html"
    dita:depends="{depend.preprocess.copy-html.pre}"
    dita:extension="depends org.dita.dost.platform.InsertDependsAction"
    unless="preprocess.copy-html.skip"
    description="Copy html files">
    <condition property="copy-html.todir" value="${_dita.map.output.dir}/${uplevels}" else="${dita.output.dir}">
      <equals arg1="${generate.copy.outer}" arg2="1"/>      
    </condition>
    <copy todir="${copy-html.todir}" failonerror="false" overwrite="true">
      <ditafileset>
        <excludes format="dita"/>
        <excludes format="ditamap"/>
        <excludes format="ditaval"/>
        <excludes format="image"/>
        <excludes format="coderef"/>
      </ditafileset>
      <jobmapper/>
    </copy>
  </target>

And build_preprocess2_template.xml

<target name="copy-html2" 
          unless="preprocess.copy-html.skip" 
          description="Copy html files">
    <copy todir="${dita.output.dir}" failonerror="false" overwrite="true">
      <ditafileset>
        <excludes format="dita"/>
        <excludes format="ditamap"/>
        <excludes format="ditaval"/>
        <excludes format="image"/>
        <excludes format="coderef"/>
      </ditafileset>
      <jobmapper/>
    </copy>
  </target>

@jason-fox
Copy link
Collaborator

jason-fox commented Jan 30, 2024

Adding the lines:

<target name="copy-html2" 
          unless="preprocess.copy-html.skip" 
+        dita:depends="{depend.preprocess.copy-html.pre}"
+        dita:extension="depends org.dita.dost.platform.InsertDependsAction"
          description="Copy html files">

And reinstalling the plugins fixes the issue on the 4.2. branch.

@infotexture
Copy link
Owner Author

That's right: In DITA-OT 4.2, the HTML5 transformation uses map-first preprocessing, which no longer provides access to the legacy pre-processing extensions like depend.preprocess.copy-html.pre.

Could the fox.jason.extend.css plug-in be updated to use the depend.preprocess.pre or depend.preprocess.post extension points for compatibility with map-first preprocessing?

For maximum compatibility with future versions of DITA-OT, most plug-ins should use the extension points that run before or after pre-processing.

We can't change the core toolkit code to make this work.

infotexture added a commit that referenced this issue Feb 5, 2024
Related to #165

---------

Signed-off-by: Roger Sheen <[email protected]>
Co-authored-by: Roger Sheen <[email protected]>
@jason-fox
Copy link
Collaborator

jason-fox commented Feb 5, 2024

You'll need to reinstall plugins now that dita-ot/registry#150 has landed.

@infotexture infotexture added this to the 5.3.4 milestone Feb 7, 2024
@infotexture
Copy link
Owner Author

Tagged the 5.3.4 release and submitted dita-ot/registry#151.

@infotexture infotexture self-assigned this Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants