Skip to content

Commit

Permalink
Update compile_schedule.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jeremymanning authored Jul 18, 2024
1 parent 6a21224 commit eea3c1b
Showing 1 changed file with 1 addition and 26 deletions.
27 changes: 1 addition & 26 deletions .github/workflows/compile_schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,32 +20,7 @@ jobs:
python -m pip install pandas
- name: Compile Schedule
run: |
import pandas as pd
import subprocess
# Load events
events_df = pd.read_csv('events.tsv', delimiter='\t')
# Generate events calendar in Markdown format
events_markdown = "# PBS Social Committee Calendar of Events\nWinter, 2024*\n\nAfter a brief hiatus, we’ve put together another exciting term for you! Here’s our schedule of events this term.\n\n"
for _, row in events_df.iterrows():
with open(f'templates/{row["Content File"]}', 'r') as file:
event_content = file.read()
# Replace placeholders with actual values
event_content = event_content.replace('{DATE}', row['Date']).replace('{TIME}', row['Time']).replace('{LOCATION}', row['Location'])
events_markdown += f"## {row['Event Name']}\n\n"
events_markdown += event_content + "\n\n"
events_markdown += "---\n\n"
# Save the events markdown to a file
with open('events_schedule.md', 'w') as file:
file.write(events_markdown.strip())
# Convert the Markdown file to PDF using Pandoc
subprocess.run(['pandoc', 'events_schedule.md', '-o', 'events_schedule.pdf'])
run: python compile_schedule.py

- name: Upload Schedule PDF
uses: actions/upload-artifact@v2
Expand Down

0 comments on commit eea3c1b

Please sign in to comment.