docs: def _prepare_env(self):  # pragma: no cover
          """Setup the document's environment, if necessary."""
          env = self.state.document.settings.env
          if not hasattr(env, self.directive_name):
              # Track places where we use this directive, so we can check for
              # outdated documents in the future.
              state = DirectiveState()
              setattr(env, self.directive_name, state)
          else:
              state = getattr(env, self.directive_name)
          return env, state