def to_web_include(
        project: 'projects.Project',
        file_path: str
) -> WEB_INCLUDE:
    """
    Converts the given file_path into a WEB_INCLUDE instance that represents
    the deployed version of this file to be loaded into the results project
    page

    :param project:
        Project in which the file_path resides
    :param file_path:
        Absolute path to the source file for which the WEB_INCLUDE instance
        will be created
    :return:
        The WEB_INCLUDE instance that represents the given source file
    """

    if not file_path.endswith('.css') and not file_path.endswith('.js'):
        return None

    slug = file_path[len(project.source_directory):]
    url = '/{}' \
        .format(slug) \
        .replace('\\', '/') \
        .replace('//', '/')

    return WEB_INCLUDE(name=':project:{}'.format(url), src=url)