Components as structured content
As you add information to a topic, you may realize that there are parts of the content that you could reuse in other topics. For example, you might have a note that needs to be repeated in several other topics. To reuse parts of a topic, you'll need to create that content in a different type of component.
Components are a special type of "container" for content and they are designed to be inserted into topics. The idea is that you:
-
Create a component.
-
Add the content to the component.
-
Insert the component into your topics, where appropriate. Edit the topic and select Insert and then Component.
For example, the following images show a note that is created as a separate note component and then inserted into two different topics.
There are many different types of component you can create, including:
-
Informal topics
Use informal topics to reuse a single element or a sequence of elements (and the associated content).
For example, you might want to reuse a paragraph and an image together, and to do that, you would add them to an informal topic. You then add the informal topic as a component in as many regular topics as you like.
-
Note, tip, caution, warning, and other types of admonitions
For admonitions that you can reuse in many different topics. It's a good idea to create admonitions as components as it means the same wording is used consistently.
-
Itemizedlist
For entire itemized lists (bullet lists) that you want to reuse in different topics.
-
Simplelist
For reusable simple lists that can render a list of items on a single line.
-
Step
For reusable steps that you can insert into procedure structures.
-
Example
For reusable examples. These are often useful when you have multiple versions of a topic and each version needs to contain the same example.
When you create a component, you can open it in the editor and add content to it. The content in a component has to follow the same content model rules as content in a regular topic, so you can only add elements at positions where they are valid.
To learn how to create admonitions as components and then insert them into topics, see Create a Reusable Admonition.
Note
For a subsection in a topic, create a new topic for the subsection. Add the content to the subsection topic and then insert it as a component inside the main “parent” topic. For details, see Create Subsections.