code: def register_references(kb_app: kb,
                          sphinx_app: Sphinx,
                          sphinx_env: BuildEnvironment,
                          docnames: List[str]):
      
  
      references: ReferencesContainer = sphinx_app.env.references
  
      for name, klass in kb_app.config.resources.items():
          # Name is the value in the decorator and directive, e.g.
          # @kb.resource('category') means name=category
          if getattr(klass, 'is_reference', False):
              references[name] = dict()
docs: Walk the registry and add sphinx directives