The assignment for this week introduces two of DITA's topic types: concepts and tasks. It also provides some procedures for working concepts and tasks within oXygen.
Tasks
The task is the center of the user documentation world. All references and concepts within a deliverable should support completing required tasks. Tasks provide a sequential step- by-step instructions in a procedural format. Use a task when you want to describe how to do something
The following illustration shows the structure of a simple task. This example is taken from the examples for the DITA OT.
Guidelines for tasks
Some general guidelines for tasks include:
Tasks should contain a single procedure.
Use titles that start with verbs or “how to”.
Each step should have an imperative statement within a <cmd> element.
Write a concise short description that describes the task and its importance.
Separate conceptual and reference information from the task.
For complex processes or procedures, create a task that contains subtasks. That is, create a procedure that lists the high-level steps for the task in one topic. Then create a topic for each of the individual high-level steps.
Major components of a task
The following table lists the major elements that can occur within a task.
Element
Contains
title
the title of the task
shortdesc
an introduction to the task
taskbody
container for remaining elements
prereq
a list of prerequisites for performing the task
context
background information necessary to complete the task
steps
the ordered or unordered steps that makeup the task
result
the expected outcome when the task is complete
example
an example that supports or illustrates the task
postreq
information about any tasks that the user needs to complete after this task
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="task_wq1_31l_lj">
<title>Banana Bread</title>
<shortdesc><b>Banana bread</b> is a basic, reliable banana bread recipe. The perfect thing to do
with over-ripe bananas!</shortdesc>
<taskbody>
<prereq>
<ul id="ul_vpq_ncl_lj">
<li>1½ cups white sugar</li>
<li>½ cup butter, softened</li>
<li>3 bananas (the riper the better), mashed</li>
<li>2 eggs</li>
<li>2 cups all-purpose flour</li>
<li>½ tsp. baking soda</li>
<li>⅓ cup sour milk or buttermilk</li>
<li>¼ tsp. salt</li>
<li>1 tsp vanilla extract</li>
</ul>
<note>
<p>½ tsp. baking powder and ⅓ cup milk can be substituted for the sour
milk/buttermilk and baking soda.</p>
</note>
</prereq><context>To create banana bread, complete the following steps:</context>
<steps>
<step>
<cmd>Preheat oven to 350°F (175°C).</cmd>
</step>
<step>
<cmd>Lightly grease an 8 in x 4 in loaf pan.</cmd>
</step>
<step>
<cmd>Combine all ingredients into a large mixing bowl. Beat well. </cmd>
</step>
<step>
<cmd>Pour batter into pan.</cmd>
</step>
<step>
<cmd>Bake on middle shelf of oven for 60 minutes, or until a toothpick inserted into
the center of the loaf comes out clean.</cmd>
</step>
</steps>
</taskbody>
</task>
Major elements within a steps list
The <steps> element contains multiple <step> elements. Each step element consists of a <cmd> element, followed by a variety of other optional supporting element. Each step should consist of only a single user action.
Element
Description
cmd
the user instruction (required)
choices
a list of choices that the user can make
substeps
substeps within a step
stepxmp
an example of what happens when a step is performed
tutorialinfo
information for when a step is part of a tutorial
info
additional information the user might need to know to perform the step
stepresult
what happens when a step is completed
Concepts
Concepts provide readers with clear and accurate background information they must know before they can successfully understand and use the product or service discussed in the document. Write concepts as descriptive text to answer the questions, what is it, what does it do, how does it work, and why is this important. Use concept topics to support task topic types.
Note: This example is taken from the examples for the DITA OT.
Guidelines for concepts
Consider the following guidelines for topics:
Describe one concept per topic
Use concept topics appropriately – don’t put task information or steps in a concept.
Use noun-based phrases for titles.
Write short descriptions that provide an overview of theconcept.
Organize and chunk the information through the use of unordered lists, ordered lists, simple lists, and sections.
Use graphics to illustrate concepts.
Make sure to read Chapter 3 from your DITA Best Practices book for examples and more explanations.
Major components of a concept
Element
Contains
title
the title of the concept topic
shortdesc
an intro to the concept topic
conbody
container for the content of the concept p paragraph
ol, ul, or sl
ordered, unordered, or simple lists fig and image figures or images
term
highlights a new term
section
a section that allows you to organize the conceptual information
Block- and phrase-level elements
DITA provides block-level and phrase-level elements to structure content within the topics
Block-level elements: equivalent to paragraph elements in FrameMake or block elements in HTML. These elements appear on their own line in output (for example, <note> or <p>)
Phrase-level elements: equivalent to a character element in FrameMaker or inline elements. They are applied to text within in a paragraph (for example, <b> or <uicontrol>)
The following table lists some of the more commonly used black elements.
Element
Descripton
<dl>
Definition list – contains a list of definition list entries.
<dl>
<dlentry>
<dt>User name</dt>
<dd>Your user name for the system network.</dd>
</dlentry>
<dlentry>
<dt>Password</dt>
<dd>The password used to log into the system.</dd>
</dlentry>
</dl>
<p>
Paragraph – basic building block of text
<p><b>Butter</b> is a dairy product made by churning fresh cream.</p>
<ul>
Unordered list – list of items that appears in bulleted form
Code block – a sample of code that preserves line breaks and whitespace
<codeblock>public class Hello1
{
public static void Main()
{
System.Console.WriteLine("Hello, World!");
}
}
</codeblock>
<sl>
Simple list – a simple list of short phrases. Note that an <ul> can contain block-level elements within the <li> elements, while an <sli> can only contain phrase level elements within the <sli> elements.