parameters: (self, container, page)
docstring: Inserts breadcrumb links at the top of the page.
  
          Inputs:
              root[tree.html.Tag]: The tag to which the breadcrumbs should be inserted.
  
          TODO: This is relying on hard-coded .md/.html extensions, that should not be the case.
docstring_summary: Inserts breadcrumb links at the top of the page.
docstring_tokens: Inserts breadcrumb links at the top of the page .
function: def _addBreadcrumbs(self, container, page):
          """
          Inserts breadcrumb links at the top of the page.
  
          Inputs:
              root[tree.html.Tag]: The tag to which the breadcrumbs should be inserted.
  
          TODO: This is relying on hard-coded .md/.html extensions, that should not be the case.
          """
  
          row = html.Tag(None, 'div', class_="row")
          col = html.Tag(row, 'div', class_="col hide-on-med-and-down l12")
          nav = html.Tag(col, 'nav', class_="breadcrumb-nav")
          div = html.Tag(nav, 'div', class_="nav-wrapper")
  
          container.insert(0, row)
  
          parts = page.local.split(os.sep)
          for i in range(1, len(parts)):
              current = self.translator.findPage(lambda p: p.local == os.path.join(*parts[:i]))
  
              if isinstance(current, pages.Directory):
                  idx = self.translator.findPages(os.path.join(current.local, 'index.md'), exact=True)
                  if idx:
                      url = os.path.relpath(current.local,
                                            os.path.dirname(page.local)).replace('.md', '.html')
                      a = html.Tag(div, 'a', href=url,
                                   class_="breadcrumb",
                                   string=current.name)
                  else:
                      span = html.Tag(div, 'span', class_="breadcrumb")
                      html.String(span, content=current.name)
  
              elif isinstance(current, pages.File) and current.name != 'index.md':
                  url = os.path.relpath(current.local,
                                        os.path.dirname(page.local)).replace('.md', '.html')
                  a = html.Tag(div, 'a', href=url, class_="breadcrumb")
                  html.String(a, content=os.path.splitext(current.name)[0])
  
          if not page.local.endswith('index.md'):
              html.Tag(div, 'a', href='#', class_="breadcrumb",
                       string=os.path.splitext(page.name)[0])
function_tokens: def _addBreadcrumbs ( self , container , page ) : row = html . Tag ( None , 'div' , class_ = "row" ) col = html . Tag ( row , 'div' , class_ = "col hide-on-med-and-down l12" ) nav = html . Tag ( col , 'nav' , class_ = "breadcrumb-nav" ) div = html . Tag ( nav , 'div' , class_ = "nav-wrapper" ) container . insert ( 0 , row ) parts = page . local . split ( os . sep ) for i in range ( 1 , len ( parts ) ) : current = self . translator . findPage ( lambda p : p . local == os . path . join ( * parts [ : i ] ) ) if isinstance ( current , pages . Directory ) : idx = self . translator . findPages ( os . path . join ( current . local , 'index.md' ) , exact = True ) if idx : url = os . path . relpath ( current . local , os . path . dirname ( page . local ) ) . replace ( '.md' , '.html' ) a = html . Tag ( div , 'a' , href = url , class_ = "breadcrumb" , string = current . name ) else : span = html . Tag ( div , 'span' , class_ = "breadcrumb" ) html . String ( span , content = current . name ) elif isinstance ( current , pages . File ) and current . name != 'index.md' : url = os . path . relpath ( current . local , os . path . dirname ( page . local ) ) . replace ( '.md' , '.html' ) a = html . Tag ( div , 'a' , href = url , class_ = "breadcrumb" ) html . String ( a , content = os . path . splitext ( current . name ) [ 0 ] ) if not page . local . endswith ( 'index.md' ) : html . Tag ( div , 'a' , href = '#' , class_ = "breadcrumb" , string = os . path . splitext ( page . name ) [ 0 ] )