From d9a43b36dc0d2ea66f3ae4a4643e56a6a87555d8 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Mon, 26 Oct 2020 00:09:32 -0400 Subject: Add more code for talk info --- 2020/submissions.org | 31 ++++++++++++++++++++----------- 1 file changed, 20 insertions(+), 11 deletions(-) (limited to '2020') diff --git a/2020/submissions.org b/2020/submissions.org index 90d82dce..3b25c486 100644 --- a/2020/submissions.org +++ b/2020/submissions.org @@ -2939,7 +2939,7 @@ SCHEDULED: <2020-11-29 Sun 16:30-17:00> (org-entry-get (point) "TARGET_TIME"))) #+end_src -#+begin_src emacs-lisp :results none +#+begin_src emacs-lisp :results none :tangle "conf.el" (defun conf/assign-ids () (interactive) (goto-char (point-min)) @@ -3064,6 +3064,12 @@ The total is written to the MIN_TIME_SUM property of this heading" (when talk (setq results (cons talk results))) (reverse results))) +(defun conf/filter-talks (list) + "Return only talk info in LIST." + (seq-filter + (lambda (talk) (eq (plist-get talk :type) 'talk)) + list)) + (defun conf/format-talk-link (talk) (and talk (format "%s" (plist-get talk :talk-id) @@ -3124,21 +3130,24 @@ conference for instructions on how to watch and participate. See you then! (write-file (format "schedule/%s.md" (plist-get o :talk-id))))) talks))) -(defun conf/generate-schedule-files () - (interactive) +(defun conf/get-talk-info-from-file (&optional filename) (with-temp-buffer - (insert-file-contents "submissions.org") + (insert-file-contents (or filename "submissions.org")) (org-mode) (org-show-all) (goto-char (point-min)) (goto-char (org-find-property "ID" "talks")) - (let ((info (conf/get-talk-info))) - (with-temp-buffer - (insert (conf/format-talk-info-as-schedule info)) - (write-file "schedule-details.txt")) - (conf/format-talk-pages info) - (with-current-buffer (find-file "schedule.org") - (org-export-to-file 'md "schedule.md"))))) + (conf/get-talk-info))) + +(defun conf/generate-schedule-files (&optional filename) + (interactive) + (let ((info (conf/get-talk-info-from-file filename))) + (with-temp-buffer + (insert (conf/format-talk-info-as-schedule info)) + (write-file "schedule-details.txt")) + (conf/format-talk-pages info) + (with-current-buffer (find-file "schedule.org") + (org-export-to-file 'md "schedule.md")))) #+end_src #+RESULTS: -- cgit v1.2.3