Skip to content

Commit 94784e8

Browse files
authored
Merge pull request UofTCoders#431 from SaraMati/gh-pages
make events
2 parents aae9a21 + 0f63e2d commit 94784e8

File tree

3 files changed

+190
-57
lines changed

3 files changed

+190
-57
lines changed

_data/coffee-code.yml

Lines changed: 68 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
# Date of the event in YYYY-MM-DD format
3-
- date: 2018-09-18
3+
- date: 2019-01-15
44
# Start and end time for event in 24 hour HH:MM format
55
start_time: "9:00"
66
end_time: "11:00"
@@ -13,7 +13,7 @@
1313

1414

1515
# Date of the event in YYYY-MM-DD format
16-
- date: 2018-10-02
16+
- date: 2019-01-29
1717
# Start and end time for event in 24 hour HH:MM format
1818
start_time: "9:00"
1919
end_time: "11:00"
@@ -24,3 +24,69 @@
2424
# Only one label that will be put into the GitHub Issue
2525
gh_labels: "co-working"
2626

27+
# Date of the event in YYYY-MM-DD format
28+
- date: 2019-02-12
29+
# Start and end time for event in 24 hour HH:MM format
30+
start_time: "9:00"
31+
end_time: "11:00"
32+
# Where the event will take place
33+
location: Second Cup at Grad Room
34+
# The URL for the location
35+
location_url: "http://map.utoronto.ca/marker/grad_room_second_cup-313"
36+
# Only one label that will be put into the GitHub Issue
37+
gh_labels: "co-working"
38+
39+
40+
# Date of the event in YYYY-MM-DD format
41+
- date: 2019-02-26
42+
# Start and end time for event in 24 hour HH:MM format
43+
start_time: "9:00"
44+
end_time: "11:00"
45+
# Where the event will take place
46+
location: Second Cup at Grad Room
47+
# The URL for the location
48+
location_url: "http://map.utoronto.ca/marker/grad_room_second_cup-313"
49+
# Only one label that will be put into the GitHub Issue
50+
gh_labels: "co-working"
51+
52+
53+
54+
# Date of the event in YYYY-MM-DD format
55+
- date: 2019-03-12
56+
# Start and end time for event in 24 hour HH:MM format
57+
start_time: "9:00"
58+
end_time: "11:00"
59+
# Where the event will take place
60+
location: Second Cup at Grad Room
61+
# The URL for the location
62+
location_url: "http://map.utoronto.ca/marker/grad_room_second_cup-313"
63+
# Only one label that will be put into the GitHub Issue
64+
gh_labels: "co-working"
65+
66+
67+
68+
# Date of the event in YYYY-MM-DD format
69+
- date: 2019-03-26
70+
# Start and end time for event in 24 hour HH:MM format
71+
start_time: "9:00"
72+
end_time: "11:00"
73+
# Where the event will take place
74+
location: Second Cup at Grad Room
75+
# The URL for the location
76+
location_url: "http://map.utoronto.ca/marker/grad_room_second_cup-313"
77+
# Only one label that will be put into the GitHub Issue
78+
gh_labels: "co-working"
79+
80+
81+
82+
# Date of the event in YYYY-MM-DD format
83+
- date: 2019-04-09
84+
# Start and end time for event in 24 hour HH:MM format
85+
start_time: "9:00"
86+
end_time: "11:00"
87+
# Where the event will take place
88+
location: Second Cup at Grad Room
89+
# The URL for the location
90+
location_url: "http://map.utoronto.ca/marker/grad_room_second_cup-313"
91+
# Only one label that will be put into the GitHub Issue
92+
gh_labels: "co-working"

_data/events.yml

