code: def get_preview_url(resource):
      '''
      Returns the most pertinent preview URL associated to the resource, if any.
  
      :param ResourceMixin resource: the (community) resource to preview
      :return: a preview url to be displayed into an iframe or a new window
      :rtype: HttpResponse
      '''
      candidates = (p.preview_url(resource)
                    for p in get_enabled_plugins()
                    if p.can_preview(resource))
      return next(iter(candidates), Nonef get_preview_url(resource):
      '''
      Returns the most pertinent preview URL associated to the resource, if any.
  
      :param ResourceMixin resource: the (community) resource to preview
      :return: a preview url to be displayed into an iframe or a new window
      :rtype: HttpResponse
      '''
      candidates = (p.preview_url(resource)
                    for p in get_enabled_plugins()
                    if p.can_preview(resource))
      return next(iter(candidates), None)
docs: Returns the most pertinent preview URL associated to the resource, if any.
  
      :param ResourceMixin resource: the (community) resource to preview
      :return: a preview url to be displayed into an iframe or a new window
      :rtype: HttpResponse