DITA lesson 5: Maps

DITA lesson 5: Maps#


27 April 2024

In a previous lesson, you created some DITA topics. If you followed through the explanations in another previous lesson, your topics are all standalone entities that can be read and understood independently of the other topics.

In this lesson, you’ll learn how to assemble topics into a set. In the DITA language, such sets are called maps; in the outside world, these sets are understood as being books, guides, or manuals.

A map is only a container, wrapper, jacket, or tray that holds topics.

khatta meetha kaddu and chaney ki daal ka paratha
https://twitter.com/RuShuVi/status/1717912810133352717

besan missi, muskat pumpkin, and boondi raita
https://twitter.com/RuShuVi/status/1459271182109270023

https://twitter.com/SudiptoDoc/status/1783705887900921913
https://twitter.com/SudiptoDoc/status/1783705887900921913

https://twitter.com/SudiptoDoc/status/1783705887900921913
https://twitter.com/SudiptoDoc/status/1783705887900921913

A map can contain other maps. A topic can exist in more than one map, and in more than one place within a map.

To get a book out of your DITA topics, you place the topics in a map and then transform the map to an output such as HTML files or EclipseHelp. Whichever topic is present in the map gets included in the book. So, your file system or your repository can contain a thousand DITA files, but if only ten of them are in a map, only those ten files are included in whichever help you’re building (HTML pages, EclipseHelp, PDF file, whatever).

photo from https://www.foodnetwork.com/healthy/packages/healthy-every-week/healthy-tips/a-nutritionists-healthy-buffet-strategies

DITA contains two types of maps: bookmaps and, uh, maps.

map

bookmap

Book-level metadata

Not really

Yes

Topics exist where?

In the map directly

In the chapters of the bookmap

Submaps

Yes

Yes

Front matter and back matter

No

Yes

As you can see, a bookmap is geared more towards a book kind of look-and-feel than the simple map. Here’s an indicative structure of both.

map
├── title
├── topicref       <!-- any number of topicrefs is possible -->
    ├── topicref
    ├── topicref     <!-- any level of nesting is possible -->

You’d have noticed a tag called <topicref>. This is the tag that contains the cross-reference to a topic, through its href attribute.

The order of the <topicref> tags in the map, and their nesting, determines the order and hierarchy of the topics in the output.

<topicref href="install_checker.dita"></topicref>
<topicref href="run_checks.dita">
     <topicref href="run_style_check.dita"></topicref>
     <topicref href="run_link_check.dita"></topicref>
</topicref>

You’d have noticed that the map contained only a pointer to the filename (<topicref href="install_checker.dita"></topicref>). How does the output contain a human-readable title (Install the quality scripts)? That’s because, generally, all DITA processors will pick the topic title and show it on the ToC. The <topicref> tag cannot contain any text within itself; it is only a reference or pointer to a file.

Recap#

  • Maps are containers.

  • Maps are the Table of Contents.

Exercise#

Use XMLMind Editor to do these assignments.

  1. Refer back to the Topics lesson, where you created some concept, reference, and task topics. Now, gather those topics into a map:

    1. Create a map (File > New > DITA > Map).

    2. Specify the title (that’s where the blinking cursor is placed first), and add topics to the map.

      Tip

      A right-click shows a context menu. Take it away from there.

  2. Generate an HTML output (Map > Convert document > Convert to XHTML). To see the generated output, open the file called toc.html.

  3. Experiment with other output types. Do not focus on the formatting of the content. Rather, see what the several kinds of possible outputs are. You are looking at single-source publishing multi-channel publishing: the same set of files are being used to create more than one deliverable.

  4. Repeat the previous steps, but this time, create a bookmap instead of a simple map. Play around with the bookmap options and observe the differences, if any, between the generated output of a plain map and a bookmap.

What next?#

In the next lesson, you’ll learn about creating links between topics even without editing the topics themselves.


Lessons in this course#

  1. Information typing

  2. Tags, introduction

  3. Tags, cheatsheet

  4. Topics

  5. Maps

  6. Topics, linking

  7. Topics, more ways to link

  8. Reuse

  9. Profiling