From 016e48cfd3146ed32c55ce331d880d01cf5af802 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Mon, 17 Oct 2022 17:45:19 -0400 Subject: Add link to main pad --- emacsconf-pad.el | 50 +++++++++++++++++++++++++++++----- emacsconf-publish.el | 76 ++++++++++++++++++++++++++++++---------------------- 2 files changed, 88 insertions(+), 38 deletions(-) diff --git a/emacsconf-pad.el b/emacsconf-pad.el index 2c88ef8..dd00802 100644 --- a/emacsconf-pad.el +++ b/emacsconf-pad.el @@ -136,9 +136,14 @@ You can find it in $ETHERPAD_PATH/APIKEY.txt" (append (list :base-url emacsconf-base-url :channel (concat "emacsconf-" (plist-get (emacsconf-get-track (plist-get o :track)) :id)) :bbb-info - (if (plist-get o :bbb-room) - (concat "
Q&A room: ${bbb-room}
") - "") + (cond + ((plist-get o :bbb-room) + (concat "
Q&A room: ${bbb-room}
")) + ((null (plist-get o :q-and-a)) + "
Q&A: none
") + ((string-match "live" (plist-get o :q-and-a)) + "
Q&A room: to be announced
") + (t "
Q&A: IRC
")) :next-talk-list (if (plist-get o :next-talks) (concat "
Next talks:\n
")))) (defun emacsconf-pad-prepopulate-talk-pad (o) (interactive (list (let ((info (emacsconf-include-next-talks (emacsconf-get-talk-info) emacsconf-pad-number-of-next-talks))) (emacsconf-complete-talk-info info)))) diff --git a/emacsconf-publish.el b/emacsconf-publish.el index f5225a0..e141e9b 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -40,14 +40,15 @@ (defcustom emacsconf-public-media-directory nil "Can be over TRAMP" :type 'string :group 'emacsconf) (defcustom emacsconf-protected-media-directory nil "Can be over TRAMP" :type 'string :group 'emacsconf) -(defun emacsconf-update-talk (info) +(defun emacsconf-update-talk (talk) "Publish the schedule page and the page for this talk." (interactive (list (emacsconf-complete-talk-info))) (when (functionp 'emacsconf-upcoming-insert-or-update) (emacsconf-upcoming-insert-or-update)) - (emacsconf-generate-before-page info) - (emacsconf-generate-after-page info) - (emacsconf-generate-main-schedule)) + (let ((info (emacsconf-get-talk-info))) + (emacsconf-generate-before-page talk info) + (emacsconf-generate-after-page talk info) + (emacsconf-generate-main-schedule info))) (defun emacsconf-publish-add-talk () "Add the current talk to the wiki." @@ -366,20 +367,50 @@ resources." (plist-get talk :public-email) "emacsconf-org-private@gnu.org")))) -(defun emacsconf-generate-before-page (talk) +(defun emacsconf-generate-before-page (talk &optional info) "Info included before the abstract." (interactive (list (emacsconf-get-talk-info-for-subtree))) + (setq info (or info (emacsconf-get-talk-info))) (with-temp-file (expand-file-name (format "%s-before.md" (plist-get talk :slug)) (expand-file-name "info" (expand-file-name emacsconf-year emacsconf-directory))) (insert "\n") (when (eq emacsconf-publishing-phase 'schedule) (insert "\n" + (format "
\n" (plist-get talk :slug)) + (let* ((width 800) (height 150) + (talk-date (format-time-string "%Y-%m-%d" (plist-get talk :start-time) emacsconf-timezone)) + (start (date-to-time (concat talk-date "T" emacsconf-schedule-start-time emacsconf-timezone-offset))) + (end (date-to-time (concat talk-date "T" emacsconf-schedule-end-time emacsconf-timezone-offset))) + svg) + (with-temp-buffer + (setq svg (emacsconf-schedule-svg-day + (svg-create width height) + (format-time-string "%A" (plist-get talk :start-time) emacsconf-timezone) + width height + start end + (emacsconf-by-track + (seq-filter (lambda (o) (string= (format-time-string "%Y-%m-%d" (plist-get o :start-time) emacsconf-timezone) + talk-date)) + info)))) + (mapc (lambda (node) + (let ((rect (car (dom-by-tag node 'rect)))) + (if (string= (dom-attr node 'data-slug) (plist-get talk :slug)) + (progn + (dom-set-attribute rect 'opacity "0.8") + (dom-set-attribute rect 'stroke-width "3") + (dom-set-attribute (car (dom-by-tag node 'text)) 'font-weight "bold")) + (dom-set-attribute rect 'opacity "0.5")))) + (dom-by-tag svg 'a)) + (svg-print svg) + (buffer-string))) + "\n
\n" + "\n" (emacsconf-format-talk-schedule-info talk) "\n")) ;; Contact information ;; (insert "\n\n" (emacsconf-format-email-questions-and-comments talk) "\n") (insert ""))) -(defun emacsconf-generate-after-page (talk &optional info elem) +(defun emacsconf-generate-after-page (talk &optional info) "Info included before the abstract." (interactive (list (emacsconf-get-talk-info-for-subtree))) (setq info (or info (emacsconf-get-talk-info))) @@ -390,29 +421,7 @@ resources." "\n" "\n\n" (emacsconf-format-email-questions-and-comments talk) "\n" - (format "
\n" (plist-get talk :slug)) - (let* ((width 800) (height 150) - (talk-date (format-time-string "%Y-%m-%d" (plist-get talk :start-time) emacsconf-timezone)) - (start (date-to-time (concat talk-date "T" emacsconf-schedule-start-time emacsconf-timezone-offset))) - (end (date-to-time (concat talk-date "T" emacsconf-schedule-end-time emacsconf-timezone-offset))) - (emacsconf-schedule-svg-modify-functions - (append - emacsconf-schedule-svg-modify-functions - (list (lambda (o node &optional parent) - (when (string= (plist-get o :slug) (plist-get talk :slug)) - (dom-set-attribute node 'stroke-width "3"))))))) - (with-temp-buffer - (svg-print (emacsconf-schedule-svg-day - (svg-create width height) - (format-time-string "%A" (plist-get talk :start-time) emacsconf-timezone) - width height - start end - (emacsconf-by-track - (seq-filter (lambda (o) (string= (format-time-string "%Y-%m-%d" (plist-get o :start-time) emacsconf-timezone) - talk-date)) - info)))) - (buffer-string))) - "\n
\n\n"))) + "\n\n\n"))) (defun emacsconf-sort-by-track-then-schedule (a b) ;; Gen,Dev; then by time @@ -462,8 +471,10 @@ Back to the [[talks]] \n" (let* ((talks (seq-remove (lambda (o) (string= (plist-get o :status) "CANCELLED")) (sort (emacsconf-filter-talks info) #'emacsconf-sort-by-scheduled)))) (emacsconf-generate-nav-pages talks) - (mapc #'emacsconf-generate-before-page talks) - (mapc (lambda (o) (emacsconf-generate-after-page o talks)) talks)))) + (mapc (lambda (o) + (emacsconf-generate-before-page o talks) + (emacsconf-generate-after-page o talks)) + talks)))) (defun emacsconf-generate-talks-page (emacsconf-info) (interactive "p") @@ -1218,7 +1229,8 @@ Entries are sorted chronologically, with different tracks interleaved." (plist-put track :year emacsconf-year) (plist-put track :stream (concat emacsconf-stream-base (plist-get track :id) ".webm")) (plist-put track :480p (concat emacsconf-stream-base (plist-get track :id) "-480p.webm")) - (plist-put track :webchat (concat emacsconf-chat-base "?join=emacsconf,emacsconf-" (plist-get track :id))) + (plist-put track :webchat-channels (concat "emacsconf,emacsconf-" (plist-get track :id))) + (plist-put track :webchat (concat emacsconf-chat-base "?join=" (plist-get track :webchat-channels))) (plist-put track :channel (concat "#emacsconf-" (plist-get track :id)))) emacsconf-tracks) (let* ((info (sort (emacsconf-get-talk-info) #'emacsconf-sort-by-scheduled)) -- cgit v1.2.3