bluenevus commited on
Commit
49509a4
·
verified ·
1 Parent(s): 530b93c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -40,8 +40,7 @@ def generate_release_notes(github_repo, github_token, gemini_api_key, start_date
40
  - Do not use any Markdown syntax (*, #, `, etc.)
41
  - Use plain text only
42
  - For section headers, simply use the text as is (e.g., "New Features:")
43
- - For list items, use a single bullet point (•) followed by a space
44
- - Do not use multiple bullet points or numbers for a single item
45
  - Keep the text structure simple and easy to convert to a Word document format
46
  """
47
 
@@ -51,16 +50,18 @@ def generate_release_notes(github_repo, github_token, gemini_api_key, start_date
51
  doc = docx.Document()
52
  doc.add_heading('Release Notes', 0)
53
 
 
54
  for line in release_notes.split('\n'):
55
  line = line.strip()
56
  if line.endswith(':'):
57
  doc.add_heading(line, level=1)
58
- elif line.startswith('•'):
59
- # Remove extra bullet points if present
60
- cleaned_line = re.sub(r'^•+\s*', '• ', line)
61
- doc.add_paragraph(cleaned_line, style='List Bullet')
62
  elif line:
63
- doc.add_paragraph(line)
 
 
 
 
64
 
65
  temp_file = "release_notes.docx"
66
  doc.save(temp_file)
 
40
  - Do not use any Markdown syntax (*, #, `, etc.)
41
  - Use plain text only
42
  - For section headers, simply use the text as is (e.g., "New Features:")
43
+ - For list items, do not use any bullet points or numbers. Start each item directly with the text.
 
44
  - Keep the text structure simple and easy to convert to a Word document format
45
  """
46
 
 
50
  doc = docx.Document()
51
  doc.add_heading('Release Notes', 0)
52
 
53
+ current_list_style = None
54
  for line in release_notes.split('\n'):
55
  line = line.strip()
56
  if line.endswith(':'):
57
  doc.add_heading(line, level=1)
58
+ current_list_style = None
 
 
 
59
  elif line:
60
+ if current_list_style is None:
61
+ current_list_style = doc.add_paragraph().style
62
+ current_list_style.name = 'List Bullet'
63
+ current_list_style.font.size = docx.shared.Pt(11)
64
+ doc.add_paragraph(line, style=current_list_style)
65
 
66
  temp_file = "release_notes.docx"
67
  doc.save(temp_file)