docs: def render_trees(trees, path_composer):
      """
      Render list of `trees` to HTML.
  
      Args:
          trees (list): List of :class:`.Tree`.
          path_composer (fn reference): Function used to compose paths from UUID.
              Look at :func:`.compose_tree_path` from :mod:`.web_tools`.
  
      Returns:
          str: HTML representation of trees.
      """
      trees = list(trees)  # by default, this is set
  
      def create_pub_cache(trees):
          """
          Create uuid -> DBPublication cache from all uuid's linked from `trees`.
  
          Args:
              trees (list): List of :class:`.Tree`.
  
          Returns:
              dict: {uuid: DBPublication}
          """
          sub_pubs_uuids = sum((x.collect_publications() for x in trees), [])
  
          uuid_mapping = {
              uuid: search_pubs_by_uuid(uuid)
              for uuid in set(sub_pubs_uuids)
          }
  
          # cleaned dict without blank matches
          return {
              uuid: pub[0]
              for uuid, pub in uuid_mapping.iteritems()
              if pub
          }
  
      # create uuid -> DBPublication cache
      pub_cache = create_pub_cache(trees)
  
      def render_tree(tree, ind=1):
          """
          Render the tree into HTML using :attr:`TREE_TEMPLATE`. Private trees
          are ignored.
  
          Args:
              tree (obj): :class:`.Tree` instance.
              ind (int, default 1): Indentation. This function is called
                  recursively.
  
          Returns:
              str: Rendered string.
          """
          if not tree.is_public:
              return ""
  
          rendered_tree = SimpleTemplate(TREE_TEMPLATE).render(
              tree=tree,
              render_tree=render_tree,
              ind=ind,
              path_composer=path_composer,
              pub_cache=pub_cache,
          )
  
          # keep nice indentation
          ind_txt = ind * "  "
          return ind_txt + ("\n" + ind_txt).join(rendered_tree.splitlines())
  
      # this is used to get reference for back button
      parent = tree_handler().get_parent(trees[0])
      link_up = path_composer(parent) if parent else None
  
      return SimpleTemplate(TREES_TEMPLATE).render(
          trees=trees,
          render_tree=render_tree,
          link_up=link_up,
      )