code: def rst2html(rst, layout_type):
      try:
          html, _ = subprocess.Popen(
              [
                  "rst2html.py",
                  "-v",
                  "--initial-header-level=2",
                  "--input-encoding=UTF-8:strict",
              ],
              stdin=subprocess.PIPE,
              stdout=subprocess.PIPE,
              encoding="utf8",
          ).communicate(rst)
      except OSError:
          try:
              html, _ = subprocess.Popen(
                  [
                      "rst2html",
                      "-v",
                      "--initial-header-level=2",
                      "--input-encoding=UTF-8:strict",
                  ],
                  stdin=subprocess.PIPE,
                  stdout=subprocess.PIPE,
                  encoding="utf8",
              ).communicate(rst)
  
          except OSError:
              print("*" * 100)
              print(
                  "ERROR: You need to install rst2html! (in the python docutils package)"
              )
              print("*" * 100)
              raise
  
      html = re.search("<body>(.*)</body>", html, re.DOTALL).groups()[0]
  
      algo_name = re.search("<h1.*?>(.*)</h1>", html).groups()[0]
  
      html = (
          """
  {% extends "algo_description_layout_"""
          + layout_type
          + """.html" %}
  {% set title = "Algorithm reference: """
          + algo_name
          + """" %}
  
  {% block algo_description %}
  
  """
          + html
          + """
  
  {% endblock %}
  """
      )
  
      return html
  
file_path: essentia/doc/sphinxdoc/generate_reference.py
imports: import essentia.standard
  import essentia.streaming
  import os, re, subprocess
  import sys
label_desc: Use image node_id 8 for calling a global function with example usage: rst2html(rst, layout_type) and returns: html