Skip to content

Instantly share code, notes, and snippets.

@infotexture
Last active October 11, 2019 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save infotexture/35486d59815b3a94f48db82a33075cc7 to your computer and use it in GitHub Desktop.
Save infotexture/35486d59815b3a94f48db82a33075cc7 to your computer and use it in GitHub Desktop.
Sample FO output for various index markup options

FO Output Tests

Based on https://github.com/dita-ot/docs/blob/develop/parameters/generate-copy-outer.dita#L39-L45

  1. Index entries as is, with <div> between <title> & <p>:

    <section>
      <title>Exclude content outside the map directory</title>
      <div outputclass="div-index">
        <indexterm>index<index-see-also>entry file</index-see-also></indexterm>
        <indexterm>entry file<indexterm>broken links, reason for</indexterm></indexterm>
      </div>
      <p>Let’s assume that you run the HTML5 transformation. By default, DITA-OT uses the

    RESULT: Extra space-before="0.6em"

      directory</fo:block>
    <fo:block>
    <fo:block space-after="0.6em" space-before="0.6em">
      <fo:wrapper id="index:_unique_d80e21750"/>
      <fo:wrapper id="entry file:_unique_d80e21758"/>
      <fo:wrapper id="entry file:broken links, reason for:_unique_d80e21761"/>
    </fo:block>
    <fo:block space-after="0.6em" space-before="0.6em" text-indent="0em">Let’s assume that you run the …
  2. Index entries without <div>:

    <section>
      <title>Exclude content outside the map directory</title>
      <indexterm>index<index-see-also>entry file</index-see-also></indexterm>
      <indexterm>entry file<indexterm>broken links, reason for</indexterm></indexterm>
      <p>Let’s assume that you run the HTML5 transformation. By default, DITA-OT uses the

    RESULT: Empty space, but less

      directory</fo:block>
    <fo:block>
      <fo:wrapper id="index:_unique_d80e21748"/>
      <fo:wrapper id="entry file:_unique_d80e21756"/>
      <fo:wrapper id="entry file:broken links, reason for:_unique_d80e21759"/>
      <fo:block space-after="0.6em" space-before="0.6em" text-indent="0em">Let’s assume that you run the …
  3. Index entries with same <div> moved to beginning of <p>:

    <section>
      <title>Exclude content outside the map directory</title>
      <p>
        <div outputclass="div-index">
          <indexterm>index<index-see-also>entry file</index-see-also></indexterm>
          <indexterm>entry file<indexterm>broken links, reason for</indexterm></indexterm>
        </div>Let’s assume that you run the HTML5 transformation. By default, DITA-OT uses the

    RESULT: Nested blocks collapse, empty space, but no extra space-before, same as № 2

      directory</fo:block>
    <fo:block>
      <fo:block space-after="0.6em" space-before="0.6em" text-indent="0em">
        <fo:block space-after="0.6em" space-before="0.6em">
          <fo:wrapper id="index:_unique_d80e21752"/>
          <fo:wrapper id="entry file:_unique_d80e21760"/>
          <fo:wrapper id="entry file:broken links, reason for:_unique_d80e21763"/>
        </fo:block>Let’s assume that you run the …
  4. Removed <div>, placed index entries in <p>:

    <section>
      <title>Exclude content outside the map directory</title>
      <p>
        <indexterm>index<index-see-also>entry file</index-see-also></indexterm>
        <indexterm>entry file<indexterm>broken links, reason for</indexterm></indexterm>
        Let’s assume that you run the HTML5 transformation. By default, DITA-OT uses the

    RESULT: No vertical space between title & paragraph, but paragraph indented where index entries appear

      directory</fo:block>
    <fo:block>
      <fo:block space-after="0.6em" space-before="0.6em" text-indent="0em">
        <fo:wrapper id="index:_unique_d80e21750"/>
        <fo:wrapper id="entry file:_unique_d80e21758"/>
        <fo:wrapper id="entry file:broken links, reason for:_unique_d80e21761"/> Let’s assume that you run the …
  5. Line breaks before each index level, entries in paragraph:

    <section>
      <title>Exclude content outside the map directory</title>
      <p>
        <indexterm>index
          <index-see-also>entry file</index-see-also></indexterm>
        <indexterm>entry file
          <indexterm>broken links, reason for</indexterm></indexterm>Let’s assume that you run the HTML5 transformation.

    RESULT: No vertical space between title & paragraph, line breaks collapse to single space

      directory</fo:block>
    <fo:block>
      <fo:block space-after="0.6em" space-before="0.6em" text-indent="0em">
        <fo:wrapper id="index:_unique_d80e21750"/>
        <fo:wrapper id="entry file:_unique_d80e21758"/><fo:wrapper
          id="entry file:broken links, reason for:_unique_d80e21761"/>Let’s assume that you run the
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment