class_docstr: Main documentation class
class_docstr_tok: ["Main","documentation","class"]
docstr: Generates the documentation body
code: def gen_body(self):
      """Generates the documentation body"""
      md = MarkdownFile()
      md.first_title()
      md.textn(
          "This reference contains all the details the Python API. To consult a previous reference for a specific CARLA release, change the documentation version using the panel in the bottom right corner.<br>"
          + "This will change the whole documentation to a previous state. Remember that the <i>latest</i> version is the `dev` branch and may show features not available in any packaged versions of CARLA.<hr>"
      )
      for module_name in sorted(self.master_dict):
          module = self.master_dict[module_name]
          module_key = module_name
          # Generate class doc (if any)
          if valid_dic_val(module, "classes"):
              for cl in sorted(
                  module["classes"], key=lambda i: i["class_name"]
              ):
                  class_name = cl["class_name"]
                  class_key = join([module_key, class_name], ".")
                  current_title = module_name + "." + class_name
                  md.title(
                      2,
                      join(
                          [
                              current_title,
                              '<a name="',
                              current_title,
                              '"></a>',
                          ]
                      ),
                  )
                  # Inheritance
                  if valid_dic_val(cl, "parent"):
                      inherits = italic(create_hyperlinks(cl["parent"]))
                      md.inherit_join(inherits)
                  # Class main doc
                  if valid_dic_val(cl, "doc"):
                      md.textn(
                          create_hyperlinks(md.prettify_doc(cl["doc"]))
                      )
                  # Generate instance variable doc (if any)
                  if valid_dic_val(cl, "instance_variables"):
                      md.title(3, "Instance Variables")
                      for inst_var in cl["instance_variables"]:
                          add_doc_inst_var(md, inst_var, class_key)
                  # Generate method doc (if any)
                  if valid_dic_val(cl, "methods"):
                      method_list = list()
                      dunder_list = list()
                      get_list = list()
                      set_list = list()
                      for method in sorted(
                          cl["methods"], key=lambda i: i["def_name"]
                      ):
                          method_name = method["def_name"]
                          if (
                              method_name[0] == "_"
                              and method_name != "__init__"
                          ):
                              dunder_list.append(method)
                          elif method_name[:4] == "get_":
                              get_list.append(method)
                          elif method_name[:4] == "set_":
                              set_list.append(method)
                          else:
                              method_list.append(method)
                      md.title(3, "Methods")
                      for method in method_list:
                          add_doc_method(md, method, class_key)
                      if len(get_list) > 0:
                          md.title(5, "Getters")
                      for method in get_list:
                          add_doc_getter_setter(
                              md, method, class_key, True, set_list
                          )
                      if len(set_list) > 0:
                          md.title(5, "Setters")
                      for method in set_list:
                          add_doc_getter_setter(
                              md, method, class_key, False, get_list
                          )
                      if len(dunder_list) > 0:
                          md.title(5, "Dunder methods")
                      for method in dunder_list:
                          add_doc_dunder(md, method, class_key)
                  md.separator()
      append_code_snipets(md)
      append_snipet_button_script(md)
      return md.data().strip()
  
imports: import os
  import yaml
  import re
  import doc_gen_snipets
label_desc: Use image node_id 3 for calling the Documentation obj's underlying member method code with example usage: obj.gen_body() and returns: md