From fc01255025f3270df0f275055b3c18b1cb2d00f0 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 10 Nov 2020 13:34:03 -0500 Subject: Let's try it with individual info pages that are included --- 2020/submissions.org | 32 ++++++++++++++++++++++++-------- 1 file changed, 24 insertions(+), 8 deletions(-) (limited to '2020/submissions.org') diff --git a/2020/submissions.org b/2020/submissions.org index 94b7c775..ebb17946 100644 --- a/2020/submissions.org +++ b/2020/submissions.org @@ -20,8 +20,7 @@ You can check out the Org Mode source for this page by following the [[https://e - [[elisp:conf/generate-schedule-files][Generate schedule files]] To update the information included in the individual talk page, -execute the buffer, update the talk's "Talk information" heading, and -then generate schedule files. +execute the buffer, update the talk's info/TALKID.md file. * Tables @@ -3115,6 +3114,8 @@ The total is written to the MIN_TIME_SUM property of this heading" ** Generate schedule file #+begin_src emacs-lisp :results none :eval yes :exports code :tangle "conf.el" +(defvar conf/timezones '("EST" "America/Los_Angeles" "UTC" "CET" "Asia/Singapore") "List of timezones") + (defun conf/get-talk-info () (let (talk results) (org-map-entries (lambda () @@ -3177,8 +3178,24 @@ The total is written to the MIN_TIME_SUM property of this heading" (format "%s%s%s%s" start end (conf/format-talk-link o) speakers)))) (cdr info) "\n"))) +(defun conf/filter-talks (info) + (seq-filter (lambda (o) (eq (plist-get o :type) 'talk)) info)) + +(defun conf/split-out-talk-information () + (interactive) + (let ((talks (conf/filter-talks (conf/get-talk-info-from-file)))) + (mapc (lambda (o) + (with-temp-buffer + (insert + (format "# %s\n%s\n\n%s") + (plist-get o :title) + (plist-get o :speakers) + (plist-get o :info)) + (write-file (expand-file-name (format "%s.md" (plist-get o :talk-id)) "info")))) + talks))) + (defun conf/format-talk-pages (info) - (let* ((talks (seq-filter (lambda (o) (eq (plist-get o :type) 'talk)) info)) + (let* ((talks (conf/filter-talks info)) (next-talks (cdr talks)) (prev-talks (cons nil talks))) (mapc (lambda (o) @@ -3192,9 +3209,10 @@ The total is written to the MIN_TIME_SUM property of this heading" (insert (format "[[%s title=\"%s\"]] [[%s copyright=\"Copyright © 2020 %s\"]] +%s %s -# %s\n%s \n%s\n\n%s\n\n +[[!inline pages=\"../info/%s\" raw=\"yes\"]] %s @@ -3208,7 +3226,6 @@ conference for instructions on how to watch and participate. See you then! "!meta" (plist-get o :speakers) nav-links - (plist-get o :title) (concat (format-time-string "%A, %b %e %Y, " (org-timestamp-to-time (org-timestamp-split-range timestamp))) (mapconcat (lambda (tz) @@ -3217,10 +3234,9 @@ conference for instructions on how to watch and participate. See you then! (org-timestamp-to-time (org-timestamp-split-range timestamp)) tz) (format-time-string "%l:%M %p %Z" (org-timestamp-to-time (org-timestamp-split-range timestamp t)) tz))) - '("EST" "America/Los_Angeles" "UTC" "CET" "Asia/Singapore") + conf/timezones " / ")) - (plist-get o :speakers) - (plist-get o :info) + (plist-get o :talk-id) nav-links))) (write-file (format "schedule/%s.md" (plist-get o :talk-id))))) talks))) -- cgit v1.2.3