class_docstr: A StandaloneHTMLBuilder that creates all HTML pages as "index.html" in
  a directory given by their pagename, so that generated URLs don't have
  ``.html`` in them.
class_docstr_tok: ["A","StandaloneHTMLBuilder","that","creates","all","HTML","pages","as","``","index.html","''","in","a","directory","given","by","their","pagename",",","so","that","generated","URLs","do","n't","have","``",".html","``","in","them","."]
code: def get_outfilename(self, pagename: str) -> str:
      if pagename == "index" or pagename.endswith(SEP + "index"):
          outfilename = path.join(
              self.outdir, os_path(pagename) + self.out_suffix
          )
      else:
          outfilename = path.join(
              self.outdir, os_path(pagename), "index" + self.out_suffix
          )
  
      return outfilename
  
file_path: sphinx/sphinx/builders/dirhtml.py
imports: from __future__ import annotations
  from os import path
  from typing import TYPE_CHECKING, Any
  from sphinx.builders.html import StandaloneHTMLBuilder
  from sphinx.util import logging
  from sphinx.util.osutil import SEP, os_path
label_desc: Use image node_id 2 for calling the DirectoryHTMLBuilder obj's underlying member method code with example usage: obj.get_outfilename(pagename) and returns: outfilename