Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
Down	 the	 Rabbit	 Hole:                             Getting	 Started	 with	 the	                                DITA	 Ope...
Sarah	 O’Keefe                ❖       Founder and president, Scriptorium                        Publishing                ...
Overview                ❖       Installing the DITA Open Toolkit                ❖       Generating output                ❖...
flickr: themaninblueWednesday, February 22, 12
Installing	 the	 OT                ❖       Download from dita-ot.sourceforge.net                      ❖      Use version 1...
Best	 practices                ❖       Set up in top-level directory                ❖       Do not use spaces in file names...
Remember	 the	 command	 line?                              flickr: johnhurnWednesday, February 22, 12
Testing	 your	 installation                      ❖      Open a command window                      ❖      Navigate to your...
$ cd /DITA-OT1.5.4     $ ./startcmd.sh     DITA_HOME environment variable is     empty or not set                         ...
#!/bin/sh    # This file is part of the DITA Open    Toolkit project hosted on  Add this line.                            ...
$ ./startcmd.sh   $ ant -f build_demo.xml   Buildfile: build_demo.xml   prompt.init:   [....]   prompt.output:        [ech...
It	 gets	 better.                             (No,	 it	 doesn’t.)                                                     flick...
Generating	 output   flickr: cdemoWednesday, February 22, 12
Generating	 output  Theory       ant -f build.xml          -Dargs.input=input-ditamap          -Doutput.dir=output-folder ...
Customizing	 output                             flickr: jpockeleWednesday, February 22, 12
flickr: Robobobobo     Best	 practice:	 Create	 a	 pluginWednesday, February 22, 12
Creating	 a	 plugin                ❖       Create a folder for the plugin                ❖       Set up the plugin.xml and...
Creating	 a	 folder	 for	 the	                 plugin                ❖       Plugins go in the OT’s plugins directory.    ...
Set	 up	 plugin.xml                ❖       Copy from org.dita.xhtml folder                ❖       Simplify          <plugi...
Set	 up	 conductor.xml                ❖       Copy from org.dita.xhtml                ❖       No changesWednesday, Februar...
myxsl.xsl	 (in	 xsl	 folder)  <?xml version="1.0" encoding="UTF-8"?>  <xsl:stylesheet    xmlns:xsl="http://www.w3.org/1999...
Integrate	 your	 changes          $ ant -f integrator.xml          Buildfile: integrator.xml          lax:          integr...
Test	 the	 new	 plugin                ❖       Same command as before    $ ant -f build.xml -Dargs.input=/DITA-    OT1.5.4/...
More	 XSL	 customization                ❖       Copy template from dita2xhtml.xsl (or                        referenced fil...
Specifying	      custom	 CSS                             flickr: ffgWednesday, February 22, 12
Specifying	 custom	 CSS                ❖       Set up your own build file                ❖       Fix file paths             ...
Creating	 a	 custom	 build	                 file                ❖       In samples/ant_sample, locate                      ...
Fix	 the	 file	 paths	 in	                 custom	 build	 file       <property name="sample.output.dir"                 valu...
Optionally,	 modify	 other	                 settings                ❖       args.input to specify the ditamap to          ...
Run	 custom	 build	 and	                           admire	 the	 results   flickr: tompeters1994Wednesday, February 22, 12
Run	 custom	 build	 and	                 admire	 the	 results                ❖       Arguments are not needed if you      ...
flickr: jpockele  Beyond	 the	 basicsWednesday, February 22, 12
You	 will	 need…                ❖       XHTML or HTML5                ❖       CSS                ❖       Apache Ant       ...
Take	 care	 of	                               formalities                               flickr: Carly & ArtWednesday, Febru...
Keep	 changes	 in	 plugins	                 folder	 and	 custom	 build	 files                ❖       Do not change core Ope...
Document	 your	 changes!                             amazon.comWednesday, February 22, 12
Q	 &	 A                                  flickr: gracewongWednesday, February 22, 12
Visit	 our	 booth…                ❖       Sarah O’Keefe                ❖       okeefe@scriptorium.com                ❖    ...
Upcoming SlideShare
Loading in …5
×

Down the Rabbit Hole: Getting Started with the DITA Open Toolkit

2,191 views

Published on

Workshop presentation from Intelligent Content 2012 in Pal

Published in: Technology
  • Be the first to like this

Down the Rabbit Hole: Getting Started with the DITA Open Toolkit

  1. 1. Down the Rabbit Hole: Getting Started with the DITA Open Toolkit Sarah O’Keefe Scriptorium PublishingWednesday, February 22, 12
  2. 2. Sarah O’Keefe ❖ Founder and president, Scriptorium Publishing ❖ Content strategy for technical communication ❖ Interested in collision of content, publishing, and technologyWednesday, February 22, 12
  3. 3. Overview ❖ Installing the DITA Open Toolkit ❖ Generating output ❖ Customizing outputWednesday, February 22, 12
  4. 4. flickr: themaninblueWednesday, February 22, 12
  5. 5. Installing the OT ❖ Download from dita-ot.sourceforge.net ❖ Use version 1.5.4 for today ❖ DITA-OT1.5.4_full_easy_install_bin.zip ❖ USB drives contain DITA-OT1.5.4, unzipped for your convenienceWednesday, February 22, 12
  6. 6. Best practices ❖ Set up in top-level directory ❖ Do not use spaces in file names or directory names ❖ Use a stable build and not the development buildsWednesday, February 22, 12
  7. 7. Remember the command line? flickr: johnhurnWednesday, February 22, 12
  8. 8. Testing your installation ❖ Open a command window ❖ Navigate to your DITA OT folder ❖ Run ❖ ./startcmd.sh (UNIX) ❖ startcmd.bat (Windows) ❖ ant -f build_demo.xmlWednesday, February 22, 12
  9. 9. $ cd /DITA-OT1.5.4 $ ./startcmd.sh DITA_HOME environment variable is empty or not set You need to edit the startcmd.sh file.Wednesday, February 22, 12
  10. 10. #!/bin/sh # This file is part of the DITA Open Toolkit project hosted on Add this line. SPACES MATTER! # Sourceforge.net. See the accompanying license.txt file for # applicable licenses. # (c) Copyright IBM Corp. 2006 All Rights Reserved. DITA_HOME="/DITA-OT1.5.4" if [ "${DITA_HOME:+1}" != "1" ]; then echo "DITA_HOME environment variable is empty or not set"; exit 127; fi ...Wednesday, February 22, 12
  11. 11. $ ./startcmd.sh $ ant -f build_demo.xml Buildfile: build_demo.xml prompt.init: [....] prompt.output: [echo] [echo] output in the out directory [echo] [echo] Before rebuilding, please delete the output or the directory. BUILD SUCCESSFUL Total time: 33 seconds $ “Your OT is installed and working.”Wednesday, February 22, 12
  12. 12. It gets better. (No, it doesn’t.) flickr: wademWednesday, February 22, 12
  13. 13. Generating output flickr: cdemoWednesday, February 22, 12
  14. 14. Generating output Theory ant -f build.xml    -Dargs.input=input-ditamap    -Doutput.dir=output-folder    -Dtranstype=transformation-type Example ant -f build.xml -Dargs.input=C:/DITA- OT1.5.4/doc/userguide.ditamap -Doutput.dir=C:/out -Dtranstype=xhtmlWednesday, February 22, 12
  15. 15. Customizing output flickr: jpockeleWednesday, February 22, 12
  16. 16. flickr: Robobobobo Best practice: Create a pluginWednesday, February 22, 12
  17. 17. Creating a plugin ❖ Create a folder for the plugin ❖ Set up the plugin.xml and conductor.xml files ❖ Verify the installation with a tiny customizationWednesday, February 22, 12
  18. 18. Creating a folder for the plugin ❖ Plugins go in the OT’s plugins directory. ❖ Naming convention is: ❖ <your domain>.<your plugin> ❖ com.scriptorium.myhtmlWednesday, February 22, 12
  19. 19. Set up plugin.xml ❖ Copy from org.dita.xhtml folder ❖ Simplify <plugin id="com.scriptorium.myhtml"> <feature extension="dita.xsl.xhtml" file="xsl/myxsl.xsl"/> </plugin>Wednesday, February 22, 12
  20. 20. Set up conductor.xml ❖ Copy from org.dita.xhtml ❖ No changesWednesday, February 22, 12
  21. 21. myxsl.xsl (in xsl folder) <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/ XSL/Transform" version="1.0"> <xsl:template name="gen-user-header"> <div><img src="http://www.scriptorium.com/ images/HeaderImage.png" alt="scriptorium.com"/></div> </xsl:template> </xsl:stylesheet>Wednesday, February 22, 12
  22. 22. Integrate your changes $ ant -f integrator.xml Buildfile: integrator.xml lax: integrate: BUILD SUCCESSFUL Total time: 1 second $Wednesday, February 22, 12
  23. 23. Test the new plugin ❖ Same command as before $ ant -f build.xml -Dargs.input=/DITA- OT1.5.4/doc/userguide.ditamap -Doutput.dir= /out -Dtranstype=xhtmlWednesday, February 22, 12
  24. 24. More XSL customization ❖ Copy template from dita2xhtml.xsl (or referenced files) into myxhtml.xsl ❖ Modify as you likeWednesday, February 22, 12
  25. 25. Specifying custom CSS flickr: ffgWednesday, February 22, 12
  26. 26. Specifying custom CSS ❖ Set up your own build file ❖ Fix file paths ❖ Point build file at the custom CSS you wantWednesday, February 22, 12
  27. 27. Creating a custom build file ❖ In samples/ant_sample, locate sample_xhtml.xml ❖ Put a copy in the root OT folder and rename it: build_myxhtml.xmlWednesday, February 22, 12
  28. 28. Fix the file paths in custom build file <property name="sample.output.dir" value="/out/sample"/> <property name="css.source.dir" location="${dita.dir}/plugins/ com.scriptorium.myhtml/css"/>Wednesday, February 22, 12
  29. 29. Optionally, modify other settings ❖ args.input to specify the ditamap to process ❖ args.css for the CSS file name ❖ args.csspath for the CSS directory pathWednesday, February 22, 12
  30. 30. Run custom build and admire the results flickr: tompeters1994Wednesday, February 22, 12
  31. 31. Run custom build and admire the results ❖ Arguments are not needed if you customized the build file with your exact settings $ ant -f build_myxhtml.xml -Dargs.input=/ Users/okeefe/Documents/CSinTC/csintc.ditamap -Doutput.dir=/out -Dtranstype=xhtmlWednesday, February 22, 12
  32. 32. flickr: jpockele Beyond the basicsWednesday, February 22, 12
  33. 33. You will need… ❖ XHTML or HTML5 ❖ CSS ❖ Apache Ant ❖ XSLT ❖ XML DTDs ❖ XSL-FO (for PDF customization)Wednesday, February 22, 12
  34. 34. Take care of formalities flickr: Carly & ArtWednesday, February 22, 12
  35. 35. Keep changes in plugins folder and custom build files ❖ Do not change core Open Toolkit ❖ Use code comments extensivelyWednesday, February 22, 12
  36. 36. Document your changes! amazon.comWednesday, February 22, 12
  37. 37. Q & A flickr: gracewongWednesday, February 22, 12
  38. 38. Visit our booth… ❖ Sarah O’Keefe ❖ okeefe@scriptorium.com ❖ Twitter: @sarahokeefe ❖ www.scriptorium.com ❖ BTW, we’re hiring. ❖ Also, we have chocolate.Wednesday, February 22, 12

×