To boldly go where no tech writer has gone before (one can dream, right?)

The World’s Smallest DITA Project Part 1: Installing the tools

(This post is part of the Learn DITA on Your Own series.)

Before you can start having fun with DITA, you need to install the following tools:

  • A DITA editor
  • The DITA Open Toolkit

You use a DITA editor to write your topics, create your maps, and add your topics to maps. To generate your DITA content into the output format of your choice (PDF, .chm, HTML, etc.), you use the DITA Open Toolkit publishing engine, as shown in the following diagram:

DITA editor


An ideal DITA editor has the following features:

  • It includes a visual interface that lets you enter content without having to worry about tags. While it’s very useful to understand the DITA tags and be able to work with them, you don’t want to worry about the mechanics when you are writing your content.
  • It also includes a text interface that lets you work in the DITA code. This is very useful when you perform more complex operations such as applying conditions, adding cross-references, setting variables, etc. I work in the visual interface about 80% of the time and in the text interface 20% of the time.
  • It checks the syntax of your DITA code. Even when you’re working in a visual interface that does most of the job for you, you may still make mistakes. A good DITA editor will check your syntax as you type and will let you know when you make mistakes.

I’ve spent a few hours searching for a free XML editor that provides these features, but none seems available (and if I’m wrong, please, please let me know!). Many products provide a 30-day free trial, such as oXygen (which I use and love), and I’ll discuss this option when planning your DITA training.

For the World’s Smallest DITA Project, we will use Notepad++. It’s free, easy to use, and will work fine for what we want to do. Yes, when using Notepad++ you will be working with the tags, but as Sarah O’Keefe from Scriptorium said: “If you don’t understand the underlying DITA structure, you’re just going to continue to create badly structured information that is technically valid.”

Downloading and installing Notepad++

Notepad++ is a very common editor, and you may already have it installed on your computer.

If you don’t, follow these instructions:

  1. Go to the following URL:
    http://notepad-plus-plus.org/download/v6.5.2.html.
  2. Click the DOWNLOAD button.
  3. When the file is downloaded, run the installer.
  4. Follow the instructions, using the default selections.
    Note: If you get errors indicating that a file is moved to the “disable” directory, simply ignore them and click OK.
  5. When the installation is completed, click Finish.

DITA Open Toolkit


The DITA Open Toolkit (also called the DITA-OT) is an open source publishing tool that converts DITA content into various output formats such as PDF, XHTML, Eclipse Help, HTML Help, etc. To generate the output of a DITA map or topic, you run a command-line DITA-OT script that takes the map or topic as input and generates the content.

To download and install the DITA Open Toolkit:

  1. Go to the DITA Open Toolkit download website:
    http://dita-ot.github.io/download.html
  2. Click the button for your operating system.
    The file is downloaded to your system. The Open Toolkit is packaged as a .zip (Windows) or .tar.gz (Unix, Mac) file.
  3. Extract the file to the C:\ directory (Windows).
    The DITA OT is now installed in the C:\DITA-OT1.8.M2 directory.

The next step is to run the demo project provided with the DITA-OT to test your installation. To build the demo project, you run a script that asks for the DITA map that you want to build, the directory where you will store the output, and the type of output you want to create. For this test, we’ll accept the default answers to all questions.

  1. In the  C:\DITA-OT1.8.M2 directory, double-click startcmd.bat (Windows) or run startcmd.sh (Linux, Mac).
  2. At the prompt, enter the following command to build the demo project:
    ant -f build_demo.xml

    The following message is displayed:

    [echo] Please enter the filename for the DITA map that you
    [echo] want to build including the directory path (if any).
    [echo] The filename must have the .ditamap extension.
    [echo] Note that relative paths that climb (..) are not supported yet.
    [echo] To build the sample, press return without entering anything.
    [input] The DITA map filename: [C:\DITA-OT1.6.M5\samples\hierarchy.ditamap]

    Note: If you get the following error message instead:

    "java.exe"' is not recognized as an internal or external command...

    You need to update your system PATH variable with the location of your Java bin directory (for example, C:\Program Files\Java\jre7\) before you can try again. See these Java instructions for more information.

  3. Press Enter to use the default DITA map filename.
    The following message is displayed:

     [echo]
     [echo] Please enter the name of the output directory or press return
     [echo] to accept the default.
     [input] The output directory (out): [out]
  4. Press Enter to use the default output directory.
    The following message is displayed:

     [echo] Please enter the type of output to generate.
     [echo] Options include: eclipse, tocjs, htmlhelp, javahelp, pdf, or web
     [echo] Use lowercase letters.
     [echo]
     [input] The output type: (eclipse, tocjs, htmlhelp, javahelp, pdf, [web], docbook)
  5. Press Enter to generate the map to XHTML.
    The following message is displayed:

     [echo] Ready to build C:\DITA-OT1.6.M5\samples\hierarchy.ditamap
     [echo] for web in out
     [echo]
     [input] Continue? (Y, [y], N, n)
  6. Press Enter.
    The DITA OT converts the DITA map to XHTML. After a few minutes, the following message is displayed:

    BUILD SUCCESSFUL
    Total time: 2 minutes 54 seconds

    Note: If you do not get this message, see the DITA OT user documentation at the following location:
    C:\DITA-OT1.8.M2\doc\userguide.pdf

    If you can’t make this work by following the documentation, please post your error in the comments section below and I’ll try to help you fix the issue.

  7. To look at your newly generated output, double-click the index.html file in the following directory:
    C:\DITA-OT1.8.M2\out

If you want, you can run this procedure again, this time choosing a different output type.

What’s Next?


You are now ready to write your first DITA document! This will be the subject of the next post.  I will be off snowshoeing during the holidays and will come back with part 2 of the World’s Smallest DITA Project in 2014.

Until then…Happy Holidays, be safe, and be happy. :)


For the curious:

  • To lean more about the features that you need in a DITA editor, read this article from the April 2008 STC intercom issue. It’s five years old, so the list of tools is out of date, but the article still provides very useful information.
  • The DITA Writer has compiled a list of DITA optimized editors, which are XML editors best suited for producing DITA content.

Share this article:
Facebook Twitter Email Linkedin

6 Responses to “The World’s Smallest DITA Project Part 1: Installing the tools”

  1. Jeanne says:

    Happy new year, Nathalie! Thanks for this. I am all set. The instructions worked great – I just needed to update my system PATH variable with the location of my Java bin directory.

  2. Nathalie says:

    Thanks Jeanne! I updated the procedure to add these instructions.

    Happy new year to you too, and thanks for your feedback!

    The next blog post will be available this Friday :)

  3. Excellent start-up instructions. Would be better with the Java path example you sent me via email, though. I had to press Enter a few more times in the cmd prompt, but that might be a peculiarity of my machine.

    How about a link to the next part in the series at the end of the page? I am a very lazy man!

  4. Frank Ralf says:

    Hi Nathalie,

    Thanks for this instructive blog post. I agree that using a simple text editor while learning is a good thing and Notepad++ is also my favorite editor. However, you can make editing DITA files a bit more comfortable by using some of the many plugins available for Notepad++. Especially I’d recommend the “XML Tools”, available from http://sourceforge.net/apps/mediawiki/notepad-plus/index.php?title=Plugin_Central

    Cheers,
    Frank

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>