Git Product home page Git Product logo

extendscriptapidoctransformations's Introduction

Transformations for the Adobe ExtendScript API Documentation

This project contains the XSLT transformation files for creating a readable documentation of the Adobe ExtendScript APIs. The transformation is optimised for the InDesign DOM, but should work for other Adobe Extendscript DOMs as well. The files are transformed to DITA XML data model. I found the intermediate format particularly helpful for validating all references. It could also used to add more help information via DITA Topics by your own. You can set up your own DITA-OT Transformation to publish an output format of your like. I rendered a WebHelp Documentation with oXygen DITA-OT Webhelp.

If you want to use the documentation you can find the most recent CC (Version 10) API on my site www.indesignjs.de. For InDesign CS6 goto.

There is also an alternative node.js approach on github and a HTML compilation from jongware.

Before you start

  • Java and XSLT 2.0 Processor. For example Saxon XSLT Processor
  • Put the Adobe InDesign and ExtendScript Toolkit source files in Folder sourceXML

XML file locations

The XML source files can be found in the following locations on Mac OS X.

  • /Library/Application Support/Adobe/Scripting Dictionaries CC/CommonFiles
  • ~/Library/Preferences/ExtendScript Toolkit/4.0/omv$indesign-9.064$9.0.xml

On Windows the Files are located at:

  • \Users\[Username]\AppData\Roaming\Adobe\ExtendScript Toolkit\4.0\omv$indesign-10.064$10.0.xml
  • C:\Program Files (x86)\Common Files\Adobe\Scripting Dictionaries CC\CommonFiles\

The copyright of the original Files is by Adobe Systems Incorporated.

XSLT Transformations

The idea is, to create a merged and fixed DOM/API XML file. From this file several formats can be achieved. In this repository the XSLT for DITA (as used in the webhelp anbd Sublime Text Code Completions are included.

Create a merged and fixed DOM-File

  1. Merge the Source files and get rid of namespace bugs with mergeFiles.xslt. This transformation works with a named template (Saxon Option is '-it mergeDOMFiles'). You can change the path params in the file (Line 13 for the Product XML), or call the transformation with the path to indesign.xml, javascript.xml scriptui.xml.
  2. Fix DOM Structure for further processing with fixDom.xsl. All ScriptUI classes are postfixed with (SUI). Please note: There are some ugly hacks, basically replace() to get it working, probably some unrecognized bugs wil be produced. This file could also serve as a nice datasource for Sublimetext Code Completion Files.

Create DITA Topics

  1. Transform DOM Structure to DITA Topics and create a DITA Map with dom2dita.xsl You'll find the results in folder domOut
  2. Please note: For a readable output format you've to set up an DITA-OT Transformation.

Create Sublime Text Code Completions

  1. Transform DOM Structure to DITA Topics to Sublime Text Code Completions with dom2sublimeCodeCompletion.xsl. Use the result from fixDom.xsl. Create a jsx.sublime-completions file and put this into your Sublime Text Packages folder On Windows: \Users\[Username]\AppData\Roaming\Sublime Text 3\Packages On MacOS: ``/Library/Application Support/Sublime Text 3/Packages`

Other than InDesign

The transformation was adapted for Photoshop. The dom2dita.xsl has still a lot of "InDesign" Strings and the mini hierarchy won't work.

License

Creative Commons License
extendscriptApiDocTransformations by Gregor Fellenz is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
Based on a work at http://www.adobe.com/.

Acknowledgements

This project ist based on the fantastic ExtendScript API HTML from Theunis de Jong aka Jongware. Without his efforts and inspiration I would not have realized it. Thank you!

extendscriptapidoctransformations's People

Contributors

grefel avatar trych avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

extendscriptapidoctransformations's Issues

Error building dita

Hello Gregor,
I'm trying to borrow your project to build Photoshop output. Alas my knowledge of the tools you use are below zero (never heard before about Saxon, dita, etc), so I'm just guessing wildly.

So far I've been able to (I'm writing here also as a reminder for my future self, and everyone Photoshop-oriented):

  • get photoshop.xml, javascript.xml, scriptui.xml.
  • substitute all the instances of indesign with photoshop in the mergeFiles.xslt.
  • run java -jar saxon9he.jar -xsl:mergeFiles.xslt -it:mergeDOMFiles -o:photoshop-merged.xml
  • run java -jar saxon9he.jar -s:photoshop-merged.xml -xsl:fixDom.xsl -o:photoshop-merged-fixed.xml
  • run java -jar saxon9he.jar -s:photoshop-merged-fixed.xml -xsl:dom2dita.xsl -o:domOut/*

256 .dita files are generated in /domOut, but I get the following error:

java -jar saxon9he.jar -s:photoshop-merged-fixed.xml -xsl:dom2dita.xsl -o:domOut/*
Type error at char 17 in xsl:variable/@select on line 781 column 79 of dom2dita.xsl:
XPTY0004: A sequence of more than one item is not allowed as the first argument of
generate-id() (, )
at xsl:apply-templates (file:/Users/davidebarranca/Downloads/extendscriptApiDocTransformations-master/dom2dita.xsl#18)
processing /domRoot/indd[1]/dictionary[1]/package[1]/classdef[200]
A sequence of more than one item is not allowed as the first argument of generate-id() (, )

Referring to \<classdef/> and peeking in the photoshop-merged-fixed.xml I assume something went wrong in the extendscript/scriptui side (not photoshop) but I cannot be sure. I can't say whether all the files have been generated or there's something missing either.

If you want to test yourself, you can download my photoshop-merged-fixed.xml.

Besides, any extra guidance that you can offer from the .dita onwards (generating html output, and especially Sublime Text Code Completions) is greatly appreciated.

Thank you very much in advance,

Davide Barranca

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.