summaryrefslogtreecommitdiffstats
path: root/emacsconf-publish.el
diff options
context:
space:
mode:
authorSacha Chua <sacha@sachachua.com>2022-09-30 12:10:19 -0400
committerSacha Chua <sacha@sachachua.com>2022-09-30 12:10:19 -0400
commit94f1d4c4fef71b5012eefcce57e5ca781134ab92 (patch)
treee3ec59fdb1dad52f4980fed7f824c6568791b42d /emacsconf-publish.el
parent828dc02ef5fd878e95c2b5e5ad56d32a4fd08f27 (diff)
downloademacsconf-el-94f1d4c4fef71b5012eefcce57e5ca781134ab92.tar.xz
emacsconf-el-94f1d4c4fef71b5012eefcce57e5ca781134ab92.zip
More tweaks
Diffstat (limited to 'emacsconf-publish.el')
-rw-r--r--emacsconf-publish.el105
1 files changed, 69 insertions, 36 deletions
diff --git a/emacsconf-publish.el b/emacsconf-publish.el
index b3fed02..1031365 100644
--- a/emacsconf-publish.el
+++ b/emacsconf-publish.el
@@ -44,7 +44,7 @@
"Publish the schedule page and the page for this talk."
(interactive)
(emacsconf-upcoming-insert-or-update)
- (emacsconf-generate-schedule-page (emacsconf-get-talk-info-for-subtree))
+ (emacsconf-generate-before-page (emacsconf-get-talk-info-for-subtree))
(emacsconf-generate-main-schedule))
(defun emacsconf-update-conf-html ()
@@ -205,16 +205,23 @@ ${chapter-list}
"")))
"<div class=\"files resources\"><ul>${video-download}${other-files}${toobnix-info}</ul></div>"))))
-(when (featurep 'memoize)
- (memoize #'compile-media-get-file-duration-ms))
+(condition-case nil
+ (when (featurep 'memoize)
+ (memoize #'compile-media-get-file-duration-ms))
+ nil)
+
+(defun emacsconf-format-public-email (o &optional email)
+ (format "[%s](mailto:%s?subject=%s)"
+ (or email (plist-get o :public-email))
+ (or email (plist-get o :public-email))
+ (url-hexify-string (format "Comment for EmacsConf 2022 %s: %s" (plist-get o :slug) (plist-get o :title)))))
(defun emacsconf-format-speaker-info (o)
(let ((extra-info (mapconcat #'identity
(delq nil (list
- (plist-get o :pronunciation)
- (plist-get o :pronouns)
- (when (plist-get o :public-email)
- (replace-regexp-in-string "@" " at " (plist-get o :public-email)))))
+ (unless (string= (plist-get o :pronunciation) "nil") (plist-get o :pronunciation))
+ (unless (string= (plist-get o :pronouns) "nil") (plist-get o :pronouns))
+ (when (plist-get o :public-email) (format "[%s]"))))
", ")))
(concat (plist-get o :speakers)
(if (> (length extra-info) 0)
@@ -234,8 +241,13 @@ ${chapter-list}
(emacsconf-replace-plist-in-string
(emacsconf-convert-talk-abstract-to-markdown
(append o (list
+ :speaker-info (emacsconf-format-speaker-info talk)
:meta "!meta"
- :speaker-info (emacsconf-format-speaker-info o))))
+ :categories (if (plist-get o :categories)
+ (mapconcat (lambda (o) (format "[[!taglink %s]]" o))
+ (plist-get o :categories)
+ " ")
+ ""))))
"[[${meta} title=\"${title}\"]]
[[${meta} copyright=\"Copyright &copy; ${year} ${speakers}\"]]
[[!inline pages=\"internal(${year}/info/${slug}-nav)\" raw=\"yes\"]]
@@ -246,17 +258,15 @@ ${chapter-list}
# ${title}
${speaker-info}
-<!-- tags go here like !taglink CategoryOrgMode -->
+[[!inline pages=\"internal(${year}/info/${slug}-before)\" raw=\"yes\"]]
${abstract-md}
-# Links
-
-# Discussion
-
-[[!inline pages=\"internal(${year}/info/${slug}-schedule)\" raw=\"yes\"]]
+[[!inline pages=\"internal(${year}/info/${slug}-after)\" raw=\"yes\"]]
[[!inline pages=\"internal(${year}/info/${slug}-nav)\" raw=\"yes\"]]
+
+${categories}
"))))))
(defun emacsconf-generate-talk-pages (emacsconf-info force)
@@ -299,7 +309,6 @@ resources."
(timestamp (org-timestamp-from-string (plist-get o :scheduled))))
(concat
"[[!toc ]]\n"
-
(if (plist-get o :q-and-a) (format "Q&A: %s \n" (plist-get o :q-and-a)) "")
(if (member emacsconf-publishing-phase '(program schedule)) (concat "Status: " (plist-get o :status-label) " \n") "")
"Duration: " (or (plist-get o :video-duration)
@@ -324,36 +333,60 @@ resources."
(if (plist-get o :public) (emacsconf-wiki-talk-resources o) "")
"\n# Description\n\n")))
-(defun emacsconf-generate-schedule-page (talk)
+(defun emacsconf-format-email-questions-and-comments (talk)
+ (format "Questions or comments? Please e-mail %s"
+ (emacsconf-format-public-email talk (or (plist-get talk :public-email) "emacsconf-org-private@gnu.org"))))
+
+(defun emacsconf-generate-before-page (talk)
+ "Info included before the abstract."
(interactive (list (emacsconf-get-talk-info-for-subtree)))
- (with-temp-file (expand-file-name (format "%s-schedule.md" (plist-get talk :slug))
+ (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)))
-
- (unless (eq emacsconf-publishing-phase 'process)
- (insert
- "<!-- Automatically generated by emacsconf-generate-schedule-page -->\n\n"
- (emacsconf-format-talk-schedule-info talk) "\n"))))
-
-(defun emacsconf-generate-info-pages ()
- (interactive)
- "Populate year/info/*-nav and *-schedule.md files."
- (let* ((talks (seq-remove (lambda (o) (string= (plist-get o :status) "CANCELLED"))
- (emacsconf-filter-talks (emacsconf-get-talk-info))))
- (next-talks (cdr talks))
+ (insert "<!-- Automatically generated by emacsconf-generate-before-page -->\n")
+ (when (eq emacsconf-publishing-phase 'schedule)
+ (insert "\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)
+ "Info included before the abstract."
+ (interactive (list (emacsconf-get-talk-info-for-subtree)))
+ ;; Contact information
+ (with-temp-file (expand-file-name (format "%s-after.md" (plist-get talk :slug))
+ (expand-file-name "info" (expand-file-name emacsconf-year emacsconf-directory)))
+ (insert "<!-- Automatically generated by emacsconf-generate-after-page -->\n")
+ (insert "\n\n"
+ (emacsconf-format-email-questions-and-comments talk) "\n")
+ (insert "<!-- End of emacsconf-generate-after-page -->\n")))
+
+(defun emacsconf-generate-nav-pages (&optional talks)
+ (interactive (list
+ (seq-remove (lambda (o) (string= (plist-get o :status) "CANCELLED"))
+ (sort (emacsconf-filter-talks (emacsconf-get-talk-info)) #'emacsconf-sort-by-scheduled))))
+ (let* ((next-talks (cdr talks))
(prev-talks (cons nil talks)))
(unless (file-directory-p (expand-file-name "info" (expand-file-name emacsconf-year emacsconf-directory)))
(mkdir (expand-file-name "info" (expand-file-name emacsconf-year emacsconf-directory))))
(while talks
(let* ((o (pop talks))
(next-talk (emacsconf-format-talk-link (pop next-talks)))
- (prev-talk (emacsconf-format-talk-link (pop prev-talks)))
- (nav-links (format "Back to the [[talks]] \n%s%s"
- (if prev-talk (format "Previous: %s \n" prev-talk) "")
- (if next-talk (format "Next: %s \n" next-talk) ""))))
+ (prev-talk (emacsconf-format-talk-link (pop prev-talks))))
(with-temp-file (expand-file-name (format "%s-nav.md" (plist-get o :slug))
(expand-file-name "info" (expand-file-name emacsconf-year emacsconf-directory)))
- (insert nav-links))
- (emacsconf-generate-schedule-page o)))))
+ (insert (format "Back to the [[talks]] \n%s%s"
+ (if prev-talk (format "Previous: %s \n" prev-talk) "")
+ (if next-talk (format "Next: %s \n" next-talk) ""))))))))
+
+(defun emacsconf-generate-info-pages ()
+ (interactive)
+ "Populate year/info/*-nav, -before, and -after files."
+ (let* ((talks (seq-remove (lambda (o) (string= (plist-get o :status) "CANCELLED"))
+ (sort (emacsconf-filter-talks (emacsconf-get-talk-info)) #'emacsconf-sort-by-scheduled))))
+ (emacsconf-generate-nav-pages talks)
+ (mapc #'emacsconf-generate-before-page talks)
+ (mapc #'emacsconf-generate-after-page talks)))
(defun emacsconf-generate-talks-page (emacsconf-info)
(interactive "p")
@@ -378,7 +411,7 @@ resources."
(defun emacsconf-generate-main-schedule (&optional filename)
(interactive)
(with-temp-file (expand-file-name "schedule-details.md" (expand-file-name emacsconf-year emacsconf-directory))
- (insert (emacsconf-format-main-schedule (emacsconf-get-talk-info)))))
+ (insert (emacsconf-format-main-schedule (sort (emacsconf-get-talk-info) #'emacsconf-sort-by-scheduled)))))
(defun emacsconf-format-talk-link (talk)
(and talk (if (plist-get talk :slug)