Wednesday 30 November 2011

Test Driving the Componize DITA XML Solution

Componize kindly granted me a trial of their Componize Cloud-based system. They sent me a very nice Getting Started email and a password reset.

The Componize user guide, Getting Started topic (requires trial login) looks like the Eclipse Help output from the DITA OpenToolkit. The user guide didn't immediately say how to check-out, modify and check-in content but that's OK because, once I located the DITAmap and topics, I could easily click the "Edit online with DITA Storm button" to open it in a new browser tab.

The following sections describe my first attempts to use Componize with DITA XML content.

First: Change some content


  1. Click the My Home link at the top left.
  2. In the Alfresco Explorer, drill down to locate the content.


  3. Click the Edit Online with DITA Storm button.
  4. Make some changes and click Save.
But that isn't really appropriate for a multi-user environment. What we really need to do is check-out, change and check-in a file.

To check-out, change and check-in a topic:
  1. From the drop-down, select Check Out, select a location for the working copy, and click Check Out.
  2. This creates a working copy.

  3. Edit the working copy and click the Check In icon.
Second: Publish
  1. In the Alfresco Explorer, navigate to the DITAmap.
  2. Click the drop-down and select Run Output Processing.


  3. Select the output format (pipeline) you want, and click Add to List.
  4. At the top right, click OK.

The screen refreshes surprisingly quickly to show Log files for <ditamap> with the result clearly listed under Results Document with the correct time and date.

In the trial the PDF displays using the default DITA OpenToolkit appearance with my changes included.

Tuesday 29 November 2011

My Author-it Elevator Pitch


When you choose Author-it you are choosing
  • Single Sourcing,
  • Reusable content,
  • Modular Writing,
  • Assembled Documents
  • and Content Management.
Why does Single Sourcing make sense?

Well, Author-it publishes to Print, Web, and Help formats and, given time and budget, you can customize anything and everything you want about those outputs. But what it means on the ground is that you are not writing in any one of those outputs using specific tools and creating independent formatting. In the old world order you’d use Framemaker for print, Robohelp for help, and Dreamweaver for online. You’d spend time formatting and carefully laying out the content in each of those tools. Estimates vary but authors can burn between 40% and 70% of their time making changes to the pagination and formatting of their documents. With single-sourcing that effort is made once up-front. The authors simply need to apply the styles to their content and the formatting looks after itself when you publish - BANG - you’ve now got half the work to do.

Why reuse content?

Look at it like a translation job. You might think that translation at 7 pence per word is expensive. How often do you stop to think what it costs to write the content in the first place. Can you put a value on that, per word? When you include all the research, reviews, editing, and updating, all the emails and coffee breaks, my back of an envelope calculation gives (100 page manual = £7000, Average 200 words per page, 7000p/200 =) about 35p per word. I’ll leave you to join the dots on this one... let’s just say that reusing chunks of text makes sound economic sense and with Author-it it is SO easy, particularly if you invest in Author-it Xtend which brings reuse to the paragraph level and creates consistency on a whole new level.

Why write in a modular style?

A friend of mine, John (@jashw0rth), hit the nail on the head for this one. From being tiny, we’ve been raised with books. The thing about a book is that it reveals information bit by bit. When, as an adult, you start reading manuals in order to do your job, if the information you need isn’t on the page you’re reading, you’ll trust it to be somewhere in the manual. You might keep reading or use the index or table of contents to locate it (or for online manuals, search the PDF). You don’t notice the extra effort because you’re conditioned to it. Now, if you practice chunking information into topic based modular documents you’ll quickly get into the habit of making sure all of the appropriate context is present in the topic or chunk and of providing links to the information that isn’t immediately available. When you then publish those topics to a print format it just makes a noticeably better document. The information you need is there when you need it. You no longer need to trust it will be there somewhere. The message is that we need modular writing for online help and hyperlinked formats but it even makes better printed documents.

What are assembled documents?

Once you have your information in topics you can quickly and easily, drag and drop topics to rearrange them into books for help systems, books for manuals, books aimed at different audiences or products. Assembled documents are another great way of reuse. You can reuse the same content across products or product versions without doing additional writing.. remember that figure of 35p per word?

What about content management?

I’m not going to pretend that all of this comes without a cost. You’ve got to learn a tool. You need to move your existing content into the new tool. You have processes; what will become of them? Author-it is a content management solution. It does help you manage your content. You can search for any text, title, release state. You can search by folder or by book. You can search and replace text in the results (I’m not sure if that’s a new feature but it is very cool). You can use the release states to mirror your processes and formally lock topics that are being reviewed or have been approved. You have that level of control. You can turn on history and store every change that’s ever made to an object, and revert them when you need to.

All of the management, security, and tracking tools that you get with a CMS like Author-it just aren’t available if you’re using file store or code control. And don’t worry, if you’re a small team or excessively paranoid, you can turn them all off... Or on as you prefer.

You already manage your content, why not use a modern tool that is designed for the job to help you?

Did I mention collaboration? 

No, but I’ll end there, thanks for giving me your eyes.

