summaryrefslogtreecommitdiffstats
path: root/emacsconf-publish.el
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-10-17 17:45:19 -0400
committerSacha Chua <sacha@sachachua.com>2022-10-17 17:45:19 -0400
commit016e48cfd3146ed32c55ce331d880d01cf5af802 (patch)
treea9b60a0e1e9437f5c03a2960b1a4f5e025d0e0f5 /emacsconf-publish.el
parentca7e367a5219af1dce4c8aea1bf2c2fc7a65e545 (diff)
downloademacsconf-el-016e48cfd3146ed32c55ce331d880d01cf5af802.tar.xz
emacsconf-el-016e48cfd3146ed32c55ce331d880d01cf5af802.zip
Add link to main pad
Diffstat (limited to 'emacsconf-publish.el')
-rw-r--r--emacsconf-publish.el76
1 files changed, 44 insertions, 32 deletions
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 "<!-- Automatically generated by emacsconf-generate-before-page -->\n")
(when (eq emacsconf-publishing-phase 'schedule)
(insert "\n"
+ (format "<div class=\"schedule-in-context schedule-svg-container\" data-slug=\"%s\">\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</div>\n"
+ "\n"
(emacsconf-format-talk-schedule-info talk) "\n"))
;; Contact information
;; (insert "\n\n" (emacsconf-format-email-questions-and-comments talk) "\n")
(insert "<!-- End of emacsconf-generate-before-page -->")))
-(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."
"<!-- Automatically generated by emacsconf-generate-after-page -->\n"
"\n\n"
(emacsconf-format-email-questions-and-comments talk) "\n"
- (format "<div class=\"schedule-in-context schedule-svg-container\" data-slug=\"%s\">\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</div>\n<!-- End of emacsconf-generate-after-page -->\n")))
+ "\n\n<!-- End of emacsconf-generate-after-page -->\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))