Giter Site home page Giter Site logo

dita4publishers / org.dita4publishers.common.xslt Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 2.0 51 KB

Provides XSLT modules and function libraries appropriate for any Open Toolkit transform. Primarily supports the D4P map-driven processing framework.

License: Apache License 2.0

XSLT 100.00%

org.dita4publishers.common.xslt's Introduction

DITA for Publishers

Version 1.1.0 Under development

Master project for the DITA for Publishers activity. This project includes the toolkit plugins and samples as git submodules. See the wiki for details on how to set up new clones of this project.

NOTE: Issues for specific transformation types (EPUB, HTML5, etc.) are maintained in the project each transformation type. If you're not sure which project an issue applies to, feel free to submit the issue against the dita4publishers project.

News

5 Aug 2021 Release 1.0.0RC28

Many updates. Tested against OT 3.6.1 (see release notes in user guide). Many Word2DITA issues resolved.

24 April 2016: EPUB3 implementation essentially complete with the addition of font embedding and obfuscation.

7 Oct 2014: EPUB3 implementation is under way. See the org.dita4publishers.epub project for details.

Publishing the User Guide

The D4P User Guide is published via GitHub Pages through the separate repo dita4publishers.github.io.

To update the user guide do the following:

  1. Using InDesign, update the cover graphic to reflect the latest release and copyright date (docs/D4P Logo and User Guide Cover/D4P_UserGuide_cover Folder/D4P_UserGuide_cover.indd)
  2. Export new copies of cover-graphic.png (300PPI) and epub-cover-graphic.png (72PPI) to the user_docs/d4p-users-guide/images directory
  3. Run the html5-d4p-user-guide ant target
  4. Copy the generated HTML (d4p-users-guide from the build/docs/html5 directory) to the dita4publishers.github.io repo on branch main.
  5. Commit updates to dita4publishers.github.io repo and push

org.dita4publishers.common.xslt's People

Contributors

blefort avatar blefort-uo avatar contrext avatar drmacro avatar jelovirt avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

org.dita4publishers.common.xslt's Issues

Support OT 3.x renamed graphic files

Use the $job variable to dereference rewritten graphic filenames to their source file location:

<xsl:value-of select="key('jobFile', @href, $job)/@src"/>

outer image and graphic map

The graphic map does seems not support ‘outer’ images. I mean that if an image is in a sibling directory than the ditamap parent directory, the resolved path is wrong.

I found in the generated list that up levels is a property available that seems to provide the ‘real’ parent directory information. The path in the image.list seems show path related to this parent directory.

An example

Map

fr-ca/system/map.ditamap

Images located in

en-ca/system/assets/images/image.jpg

the final path is resolved to

fr-ca/system/fr-ca/system/assets/images/image.jpg

The image.list provides this information, when resolving an image

en-ca/system/assets/images/image.jpg

I found this ant property uplevels, also available in dita.list which seems to provide the missing information, which is in this case:
uplevels = ../../

I am not sure if I can use it.

What do you think about this ?

Generated graphic copy ANT script fails for graphics with spaces in filenames

So you've got this in your DITA:

<image href="../images/testing%20FP%20JPG-1.jpg"/>

This results in the following in the copy-graphics.xml file:

  <copy toFile="/path/to/images/testing FP JPG-1.jpg"
        overwrite="yes">
     <fileset dir="/path/to/output/images">
        <include name="testing%20FP%20JPG-1.jpg"/>
     </fileset>
  </copy>

Which, in turn, gives you (or, at least, me, on OSX)

BUILD FAILED
/path/to/build_transtype-html2.xml:149: The following error occurred while executing this line:
/path/to/build_transtype-html2.xml:155: The following error occurred while executing this line:
/path/to/copy-graphics.xml:132: Cannot perform operation from directory to file.

I think the fix is to change graphicMap2AntCopyScript.xsl to wrap the file name used in the <include> in relpath:toFile(), like so:

<include name="{relpath:toFile(relpath:getName(@input-url), $platform)}"/>

At least, that seems to work for me. I'll submit a pull request shortly.

Node creation in href-fixup changes base-uri, which later causes df:resolveTopicElementRef() to fail

This is related to issue #10 from the dita4publishers issue tracker (dita4publishers/dita4publishers#10). DITA element nodes get re-created in href-fixup mode, which changes their URI. This means that in the default/normal processing mode for HTML transforms (those that use href-fixup) resolution of xrefs cannot succeed with df:resolveTopicElementRef() (a workaround could have been to pass in the topicref as the relevant context element to the function). This will be solved by using the xml:base attribute to preserve the original node URI. This affects the following plugins:
kindle, html5, html2, epub

Enable override of graphic map generation processing

The template <xsl:template match="*[df:class(., 'map/map')]" mode="generate-graphic-map"> in map2graphicMap.xsl uses a for-each loop to process the graphic references collected earlier in the template.

It should apply templates to the graphic references in order to enable customization of the generation of graphic map entries in the final graphic map.

Need to do the same thing for the image list file handling.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.