code: def parse_notebook_index(ntbkpth):
      
  
      # Convert notebook to RST text in string
      rex = RSTExporter()
      rsttxt = rex.from_filename(ntbkpth)[0]
      # Clean up trailing whitespace
      rsttxt = re.sub(r'\n  ', r'', rsttxt, re.M | re.S)
      pthidx = {}
      pthlst = []
      lines = rsttxt.split('\n')
      for l in lines:
          m = re.match(r'^-\s+`([^<]+)\s+<([^>]+).ipynb>`__', l)
          if m:
              # List of subdirectories in order of appearance in index.rst
              pthlst.append(m.group(2))
              # Dict mapping subdirectory name to description
              pthidx[m.group(2)] = m.group(1)
      return pthlst, pthidx
docs: Parse the top-level notebook index file at `ntbkpth`.  Returns a
      list of subdirectories in order of appearance in the index file,
      and a dict mapping subdirectory name to a description.