docs: def _render_rst(self):  # pragma: no cover
          """Render lines of reStructuredText for items yielded by
          :meth:`~doctor.docs.base.BaseHarness.iter_annotations`.
          """
          # Create a mapping of headers to annotations.  We want to group
          # all annotations by a header, but they could be in multiple handlers
          # so we create a map of them here with the heading as the key and
          # the list of associated annotations as a list.  This is so we can
          # sort them alphabetically to make reading the api docs easier.
          heading_to_annotations_map = defaultdict(list)
          for heading, route, handler, annotations in (
                  self.harness.iter_annotations()):
              # Set the route and handler as attributes so we can retrieve them
              # when we loop through them all below.
              for annotation in annotations:
                  annotation.route = route
                  annotation.handler = handler
                  heading_to_annotations_map[heading].append(annotation)
  
          headings = list(heading_to_annotations_map.keys())
          headings.sort()
          previous_heading = None
          for heading in headings:
              annotations = heading_to_annotations_map.get(heading)
              # Sort all the annotations by title.
              annotations.sort(key=lambda a: a.title)
              # Only emit a new heading if the resource has changed.  This
              # esnures that documented endpoints for the same resource all
              # end up under a single heading.
              if previous_heading != heading:
                  previous_heading = heading
                  yield HEADING_TOKEN + heading
              for annotation in annotations:
                  route = annotation.route
                  normalized_route = normalize_route(route)
                  handler = annotation.handler
                  # Adds a title for the endpoint.
                  if annotation.title is not None:
                      yield annotation.title
                      yield '#' * len(annotation.title)
                  docstring = get_description_lines(getattr(annotation.logic,
                                                            '__doc__', None))
  
                  # Documents the logic function associated with the annotation.
                  docstring.append(':Logic Func: :func:`~{}.{}`'.format(
                      annotation.logic.__module__, annotation.logic.__name__))
  
                  field = '<json'
                  if annotation.http_method in ('DELETE', 'GET'):
                      field = 'query'
                  docstring.extend(get_json_lines(
                      annotation, field=field, route=normalized_route,
                      request=True)
                  )
  
                  # Document any request headers.
                  defined_headers = list(self.harness._get_headers(
                      str(route), annotation).keys())
                  defined_headers.sort()
                  for header in defined_headers:
                      definition = self.harness.header_definitions.get(
                          header, '').strip()
                      docstring.append(':reqheader {}: {}'.format(
                          header, definition))
  
                  # Document response if a type was defined.
                  if annotation.return_annotation != Parameter.empty:
                      docstring.extend(get_json_lines(
                          annotation, field='>json', route=normalized_route))
  
                  docstring.extend(self._make_example(route, handler, annotation))
                  for line in http_directive(annotation.http_method,
                                             normalized_route, docstring):
                      yield line
  
          # Document resource objects.
          for line in get_resource_object_doc_lines():
              yield line