code: def process_rst_and_summaries(content_generators):
      
  
      for generator in content_generators:
          if isinstance(generator, generators.ArticlesGenerator):
              for article in (
                      generator.articles +
                      generator.translations +
                      generator.drafts):
                  rst_add_mathjax(article)
                  #optionally fix truncated formulae in summaries.
                  if process_summary.mathjax_script is not None:
                      process_summary(article)
          elif isinstance(generator, generators.PagesGenerator):
              for page in generator.pages:
                  rst_add_mathjax(page)
              for page in generator.hidden_pages:
                  rst_add_mathjax(page)
docs: Ensure mathjax script is applied to RST and summaries are
      corrected if specified in user settings.
  
      Handles content attached to ArticleGenerator and PageGenerator objects,
      since the plugin doesn't know how to handle other Generator types.
  
      For reStructuredText content, examine both articles and pages.
      If article or page is reStructuredText and there is math present,
      append the mathjax script.
  
      Also process summaries if present (only applies to articles)
      and user wants summaries processed (via user settings)