mirror of
https://github.com/darkrenaissance/darkfi.git
synced 2026-01-08 22:28:12 -05:00
book: Use a script to generate the seminars page and ics links.
This commit is contained in:
1
doc/.gitignore
vendored
1
doc/.gitignore
vendored
@@ -2,3 +2,4 @@ book/*
|
||||
src/clients/cashierd_jsonrpc.md
|
||||
src/clients/darkfid_jsonrpc.md
|
||||
src/clients/faucetd_jsonrpc.md
|
||||
src/development/seminars.md
|
||||
|
||||
@@ -8,8 +8,10 @@ JSONRPC = \
|
||||
$(FAUCETD_JSONRPC)
|
||||
|
||||
all: $(JSONRPC)
|
||||
./generate_seminar_ics.py --table > src/development/seminars.md
|
||||
mdbook build
|
||||
cp -f theme/logo* book/
|
||||
./generate_seminar_ics.py --ics
|
||||
$(MAKE) -C ../ rustdoc
|
||||
cp -r ../target/doc/* book/development/
|
||||
|
||||
|
||||
144
doc/generate_seminar_ics.py
Executable file
144
doc/generate_seminar_ics.py
Executable file
@@ -0,0 +1,144 @@
|
||||
#!/usr/bin/env python3
|
||||
import uuid
|
||||
import hashlib
|
||||
from datetime import datetime
|
||||
from sys import argv
|
||||
|
||||
from prettytable import PrettyTable, HEADER
|
||||
|
||||
EVENTS = [
|
||||
{
|
||||
"start": "20230526T140000Z",
|
||||
"end": "20230526T160000Z",
|
||||
"track": "Math",
|
||||
"topic": "Elliptic Curves",
|
||||
"title": "Introduction to Elliptic Curves",
|
||||
"#": 1,
|
||||
"recording": "",
|
||||
},
|
||||
|
||||
{
|
||||
"start": "20230530T140000Z",
|
||||
"end": "20230530T160000Z",
|
||||
"track": "Math",
|
||||
"topic": "Abstract Algebra",
|
||||
"title": "Group Structure and Homomorphisms",
|
||||
"#": 1,
|
||||
"recording": "",
|
||||
},
|
||||
|
||||
{
|
||||
"start": "20230615T140000Z",
|
||||
"end": "20230615T160000Z",
|
||||
"track": "Research",
|
||||
"topic": "Consensus",
|
||||
"title": "DarkFi Consensus Algorithm and Control Theory",
|
||||
"#": 1,
|
||||
"recording": "",
|
||||
},
|
||||
|
||||
{
|
||||
"start": "20230622T140000Z",
|
||||
"end": "20230622T160000Z",
|
||||
"track": "Dev",
|
||||
"topic": "Consensus",
|
||||
"title": "Walkthrough the Consensus code",
|
||||
"#": 2,
|
||||
"recording": "",
|
||||
},
|
||||
|
||||
{
|
||||
"start": "20230629T140000Z",
|
||||
"end": "20230629T160000Z",
|
||||
"track": "Dev",
|
||||
"topic": "Event Graph",
|
||||
"title": "Walkthrough the Event Graph",
|
||||
"#": 1,
|
||||
"recording": "",
|
||||
},
|
||||
]
|
||||
|
||||
def print_table():
|
||||
x = PrettyTable()
|
||||
x.field_names = ["Date", "Track", "Topic", "#", "Title", "Calendar", "Recording"]
|
||||
x.align = "l"
|
||||
x.hrules = HEADER
|
||||
x.junction_char = "|"
|
||||
|
||||
for event in EVENTS:
|
||||
timestamp = event["start"]
|
||||
parsed = datetime.strptime(timestamp, "%Y%m%dT%H%M%SZ")
|
||||
formatted = parsed.strftime("%a %d %b %Y %H:%M UTC")
|
||||
|
||||
s = ''.join(ch if ch.isalnum() else '' for ch in event["title"])
|
||||
ics_file = f"{event['start']}_{s}.ics"
|
||||
|
||||
x.add_row([
|
||||
formatted,
|
||||
event["track"],
|
||||
event["topic"],
|
||||
event["#"],
|
||||
event["title"],
|
||||
f"[dl]({ics_file})",
|
||||
f"[dl]({event['recording']})",
|
||||
])
|
||||
|
||||
print("# Developer Seminars\n")
|
||||
print("Weekly seminars on DarkFi, cryptography, code and other topics.")
|
||||
print("Each seminar is usually 2 hours long\n")
|
||||
print(x)
|
||||
print("\nThe link for calls is")
|
||||
print("[meet.jit.si/darkfi-seminar](https://meet.jit.si/darkfi-seminar).")
|
||||
print("\nFor the math seminars, we use a collaborative whiteboard called")
|
||||
print("[therapy](https://github.com/narodnik/therapy) that we made.")
|
||||
print("The canvas will also be shared on Jitsi calls.\n")
|
||||
print("Videos will be uploaded online and linked here.")
|
||||
print("Join [our chat](https://darkrenaissance.github.io/darkfi/misc/ircd/ircd.html")
|
||||
print("for more info. Links and text chat will happen there during the calls.")
|
||||
|
||||
|
||||
def print_ics():
|
||||
for event in EVENTS:
|
||||
ics = []
|
||||
ics.append("BEGIN:VCALENDAR")
|
||||
ics.append("VERSION:2.0")
|
||||
ics.append("PRODID:-//dark.fi//Seminars//EN")
|
||||
ics.append("BEGIN:VEVENT")
|
||||
ics.append(f"SUMMARY:DarkFi Seminar: {event['title']}")
|
||||
m = hashlib.md5()
|
||||
m.update((event["start"] + event["title"]).encode("utf-8"))
|
||||
ics.append(f"UID:{uuid.UUID(m.hexdigest())}")
|
||||
ics.append(f"DTSTART:{event['start']}")
|
||||
ics.append(f"DTEND:{event['end']}")
|
||||
ics.append(f"DTSTAMP:{event['start']}")
|
||||
ics.append(f"CATEGORIES:{event['topic']}")
|
||||
ics.append("URL:https://meet.jit.si/darkfi-seminar")
|
||||
ics.append("END:VEVENT")
|
||||
ics.append("END:VCALENDAR")
|
||||
|
||||
s = ''.join(ch if ch.isalnum() else '' for ch in event["title"])
|
||||
ics_file = f"{event['start']}_{s}.ics"
|
||||
|
||||
with open(f"book/development/{ics_file}", "w") as f:
|
||||
f.write('\n'.join(ics))
|
||||
f.write('\n')
|
||||
|
||||
|
||||
|
||||
def usage():
|
||||
print("usage: Use --ics or --table as a flag")
|
||||
exit(1)
|
||||
|
||||
if __name__ == "__main__":
|
||||
if len(argv) != 2:
|
||||
usage()
|
||||
|
||||
if argv[1] == "--ics":
|
||||
print_ics()
|
||||
exit(0)
|
||||
|
||||
if argv[1] == "--table":
|
||||
print_table()
|
||||
exit(0)
|
||||
|
||||
main()
|
||||
@@ -1,23 +0,0 @@
|
||||
# Developer Seminars
|
||||
|
||||
Weekly seminars on DarkFi, cryptography, code and other topics. Each seminar is 2 hours long.
|
||||
|
||||
| Date | Track | Topic | # | Title | Notes |
|
||||
|----------------------|----------|------------------|---|---------------------------------------------|-------|
|
||||
| 16:00 CET Fri 26 May | Math | elliptic curves | 1 | Introduction to Elliptic Curves | |
|
||||
| 16:00 CET Tue 30 May | Math | abstract algebra | 1 | Group Structure and Homomorphisms | |
|
||||
| 16:00 CET Thu 15 Jun | Research | consensus | 1 | DarkFi Consensus Algorithm & Control Theory | |
|
||||
| 16:00 CET Thu 22 Jun | Dev | consensus | 2 | Walkthrough the Consensus Code | |
|
||||
| 16:00 CET Thu 29 Jun | Dev | event graph | 1 | Walkthrough the Event Graph | |
|
||||
|
||||
The link for calls is
|
||||
[meet.jit.si/darkfi-seminar](https://meet.jit.si/darkfi-seminar).
|
||||
|
||||
For the math seminars, we use a collaborative whiteboard called
|
||||
[therapy](https://github.com/narodnik/therapy) that we made.
|
||||
The canvas will also be shared on jitsi calls.
|
||||
|
||||
Videos will be uploaded online and linked here.
|
||||
Join [our chat](https://darkrenaissance.github.io/darkfi/misc/ircd/ircd.html)
|
||||
for more info. Links and text chat will happen there during the calls.
|
||||
|
||||
Reference in New Issue
Block a user