Lines changed: 76 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Key is the part of the filename in _posts/
22
- key: intro-python
33
# Title of event that will show up as the GH Issue title
4-
title: 'Intro to Python'
4+
title: "Intro to Python"
55
# Explanation of event as a paragraph form
66
description: >
77
The basics of data analysis using the
@@ -33,7 +33,7 @@
3333
# Key is the part of the filename in _posts/
3434
- key: Intro-R
3535
# Title of event that will show up as the GH Issue title
36-
title: 'Intro to R/Tidyverse'
36+
title: "Intro to R and Tidyverse"
3737
# Explanation of event as a paragraph form
3838
description: >
3939
The basics of using R and the Tidyverse for working with data, specifically:
@@ -67,7 +67,7 @@
6767
# Key is the part of the filename in _posts/
6868
- key: Intro-Bash
6969
# Title of event that will show up as the GH Issue title
70-
title: 'Intro to Bash/Shell Scripting'
70+
title: "Intro to Bash/Shell Scripting"
7171
# Explanation of event as a paragraph form
7272
description: >
7373
This introduction to BASH aims to make participants
@@ -104,7 +104,7 @@
104104
# Key is the part of the filename in _posts/
105105
- key: inkscape
106106
# Title of event that will show up as the GH Issue title
107-
title: 'Inkscape - An Open-Source Alternative to Adobe Illustrator'
107+
title: "Inkscape - An Open-Source Alternative to Adobe Illustrator"
108108
# Explanation of event as a paragraph form
109109
description: >
110110
We will learn to use Inkscape, a cross-platform open source graphic design software.
@@ -137,7 +137,7 @@
137137

138138
skill_level: Beginner
139139
# R or Python
140-
program_language:
140+
program_language: ""
141141
# Only one label that will be put into the GitHub Issue
142142
gh_labels: code-along
143143

@@ -147,7 +147,7 @@
147147
# Key is the part of the filename in _posts/
148148
- key: R-reshape2
149149
# Title of event that will show up as the GH Issue title
150-
title: 'Intro to TidyRand Reshape2'
150+
title: "Intro to TidyR and Reshape2"
151151
# Explanation of event as a paragraph form
152152
description: ""
153153

@@ -178,10 +178,11 @@
178178
# Key is the part of the filename in _posts/
179179
- key: python-imageprocessing
180180
# Title of event that will show up as the GH Issue title
181-
title: 'Intro to TidyRand Reshape2'
181+
title: "Image Processing in Python"
182182
# Explanation of event as a paragraph form
183183
description: >
184-
This is an introductory tutorial on image processing using Python packages. We will understand image data types, manipulate and prepare images for analysis such as image segmentation.
184+
This is an introductory tutorial on image processing using Python packages.
185+
We will understand image data types, manipulate and prepare images for analysis such as image segmentation.
185186
186187
# Date of the event in YYYY-MM-DD format
187188
date: 2019-02-14
@@ -211,7 +212,7 @@
211212
# Key is the part of the filename in _posts/
212213
- key: R-shinyapps
213214
# Title of event that will show up as the GH Issue title
214-
title: 'Intro to TidyR and Reshape2'
215+
title: "R: Interactive Plotting with Shinny Apps"
215216
# Explanation of event as a paragraph form
216217
description: ""
217218
# Date of the event in YYYY-MM-DD format
@@ -240,7 +241,7 @@
240241
# Key is the part of the filename in _posts/
241242
- key: deeplearning-tensorflow
242243
# Title of event that will show up as the GH Issue title
243-
title: 'Deep Learning with Tensorflow and Keras'
244+
title: "Deep Learning with Tensorflow and Keras"
244245
# Explanation of event as a paragraph form
245246
description: ""
246247
# Date of the event in YYYY-MM-DD format
@@ -270,7 +271,7 @@
270271
# Key is the part of the filename in _posts/
271272
- key: git-testing
272273
# Title of event that will show up as the GH Issue title
273-
title: 'Git: Continuous Integration and Testing'
274+
title: "Git Continuous Integration and Testing"
274275
# Explanation of event as a paragraph form
275276
description: ""
276277
# Date of the event in YYYY-MM-DD format
@@ -301,7 +302,7 @@
301302
# Key is the part of the filename in _posts/
302303
- key: software-defined-radio
303304
# Title of event that will show up as the GH Issue title
304-
title: 'Information on the Air - Software Defined Radio'
305+
title: "Information on the Air - Software Defined Radio"
305306
# Explanation of event as a paragraph form
306307
description: ""
307308
# Date of the event in YYYY-MM-DD format
@@ -331,7 +332,7 @@
331332
# Key is the part of the filename in _posts/
332333
- key: Regression-R
333334
# Title of event that will show up as the GH Issue title
334-
title: 'Regression Models in R'
335+
title: "Regression Models in R"
335336
# Explanation of event as a paragraph form
336337
description: ""
337338
# Date of the event in YYYY-MM-DD format
@@ -360,7 +361,7 @@
360361
# Key is the part of the filename in _posts/
361362
- key: HTML
362363
# Title of event that will show up as the GH Issue title
363-
title: 'HTML and Web Design'
364+
title: HTML and Web Design
364365
# Explanation of event as a paragraph form
365366
description: ""
366367
# Date of the event in YYYY-MM-DD format
@@ -391,7 +392,7 @@
391392
# Key is the part of the filename in _posts/
392393
- key: ggplot2
393394
# Title of event that will show up as the GH Issue title
394-
title: 'Intro to ggplot2 in R'
395+
title: "Intro to ggplot2 in R"
395396
# Explanation of event as a paragraph form
396397
description: ""
397398
# Date of the event in YYYY-MM-DD format
@@ -421,7 +422,7 @@
421422
# Key is the part of the filename in _posts/
422423
- key: Deeplearning-pytorch
423424
# Title of event that will show up as the GH Issue title
424-
title: 'Deep Learning with PyTorch'
425+
title: "Deep Learning with PyTorch"
425426
# Explanation of event as a paragraph form
426427
description: ""
427428
# Date of the event in YYYY-MM-DD format
@@ -447,3 +448,62 @@
447448
gh_labels: code-along
448449

