code: def format_page(self, page, link_resolver, output):
          
          debug('Formatting page %s' % page.link.ref, 'formatting')
  
          if output:
              actual_output = os.path.join(output,
                                           'html')
              if not os.path.exists(actual_output):
                  os.makedirs(actual_output)
          else:
              actual_output = None
  
          page.format(self.formatter, link_resolver, actual_output)
docs: Called by `project.Project.format_page`, to leave full control
          to extensions over the formatting of the pages they are
          responsible of.
  
          Args:
              page: tree.Page, the page to format.
              link_resolver: links.LinkResolver, object responsible
                  for resolving links potentially mentioned in `page`
              output: str, path to the output directory.