{escaped_summary}
""" html += """# coding=utf-8 """ RSS HTML 报告渲染模块 提供 RSS 订阅内容的 HTML 格式报告生成功能 """ from datetime import datetime from typing import Dict, List, Optional, Callable from trendradar.report.helpers import html_escape def render_rss_html_content( rss_items: List[Dict], total_count: int, feeds_info: Optional[Dict[str, str]] = None, *, get_time_func: Optional[Callable[[], datetime]] = None, ) -> str: """渲染 RSS HTML 内容 Args: rss_items: RSS 条目列表,每个条目包含: - title: 标题 - feed_id: RSS 源 ID - feed_name: RSS 源名称 - url: 链接 - published_at: 发布时间 - summary: 摘要(可选) - author: 作者(可选) total_count: 条目总数 feeds_info: RSS 源 ID 到名称的映射 get_time_func: 获取当前时间的函数(可选,默认使用 datetime.now) Returns: 渲染后的 HTML 字符串 """ html = """
{escaped_summary}
""" html += """