449450

451+
452+
453+
# Key is the part of the filename in _posts/
454+
- key: co-working
455+
# Title of event that will show up as the GH Issue title
456+
title: "co-working"
457+
# Explanation of event as a paragraph form
458+
description: ""
459+
# Date of the event in YYYY-MM-DD format
460+
date: 2019-04-18
461+
# Start and end time for event in 24 hour HH:MM format
462+
start_time: "18:10"
463+
end_time: "19:00"
464+
# Where the event will take place
465+
location: MADLab
466+
# The URL for the location
467+
location_url: "https://goo.gl/maps/cfygtx94KL92"
468+
# Packages to install, a space separating each package
469+
# (e.g. "dplyr tidyr" or "Pandas>=0.21 Seaborn")
470+
packages: ""
471+
# Beginner Intermediate Advanced
472+
473+
youtube_link: ""
474+
475+
skill_level: Advanced
476+
# R or Python
477+
program_language: Python
478+
# Only one label that will be put into the GitHub Issue
479+
gh_labels: code-along
480+
481+
482+
483+
# Key is the part of the filename in _posts/
484+
- key: social
485+
# Title of event that will show up as the GH Issue title
486+
title: "End of Term Social"
487+
# Explanation of event as a paragraph form
488+
description: ""
489+
# Date of the event in YYYY-MM-DD format
490+
date: 2019-04-25
491+
# Start and end time for event in 24 hour HH:MM format
492+
start_time: "19:00"
493+
end_time: "21:00"
494+
# Where the event will take place
495+
location: TBA
496+
# The URL for the location
497+
location_url: ""
498+
# Packages to install, a space separating each package
499+
# (e.g. "dplyr tidyr" or "Pandas>=0.21 Seaborn")
500+
packages: ""
501+
# Beginner Intermediate Advanced
502+
503+
youtube_link: ""
504+
505+
skill_level: Beginner
506+
# R or Python
507+
program_language: Python
508+
# Only one label that will be put into the GitHub Issue
509+
gh_labels: code-along

scripts/announcements.R

