标记内容

You can set to flag content based on metadata. By default, no content is flagged.

Define a common set of images, and common alternative text for them, so that you can flag consistent content across your information set. Generally flagging is supported for block-level elements such as paragraphs, but not for phrase-level elements within a paragraph. This ensures that the images flagging the content are easily scanned by the reader, instead of being buried in text.

At least one value in at least one attribute must be set to flag for the element to be flagged.

  1. Create a DITA filter file in the directory you want to add the file to. Give the file a descriptive name, such as "audience-flag-build.ditaval".
  2. Open the file, and type below content into it:
    <?xml version="1.0" encoding="UTF-8"?> 
    <val> </val>
  3. Define the property you want to flag:
    1. Type a new property for flag by adding a new line <prop att="" val="" action="flag" img="" alt=""/>.
    2. Select the attribute ("audience", "platform", "product", "otherprops") you want to flag based on. For example, "audience".
    3. Type the value you want to flag. For example, "programmer".
    4. Enter the image you want to use to flag the content. Local absolute paths, or relative paths from the filter file both are supported. For example, "D:\resource\delta.gif".
    5. Type the alternate text for the image that will be used by screen readers. For example, "sample alt text".
    You can define more properties by following the steps above. The final ditaval file with the example values should be like this:
    <?xml version="1.0" encoding="UTF-8"?> 
    <val>
      <prop att="audience" val="programmer" action="flag" img="D:\resource\delta.gif" alt="sample alt text"/>
    </val>
  4. When you publish output from the topic or map, specify the filter file you want by using the parameter /filter:{args.input.valfile} for the output options.
Content is flagged when any of the flagged values appears in any of the attributes. When flagged values are found in a map, links that are generated from affected topicrefs will be flagged on output.

Examples

<p audience="admin programmer">

When admin is set to flag, the paragraph will be preceded by the image you specified for admin.

When both values are set to flag, both images will appear before the paragraph.

<topicref platform="linux" href="abc.dita">
When linux is set to flag, any links to abc.dita derived from this topic reference will be flagged with the image you specified. In addition, any links derived from child topicrefs will also be flagged: metadata attributes are inherited.