-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the toml specifications to playground
- Loading branch information
Showing
3 changed files
with
100 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
+++ | ||
[event] | ||
name = "Indie Hacker Meetup" | ||
type = "meetup" | ||
|
||
[when] | ||
date = 2023-10-15 | ||
time = [10:00:00, 18:00:00] | ||
|
||
[livestream] | ||
provider = "streamyard" | ||
channels = ["facebook_live"] | ||
|
||
[eventpop.assets] | ||
source = "posters" | ||
|
||
[[eventpop.tickets]] | ||
name = "Early Bird" | ||
amount = 80 | ||
available_at = 2023-10-05T20:00:00 | ||
+++ | ||
|
||
# Indie Hacker Meetup | ||
|
||
A meetup for indie hackers! | ||
Details about how to organize it goes here. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
[event] | ||
name = "Indie Hacker Meetup" | ||
type = "meetup" | ||
|
||
[when] | ||
date = 2023-10-15 | ||
start = 18:00:00 | ||
end = 22:00:00 | ||
|
||
[livestream] | ||
provider = "streamyard" | ||
channels = ["facebook_live"] | ||
|
||
[eventpop.assets] | ||
source = "posters" | ||
|
||
[[eventpop.tickets]] | ||
name = "Early Bird" | ||
amount = 80 | ||
available_at = 2023-10-05T20:00:00 | ||
|
||
[assets.posters] | ||
provider = "figma" | ||
template = "garden_zero" | ||
formats = ["poster", "square"] | ||
image_prompt = "a programmer sitting in a campsite writing code" | ||
heading = "{event.name}" | ||
# default to edit_required: true, adds an extra step to edit. | ||
|
||
[promote.facebook] | ||
pages = ["Creatorsgarten"] | ||
text_prompt = "generate a social media post for the following meetup:\n{event.description}" | ||
# default to edit_required: true, adds an extra step to edit. | ||
|
||
[donate.promptpay] | ||
name = "Phoomparin Mano" | ||
account = "0812390813" | ||
|
||
[forms.call_for_proposal] | ||
provider = "airtable" | ||
template = "cfp" | ||
database = "speakers" | ||
|
||
[[agenda]] | ||
name = "Registration Opens" | ||
time = 18:30:00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
require 'toml-rb' | ||
|
||
s = File.read('./event.toml') | ||
data = TomlRB.parse(s, symbolize_keys: true) | ||
|
||
event = data[:event] | ||
p event[:name] | ||
p event[:type] | ||
|
||
dates = data[:when] | ||
|
||
def merge_datetime(date, time) | ||
DateTime.new(date.year, date.month, date.day, time.hour, time.min, time.sec, time.zone) | ||
end | ||
|
||
def get_dates(dates) | ||
prefix = dates[:date] | ||
|
||
return prefix[:start], prefix[:end] unless prefix | ||
|
||
[ | ||
merge_datetime(prefix, dates[:start].to_time), | ||
merge_datetime(prefix, dates[:end].to_time) | ||
] | ||
end | ||
|
||
p get_dates(dates) |