code: def make_ref_target_directive(ref_type, indextemplates=None, **kwargs):
      
      class_vars = dict(ref_type=ref_type, indextemplates=indextemplates)
      class_vars.update(kwargs)
      return type("BB%sRefTargetDirective" % (ref_type.capitalize(),),
                  (BBRefTargetDirective,), class_vars)
docs: Create and return a L{BBRefTargetDirective} subclass.