docs: def flatten_pages(self, pages, level=1):
          """Recursively flattens pages data structure into a one-dimensional data structure"""
          flattened = []
  
          for page in pages:
              if type(page) is list:
                  flattened.append(
                               {
                                  'file': page[0],
                                  'title': page[1],
                                  'level': level,
                               })
              if type(page) is dict:
                  if type(list(page.values())[0]) is str:
                      flattened.append(
                              {
                                  'file': list(page.values())[0],
                                  'title': list(page.keys())[0],
                                  'level': level,
                               })
                  if type(list(page.values())[0]) is list:
                      flattened.extend(
                              self.flatten_pages(
                                  list(page.values())[0],
                                  level + 1)
                              )
  
  
          return flattened