DITA

DITA (Darwin Information Typing Architecture; DITA 1.3, OASIS Standard 17 December 2015) writes documentation as small typed topics (concept, task, reference) that maps assemble and reuse across manuals. The DITA Open Toolkit 4.4.1 (github.com/dita-ot/dita-ot (https://github.com/dita-ot/dita-ot 454 ), Apache-2.0) publishes it:

returns.dita: a DITA task topicXML
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="returns">
  <title>Returning a BookNest order</title>
  <shortdesc>Send back any book within 30 days of delivery.</shortdesc>
  <taskbody>
    <steps>
      <step><cmd>Open <uicontrol>Orders</uicontrol> and select the order.</cmd></step>
      <step><cmd>Choose <uicontrol>Return</uicontrol> and print the label.</cmd></step>
    </steps>
  </taskbody>
</task>
Publishing the topic to HTML5 with DITA-OT
dita=~/xml-tools/dita-ot-4.4.1/bin/dita
$dita -i returns.dita -f html5 -o out/help
grep -o '<h1[^>]*>[^<]*</h1>\|<ol class="ol steps">' out/help/returns.html
Output
<h1 class="title topictitle1" id="ariaid-title1">Returning a BookNest order</h1>
<ol class="ol steps">

DITA-OT wrote returns.html (and two style sheets); maps, Markdown topics and PDF output work the same way.


DITA

The Darwin Information Typing Architecture (DITA) is an XML architecture for authoring and, with the DITA Open Toolkit, publishing. It applies the principles of specialization and inheritance - comparable to Charles Darwin's concept of evolutionary adaptation, from which the name derives.

Each DITA topic is an XML file that can be reused across multiple publications. The generic Topic type contains a title element, a prolog element for metadata, and a body element. The body element contains paragraph, table, and list elements, much as in HTML 30 . Three specialized topic types exist: Task, Concept, and Reference.

Extensive metadata 30 elements and attributes can be included, both at the topic level and within individual elements. Conditional text 30 allows content to be filtered or styled based on attributes such as audience, platform, and product. A .ditaval file identifies which attribute values are used for conditional processing.

A DITA map is a container for topics. Giving the topics a sequence and a structure, a map is used to transform a collection of content into a publication. A map can include relationship tables that define hyperlinks between topics, be nested, reference other topics or maps, and contain a variety of content types and metadata.

New elements and attributes can be added for specific industries and companies through the specialization of base DITA elements and attributes.

Worked Example

A minimal DITA publication combines a map (the table of contents), one or more topics, and, optionally, a .ditaval file for conditional filtering. The example below shows a map that references a single topic, a minimal "Hello world" topic, and a .ditaval file that includes content marked for the audience value "foo" and excludes content marked for "bar".
ch11-dita-map.xml, ch11-dita-topic.xml, ch11-dita-val.xmlXML
merged-01-01-ch11-dita-map.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map id="map" xml:lang="en">
  <topicref format="dita" href="sample.dita"
                navtitle="Sample" type="topic"/>
</map>
merged-01-02-ch11-dita-topic.xml
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE topic PUBLIC "-//OASIS//DTD DITA Topic//EN" "topic.dtd">
<topic xml:lang="en" id="sample">
  <title>Sample</title>
  <body>
    <p audience="foo">Hello world</p>
  </body>
</topic>
merged-01-03-ch11-dita-val.xml
<?xml version="1.0" encoding="UTF-8"?>
<val>
  <prop att="audience" val="foo" action="include"/>
  <prop att="audience" val="bar" action="exclude"/>
</val>