So that’s it, just to recap, Author-it offers;
  • Single Sourcing,
  • Reusable content,
  • Modular Writing,
  • Assembled Documents,
  • Content Management,
  • And collaboration.

Wednesday 9 November 2011

Simplifying PDF Document Publishing in the DITA OpenToolkit

In a recent post on the Yahoo DITA Users Group, Mark Griffin described one of "the main things that people want to do and find difficult" as "adjusting the cover page for PDF output" and, as I was working on exactly that, I thought I'd jot down a few notes to help others.

I was working in the DITA OpenToolkit (DITA-OT) version 1.5.3 on Windows 7.

The idea here is to let you get usable output from the DITA OpenToolkit in a little under an hour. Let me know in the comments if you have any difficulties. The ethos of PDF customization is that you should override the configuration files by creating custom files. This is not always possible. In particular I found that front-matter_1.0.xsl cannot be moved or overridden.

As a minimum, I recommend you use a good text editor like Notepad++.

Downloading the toolkit
 

First, download the latest DITA-OT file from sourceforge and unzip it to the root of your data drive.

Testing it works with a publish
 

Note: From here on, all the file and folder paths I use are relative to the inside of the DITA-OT folder.

Make sure the DITA-OT is working the way we need it:
  1. Double-click startcmd.bat.
  2. Change directory, type cd samples\ant_sample
  3. Type ant -f sample_pdf.xml
  4. Wait for the processing to finish then, in Windows Explorer, navigate to samples\ant_sample\out\samples\pdf.
  5. Open file hierarchy.pdf to view the result.
Leave the command prompt open so that you can test your changes as you make them.

Simplifying headers and footers
 

I simplified the headers and footers so that they contained only the product name at the top and page number at the bottom (except the cover). To add the product name to the header:
  1. Copy en.xml from demo\fo\cfg\common\vars to demo\fo\Customization\common\vars

  2. There is no need to update catalog.xml for custom vars. They are used automatically.

  3. Define the variable Product Name in en.xml

  4.  <variable id="Product Name">MyProduct Version 8</variable>

  5. In en.xml, add page numbers to all the footer definitions (search for "footer")

    <variable id="Body odd footer"><param ref-name="pagenum"/></variable>
     
  6. Still in en.xml, simplify the header variables to just show the product name variable

    For example, from:

    <variable id="Body odd header"><param ref-name="prodname"/>&#xA0;|&#xA0;<param ref-name="heading"/>&#xA0;|&#xA0;<param ref-name="pagenum"/></variable>

    To:

    <variable id="Body odd header"><param ref-name="prodname"/></variable>

    Also, the headers and footers were too close to the edge of the page.
     
  7. Copy all the definitions for header and footer positioning from demo\fo\cfg\fo\attrs\static-content-attr.xsl to demo\fo\Customization\fo\attrs\custom.xsl. These appear as follows:

    <xsl:attribute-set name="__body__first__header">
           <xsl:attribute name="text-align">right</xsl:attribute>
           <xsl:attribute name="margin-right">10pt</xsl:attribute>
           <xsl:attribute name="margin-top">10pt</xsl:attribute>
    </xsl:attribute-set>

    And set all the margins (I used search and replace):

    • "margin-left">57pt 
    • "margin-right">57pt 
    • "margin-bottom">35pt 
    • "margin-top">35pt

  8. In order to get the publishing to use the custom.xsl file, enable it in demo/fo/Customization/catalog.xml by removing the commenting around the following line:

    <uri name="cfg:fo/attrs/custom.xsl" uri="fo/attrs/custom.xsl"/>

    I then needed to remodel the header and footer to just show the product name at the top, and the page number at the bottom.

  9. Publish again to check it worked.

    The page numbers and product name should appear on every page except the cover and be further from the edge.

Adjusting the page size
 

I needed A4 paper which is 210mm x 297mm, the DITA-OT default is US Letter size.

To change the paper size:
  1. Copy the global variables for page and margin from demo\fo\cfg\fo\attrs\basic-settings.xsl to demo\fo\Customization\fo\attrs\custom.xsl and change to the following:

    <xsl:variable name="page-width">210mm</xsl:variable> 
    <xsl:variable name="page-height">297mm</xsl:variable>

  2. Publish again to check it worked.

Setting the default font
 

I also needed to make the default font Sans Serif.

To change the default font:
  1. Copy attribute-set __fo__root from demo\fo\cfg\fo\attrs\commons-attr.xsl to demo\fo\Customization\fo\attrs\custom.xsl.
  2. Change font from "Serif" to "Sans".
  3. Publish again to check it worked.

A simple front page
 

I made a simple front page with a logo at the top-right, product name (set in the map @product attribute), map title, and revision (set in the map @rev attribute). The blocks just stack and fill the flow from the top down. Measurements are defined in the attribute sets: __frontmatter__product, __frontmatter__title, and __frontmatter__rev.

Add the following blocks which include the image block in demo\fo\xsl\fo\front-matter_1.0.xsl. They need to go inside template name="createFrontMatter_1.0", in the xsl-region-body flow. They include 2 new blocks before the title and 1 after as follows:


