FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
2026.code4lib.org/_scripts/talks.rb at main · code4lib/2026.code4lib.org · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
code4lib
/
2026.code4lib.org
Public
Notifications
You must be signed in to change notification settings
Fork
7
Star
2
Code
Issues
2
Pull requests
1
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
2026.code4lib.org
/
_scripts
/
talks.rb
Copy path
More file actions
More file actions
Latest commit
History
History
History
executable file
·
61 lines (54 loc) · 1.64 KB
Breadcrumbs
2026.code4lib.org
/
_scripts
/
talks.rb
Copy path
File metadata and controls
executable file
·
61 lines (54 loc) · 1.64 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/usr/bin/env ruby
require
"csv"
require
"time"
def
parameterize
(
string
,
separator
:
"-"
)
# Turn unwanted chars into the separator.
parameterized_string
=
string
.
downcase
.
gsub!
(
/[^a-z0-9
\-
_]+/
,
separator
)
unless
separator
.
nil?
||
separator
.
empty?
re_leading_trailing_separator
=
/^-|-$/
parameterized_string
.
gsub!
(
re_leading_trailing_separator
,
""
.
freeze
)
end
parameterized_string
end
CSV
.
foreach
(
ARGV
[
0
]
,
headers
:
true
)
.
each
do
|
row
|
title
=
row
[
"title"
]
speaker1
=
row
[
"name1"
]
speaker2
=
row
[
"name2"
]
speaker3
=
row
[
"name3"
]
description
=
row
[
"description"
]
time
=
row
[
"time"
]
length
=
row
[
"length"
]
day
=
row
[
"day"
]
ampm
=
row
[
"ampm"
]
dayno
=
row
[
"dayno"
]
group
=
row
[
"group"
]
spot
=
row
[
"spot"
]
# fixup time
time
=
Time
.
parse
(
time
)
.
strftime
(
"%H:%M"
)
fn
=
"_posts/
#{
day
}
-
#{
parameterize
(
title
)
}
.md"
puts
fn
File
.
open
(
fn
,
"w"
)
do
|
f
|
f
.
puts
"---"
f
.
puts
"layout: presentation"
f
.
puts
"type: talk"
f
.
puts
"categories: talks"
f
.
puts
"time:
#{
time
}
#{
ampm
}
"
f
.
puts
"startTime:
#{
day
}
T
#{
time
}
"
f
.
puts
"length:
#{
length
}
"
f
.
puts
"day:
#{
dayno
}
"
f
.
puts
"group:
#{
group
}
"
f
.
puts
"spot:
#{
spot
}
"
#f.puts "location: frist" # XXX is this used?
f
.
puts
"speakers:"
f
.
puts
"-
#{
parameterize
(
speaker1
)
}
"
f
.
puts
"-
#{
parameterize
(
speaker2
)
}
"
if
speaker2
f
.
puts
"-
#{
parameterize
(
speaker3
)
}
"
if
speaker3
speakerlist
=
speaker1
speakerlist
+=
", "
+
speaker2
if
speaker2
speakerlist
+=
", "
+
speaker3
if
speaker3
f
.
puts
"speaker-text:
\"
#{
speakerlist
.
gsub
(
/"/
,
"""
)
}
\"
"
f
.
puts
"title:
\"
#{
title
}
\"
"
f
.
puts
"---"
f
.
puts
description
end
end
Back
|
FazBrowse Home
|
New Git URL