docs: def freeze_js(html):
      """
      Freeze all JS assets to the rendered html itself.
      """
      matches = js_src_pattern.finditer(html)
  
      if not matches:
          return html
  
      # Reverse regex matches to replace match string with respective JS content
      for match in reversed(tuple(matches)):
          # JS file name
          file_name = match.group(1)
          file_path = os.path.join(js_files_path, file_name)
  
          with open(file_path, "r", encoding="utf-8") as f:
              file_content = f.read()
          # Replace matched string with inline JS
          fmt = '<script type="text/javascript">{}</script>'
          js_content = fmt.format(file_content)
          html = html[:match.start()] + js_content + html[match.end():]
  
      return html