code: def _build_menu(docs):
      
  
      paths = []
      current = docs.filename
      while current != docs.root:
          current = current.parent
          paths.append(current)
  
      for path in reversed(paths):
          docs.add_menu(path.stem.title(), link=path / 'index.html')
  
      if docs.filename.stem != 'index':
          docs.add_menu(docs.title, link=docs.filename)
  
      docs.end_menu()
docs: Builds the menu used for the current ``DocumentWriter``.