Lines changed: 46 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,56 @@ keep_only_new <- function(.data) {
8484
new_sessions <- keep_only_new(session_details)
8585
new_coffee_code <- keep_only_new(coffee_code_details)
8686

87+
# Create files in _posts/ -------------------------------------------------
88+
# Adds the new sessions/events to the _posts folder.
89+
90+
create_new_posts_with_content <- function(.data) {
91+
new_post_filenames <-
92+
glue_data(.data, "{here::here('_posts')}/{date}-{key}.md")
93+
94+
# Get the GitHub Issue URL for the event.
95+
gh_issue_number <- gh::gh("GET /repos/:owner/:repo/issues",
96+
owner = "uoftcoders",
97+
repo = "Events") %>%
98+
map_dfr(~ data_frame(by_title = .$title, url = .$html_url))
99+
100+
new_post_content <- .data %>%
101+
mutate(by_title = str_c(title, " - ", day_month(date, add_name = FALSE))) %>%
102+
left_join(gh_issue_number, by = "by_title") %>%
103+
glue_data(
104+
'
105+
---
106+
title: "{title}"
107+
text: "{description}"
108+
location: "{location}"
109+
link: "{url}"
110+
date: "{as.Date(date)}"
111+
startTime: "{start_time}"
112+
endTime: "{end_time}"
113+
---
114+
'
115+
)
116+
117+
# Save post content to file
118+
fs::dir_create(here::here("_posts"))
119+
map2(new_post_content, new_post_filenames, ~ write_lines(x = .x, path = .y))
120+
usethis:::done("Markdown posts created in _posts/ folder.")
121+
return(invisible())
122+
}
123+
124+
create_new_posts_with_content(new_sessions)
125+
create_new_posts_with_content(new_coffee_code)
126+
127+
128+
129+
130+
87131
# Create a GitHub Issue of the session ------------------------------------
88132

89133
post_gh_issue <- function(title, body, labels) {
90134
# Will need to set up a GitHub PAT via (I think) the function
91135
# devtools::github_pat() in the console.
92-
devtools:::rule("Posting GitHub Issues")
136+
# devtools:::rule("Posting GitHub Issues")
93137
cat("Posting `", title, "`\n\n")
94138
if (!devtools:::yesno("Are you sure you want to post this event as an Issue?")) {
95139
gh::gh(
@@ -98,6 +142,7 @@ post_gh_issue <- function(title, body, labels) {
98142
repo = "Events",
99143
title = title,
100144
body = body,
145+
101146
labels = array(c(labels))
102147
)
103148
usethis:::done("Event posted as an Issue to UofTCoders/Events.")
@@ -185,42 +230,4 @@ create_gh_issues_events <- function(.data) {
185230
create_gh_issues_coffee_code(new_coffee_code)
186231
create_gh_issues_events(new_sessions)
187232

188-
# Create files in _posts/ -------------------------------------------------
189-
# Adds the new sessions/events to the _posts folder.
190233

191-
create_new_posts_with_content <- function(.data) {
192-
new_post_filenames <-
193-
glue_data(.data, "{here::here('_posts')}/{date}-{key}.md")
194-
195-
# Get the GitHub Issue URL for the event.
196-
gh_issue_number <- gh::gh("GET /repos/:owner/:repo/issues",
197-
owner = "uoftcoders",
198-
repo = "Events") %>%
199-
map_dfr(~ data_frame(by_title = .$title, url = .$html_url))
200-
201-
new_post_content <- .data %>%
202-
mutate(by_title = str_c(title, " - ", day_month(date, add_name = FALSE))) %>%
203-
left_join(gh_issue_number, by = "by_title") %>%
204-
glue_data(
205-
'
206-
---
207-
title: "{title}"
208-
text: "{description}"
209-
location: "{location}"
210-
link: "{url}"
211-
date: "{as.Date(date)}"
212-
startTime: "{start_time}"
213-
endTime: "{end_time}"
214-
---
215-
'
216-
)
217-
218-
# Save post content to file
219-
fs::dir_create(here::here("_posts"))
220-
map2(new_post_content, new_post_filenames, ~ write_lines(x = .x, path = .y))
221-
usethis:::done("Markdown posts created in _posts/ folder.")
222-
return(invisible())
223-
}
224-
225-
create_new_posts_with_content(new_sessions)
226-
create_new_posts_with_content(new_coffee_code)

0 commit comments

Comments
 (0)