MCPcopy
hub / github.com/chinesehuazhou/python-weekly / set_content_body

Function set_content_body

resources/weekly_workflow.py:395–409  ·  view source on GitHub ↗

生成并返回消息的正文部分,同时生成摘要文件 :param file_path: 周刊文件路径 :param weekly_no: 期号 :param pub_date: 发布日期 :return: 格式化的正文内容

(file_path, weekly_no, pub_date)

Source from the content-addressed store, hash-verified

393 return tag + title
394
395def set_content_body(file_path, weekly_no, pub_date):
396 """
397 生成并返回消息的正文部分,同时生成摘要文件
398 :param file_path: 周刊文件路径
399 :param weekly_no: 期号
400 :param pub_date: 发布日期
401 :return: 格式化的正文内容
402 """
403 content_meta = get_front_matter(file_path)
404 content_body = content_to_string(read_md(file_path))
405 # 在非在线环境下生成摘要文件
406 online_action = os.getenv('ONLINE_ACTION')
407 if not online_action:
408 write_to_md_file(weekly_no, content_meta, content_body, pub_date, file_path)
409 return content_body
410
411def set_footer():
412 """

Callers

nothing calls this directly

Calls 4

get_front_matterFunction · 0.85
content_to_stringFunction · 0.70
read_mdFunction · 0.70
write_to_md_fileFunction · 0.70

Tested by

no test coverage detected