docs: def convert_notebooks_to_html_partial(notebook_paths, url_map):
      """
      Converts notebooks in notebook_paths to HTML partials
      """
      for notebook_path in notebook_paths:
          # Computes <name>.ipynb from notebooks/01/<name>.ipynb
          path, filename = os.path.split(notebook_path)
          # Computes examples from notebooks/examples
          chapter = os.path.split(path)[1] if os.sep in path else ''
          # Computes <name> from <name>.ipynb
          basename, _ = os.path.splitext(filename)
          # Computes <name>.html from notebooks/<name>.ipynb
          outfile_name = basename + '.html'
  
          # This results in images like AB_5_1.png for a notebook called AB.ipynb
          unique_image_key = basename
          # This sets the img tag URL in the rendered HTML.
          output_files_dir = '/' + NOTEBOOK_IMAGE_DIR
  
          # Path to output final HTML file
          outfile_path = os.path.join(chapter, outfile_name)
          if chapter:
              os.makedirs(chapter, exist_ok=True)
  
          extract_output_config = {
              'unique_key': unique_image_key,
              'output_files_dir': output_files_dir,
          }
  
          notebook = nbformat.read(notebook_path, 4)
          notebook.cells.insert(0, _preamble_cell(path))
          html, resources = html_exporter.from_notebook_node(
              notebook,
              resources=extract_output_config,
          )
  
          if outfile_path not in url_map:
              print(
                  '[Warning]: {} not found in _data/toc.yml. This page will '
                  'not appear in the textbook table of contents.'
                  .format(outfile_path)
              )
          prev_page = url_map.get(outfile_path, {}).get('prev', 'false')
          next_page = url_map.get(outfile_path, {}).get('next', 'false')
  
          final_output = wrapper.format(
              html=html,
              prev_page=prev_page,
              next_page=next_page,
          )
  
          # Write out HTML
          with open(outfile_path, 'w', encoding='utf-8') as outfile:
              outfile.write(final_output)
  
          # Write out images
          for relative_path, image_data in resources['outputs'].items():
              image_name = os.path.basename(relative_path)
              final_image_path = os.path.join(NOTEBOOK_IMAGE_DIR, image_name)
              with open(final_image_path, 'wb') as outimage:
                  outimage.write(image_data)
  
          print(outfile_path + " written.")