Corin1998 commited on
Commit
b964992
·
verified ·
1 Parent(s): 6e582ef

Update export/ppt.py

Browse files
Files changed (1) hide show
  1. export/ppt.py +2 -6
export/ppt.py CHANGED
@@ -2,7 +2,7 @@ from pptx import Presentation
2
  from pptx.util import Pt
3
 
4
  def _add_slide(prs, title, bullets, footnotes):
5
- slide_layout = prs.slide_layouts[1] # Title and Content
6
  slide = prs.slides.add_slide(slide_layout)
7
  slide.shapes.title.text = title
8
  body = slide.shapes.placeholders[1].text_frame
@@ -11,20 +11,17 @@ def _add_slide(prs, title, bullets, footnotes):
11
  p = body.add_paragraph()
12
  p.text = b
13
  p.level = 0
14
- # 脚注
15
  tx = slide.shapes.add_textbox(left=Pt(10), top=Pt(680), width=Pt(900), height=Pt(40)).text_frame
16
- tx.text = "Sources: " + " ".join([f"[{i}] {u}" for i,u in footnotes])
17
  tx.paragraphs[0].font.size = Pt(8)
18
 
19
  def build_deck(summary_sections: dict, links):
20
  prs = Presentation()
21
- # 1: タイトル
22
  _add_slide(prs, "IR/PR Co-Pilot Pro 自動生成サマリ", [
23
  "対象: 指定企業の直近開示(EDINET/TDnet)",
24
  "本資料は自動要約(RAG)により生成",
25
  "各ページ末尾に根拠リンク(脚注)を付与"
26
  ], links)
27
- # 2-8: 各章
28
  chapter_map = [
29
  ("業績ハイライト", summary_sections.get("highlights", "")),
30
  ("見通し", summary_sections.get("outlook", "")),
@@ -38,7 +35,6 @@ def build_deck(summary_sections: dict, links):
38
  bullets = [s.strip("- ").strip() for s in text.split("\n") if s.strip()]
39
  bullets = bullets[:6]
40
  _add_slide(prs, title, bullets, links)
41
- # 9-10: Q&Aダイジェスト
42
  _add_slide(prs, "想定Q&A(ダイジェスト1/2)", ["詳細は添付CSV参照"], links)
43
  _add_slide(prs, "想定Q&A(ダイジェスト2/2)", ["詳細は添付CSV参照"], links)
44
  return prs
 
2
  from pptx.util import Pt
3
 
4
  def _add_slide(prs, title, bullets, footnotes):
5
+ slide_layout = prs.slide_layouts[1]
6
  slide = prs.slides.add_slide(slide_layout)
7
  slide.shapes.title.text = title
8
  body = slide.shapes.placeholders[1].text_frame
 
11
  p = body.add_paragraph()
12
  p.text = b
13
  p.level = 0
 
14
  tx = slide.shapes.add_textbox(left=Pt(10), top=Pt(680), width=Pt(900), height=Pt(40)).text_frame
15
+ tx.text = "Sources: " + " ".join([f"[{i}] {u}" for i, u in footnotes])
16
  tx.paragraphs[0].font.size = Pt(8)
17
 
18
  def build_deck(summary_sections: dict, links):
19
  prs = Presentation()
 
20
  _add_slide(prs, "IR/PR Co-Pilot Pro 自動生成サマリ", [
21
  "対象: 指定企業の直近開示(EDINET/TDnet)",
22
  "本資料は自動要約(RAG)により生成",
23
  "各ページ末尾に根拠リンク(脚注)を付与"
24
  ], links)
 
25
  chapter_map = [
26
  ("業績ハイライト", summary_sections.get("highlights", "")),
27
  ("見通し", summary_sections.get("outlook", "")),
 
35
  bullets = [s.strip("- ").strip() for s in text.split("\n") if s.strip()]
36
  bullets = bullets[:6]
37
  _add_slide(prs, title, bullets, links)
 
38
  _add_slide(prs, "想定Q&A(ダイジェスト1/2)", ["詳細は添付CSV参照"], links)
39
  _add_slide(prs, "想定Q&A(ダイジェスト2/2)", ["詳細は添付CSV参照"], links)
40
  return prs