class_docstr: Main documentation class
docstr: Generates the documentation body
docstr_tok: ["Generates","the","documentation","body"]
code: def gen_body(self):
      """Generates the documentation body"""
      md = MarkdownFile()
      # Create header for snipets (div container and script to copy)
      md.textn(
          "[comment]: <> (=========================)\n"
          + "[comment]: <> (PYTHON API SCRIPT SNIPETS)\n"
          + "[comment]: <> (=========================)\n"
          + '<div id="snipets-container" class="Container" onmouseover=\'this.style["overflowX"]="scroll";\' onmouseout=\'this.style["overflowX"]="visible";\'></div>\n'
          + "<script>\n"
          + "function CopyToClipboard(containerid) {\n"
          + "if (document.selection) {\n"
          + "var range = document.body.createTextRange();\n"
          + "range.moveToElementText(document.getElementById(containerid));\n"
          + "range.select().createTextRange();\n"
          + 'document.execCommand("copy");\n'
          + "} \n"
          + "else if (window.getSelection) {\n"
          + "var range = document.createRange();\n"
          + "range.selectNode(document.getElementById(containerid));\n"
          + "window.getSelection().addRange(range);\n"
          + 'document.execCommand("copy");\n'
          + "}\n"
          + "}\n</script>\n"
          + "<script>\n"
          + "function CloseSnipet() {\n"
          + 'document.getElementById("snipets-container").innerHTML = null;\n'
          + "}\n"
          + "</script>\n"
      )
      # Create content for every snipet
      for snipet_path in self._snipets:
          current_snipet = open(snipet_path, "r")
          snipet_name = os.path.basename(
              current_snipet.name
          )  # Remove path
          snipet_name = os.path.splitext(snipet_name)[
              0
          ]  # Remove extension
          # Header for a snipet
          md.textn(
              '<div id ="'
              + snipet_name
              + '-snipet" style="display: none;">\n'
              + '<p class="SnipetFont">\n'
              + "Snippet for "
              + snipet_name
              + "\n"
              + "</p>\n"
              + '<div id="'
              + snipet_name
              + '-code" class="SnipetContent">\n\n```py\n'
          )
          # The snipet code
          md.textn(current_snipet.read())
          # Closing for a snipet
          md.textn(
              '\n```\n<button id="button1" class="CopyScript" onclick="CopyToClipboard(\''
              + snipet_name
              + '-code\')">Copy snippet</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<button id="button1" class="CloseSnipet" onclick="CloseSnipet()">Close snippet</button><br><br>\n'
          )
          # Check if snipet image exists, and add it
          for snipet_path_to_image in self._snipets_images:
              snipet_image_name = os.path.splitext(
                  os.path.basename(snipet_path_to_image)
              )[0]
              if snipet_name == snipet_image_name:
                  md.textn(
                      '\n<img src="/img/snipets_images/'
                      + os.path.basename(snipet_path_to_image)
                      + '">\n'
                  )
          md.textn("</div>\n")
      # Closing div
      md.textn("\n</div>\n")
      return md.data().strip()
  
file_path: carla/PythonAPI/docs/doc_gen_snipets.py
imports: import os
  import yaml
  import re
label_desc: Use image node_id 2 for calling the Documentation obj's underlying member method code with example usage: obj.gen_body() and returns: md