<!-- RP added: frontmatter logo -->
<fo:block margin-left="5.2in">
<fo:external-graphic src="url(Customization/OpenTopic/common/artwork/logo.png)"/>
</fo:block>
<!-- RP added: set the product -->
<fo:block xsl:use-attribute-sets="__frontmatter__product">
<xsl:choose>
<xsl:when test="//*[contains(@class, ' map/map ')]/@product">
<xsl:value-of select="//*[contains(@class, ' map/map ')]/@product"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>Product attribute not set for map</xsl:text>
</xsl:otherwise>
</xsl:choose>
</fo:block>
<!-- set the title --> (this exists unchanged)
<fo:block xsl:use-attribute-sets="__frontmatter__title">
...
...
...
</fo:block>
<!-- RP added: set the revision -->
<fo:block xsl:use-attribute-sets="__frontmatter__rev">
<xsl:choose>
<xsl:when test="//*[contains(@class, ' map/map ')]/@rev">
<xsl:value-of select="//*[contains(@class, ' map/map ')]/@rev"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>Revision attribute not set for map</xsl:text>
</xsl:otherwise>
</xsl:choose>
</fo:block>


Place your logo.png file in folder demo\fo\Customization\common\artwork folder.

Create the attribute sets. Copy the __frontmatter__title block attribute-set from demo\fo\cfg\fo\attrs\front-matter-attr.xsl to demo\fo\Customization\fo\attrs\custom.xsl and duplicate it for __frontmatter__product and __frontmatter__rev. I left aligned __frontmatter then adjusted the vertical spacing as follows:


<!-- front-matter-attr.xsl modifications -->
    <xsl:attribute-set name="__frontmatter">
        <xsl:attribute name="text-align">left</xsl:attribute>
    </xsl:attribute-set>
 
    <xsl:attribute-set name="__frontmatter__product">
        <xsl:attribute name="margin-top">30mm</xsl:attribute>
        <xsl:attribute name="font-family">Sans</xsl:attribute>
        <xsl:attribute name="font-size">18pt</xsl:attribute>
        <xsl:attribute name="font-weight">normal</xsl:attribute>
        <xsl:attribute name="line-height">140%</xsl:attribute>
    </xsl:attribute-set>
 
    <xsl:attribute-set name="__frontmatter__title">
        <xsl:attribute name="margin-top">45mm</xsl:attribute>
        <xsl:attribute name="font-family">Serif</xsl:attribute>
        <xsl:attribute name="font-size">28pt</xsl:attribute>
        <xsl:attribute name="font-weight">bold</xsl:attribute>
        <xsl:attribute name="line-height">140%</xsl:attribute>
    </xsl:attribute-set>
 
    <xsl:attribute-set name="__frontmatter__rev">
        <xsl:attribute name="margin-top">128mm</xsl:attribute>
        <xsl:attribute name="font-family">Sans</xsl:attribute>
        <xsl:attribute name="font-size">10pt</xsl:attribute>
        <xsl:attribute name="font-weight">normal</xsl:attribute>
        <xsl:attribute name="line-height">140%</xsl:attribute>
    </xsl:attribute-set>

Finally, publish again.



Tuesday 1 November 2011

Doom and Gloom in the UK

We need to get the UK economy growing again. At the moment, for every £4 the government receives in revenue, it is still spending £5. What can we do to reduce our public deficit? The government is putting serious money behind building the private sector but how should we spend it? What are our assets?

Well, one of our assets is the English language.

Businesses need to focus on clear communications with their customers for their business or service. Fortunately, we're in the best place on earth to do that.

I'm suggesting that we all investigate grants and loans to increase the accuracy, improve the effectiveness, and reduce the volume of our communications. This should be a fundamental step for any business in order to out-compete our overseas competitors and to correctly promote our products and services on the world stage.

Friday 14 October 2011

Framemaker 7.2 on Windows 7

The other day I was installing Framemaker 7.2 and when I mentioned Windows 7 in the office there was an intake of breath... I can't remember who from.

I've been working with Framemaker 7.2 for about 1 week, and although it should run fairly smoothly on a new-ish laptop, because it was developed for Windows 2000, it didn't. Just typing held the processor at 100% and letters were appearing seconds after I typed them.

I tried the Windows 7 compatibility wizard but it was hopeless.

To fix Framemaker 7.2 compatibility options for Windows 7
  1. In Windows Explorer, navigate to C:\Program Files\Adobe\Framemaker 7.2.
  2. Right-click Framemaker.exe and select Properties from the shortcut menu.
  3. Click the Compatibility tab.
  4. Click Change settings for all users.
  5. Click Disable display scaling on high dpi settings.
  6. Click OK.

My hypothesis is, that I have a high dpi screen resolution, which on Windows XP meant that everything was tiny. I have set Windows 7 screen resolution settings to scale text and other items to 125%, making them more readable. However, Framemaker probably doesn't use the Windows rendering and so would be presenting more of a bitmap based approach to this rescaling function. If that is the case then adding each letter or chunk of text might mean  redrawing the whole page which would obviously take far more processor time. By disabling the display scaling for Framemaker everything starts to work normally.