From 4cc3841a07ba8843373c979b61c3ca31640284ac Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Thu, 6 Oct 2022 14:03:47 -0400 Subject: Replace --- emacsconf-publish.el | 60 +++++++++++++++++++++++++++++++++++----------------- 1 file changed, 41 insertions(+), 19 deletions(-) diff --git a/emacsconf-publish.el b/emacsconf-publish.el index 74965a0..019cb91 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -384,10 +384,25 @@ resources." (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)))) + (emacsconf-active-talks + (sort (emacsconf-filter-talks (emacsconf-get-talk-info)) + (if (eq emacsconf-publishing-phase 'schedule) + #'emacsconf-sort-by-scheduled + (lambda (a b) + ;; Gen,Dev; then by time + (cond + ((string< (plist-get a :track) + (plist-get b :track)) nil) + ((string< (plist-get a :track) + (plist-get b :track)) t) + ((time-less-p (plist-get a :start-time) + (plist-get b :start-time)) t) + (t nil)))))))) (let* ((next-talks (cdr talks)) - (prev-talks (cons nil talks))) + (prev-talks (cons nil talks)) + (label (if (eq emacsconf-publishing-phase 'schedule) + "time" + "track"))) (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 @@ -396,12 +411,15 @@ resources." (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 (concat "Back to the [[talks]] \n" - (if prev-talk (format "Previous: %s \n" prev-talk) "") - (if next-talk (format "Next: %s \n" next-talk) "") + (insert (concat "\n
+Back to the [[talks]] \n" + (if prev-talk (format "Previous by %s: %s \n" label prev-talk) "") + (if next-talk (format "Next by %s: %s \n" label next-talk) "") (if (plist-get o :track) ; tagging doesn't work here because ikiwiki will list the nav page - (format "Track: %s \n" (plist-get o :track)) - "")))))))) + (format "Track: %s \n" (plist-get o :track) (plist-get o :track)) + "") + "
+"))))))) (defun emacsconf-generate-info-pages (&optional info) (interactive) @@ -461,9 +479,12 @@ resources." (sequence (emacsconf-schedule-get-subsequence info start end)) (sat (cdr (emacsconf-schedule-get-subsequence sequence "Saturday" "Sunday"))) (sun (cdr (emacsconf-schedule-get-subsequence sequence "Sunday")))) - (format "\n\n\n## %s\n\n%s\n\n" + (format "\n\n\n +
+## %s\n\n%s\n
\n" id label + label (mapconcat (lambda (section) (let ((section-id (elt section 0)) @@ -522,10 +543,12 @@ resources." (or info (emacsconf-get-talk-info)))) #'emacsconf-sort-by-scheduled))) (concat - "Jump to development talks\n\n# General talks\n" + "Jump to development talks\n\n

General talks

\n" (emacsconf-format-main-schedule (seq-filter (lambda (o) (string= (plist-get o :track) "General")) sorted)) - "\n\n# Development talks\n" + "\n\n
+

Development talks

+
\n" (emacsconf-format-main-schedule (seq-filter (lambda (o) (string= (plist-get o :track) "Development")) sorted)))) (let* ((by-day (seq-group-by (lambda (o) @@ -578,9 +601,8 @@ resources." (defun emacsconf-format-talk-link (talk) (and talk (if (plist-get talk :slug) - (format "%s" - emacsconf-year - (plist-get talk :slug) + (format "%s" + (plist-get talk :url) (plist-get talk :title)) (plist-get talk :title)))) @@ -606,9 +628,7 @@ resources." (defun emacsconf-format-main-schedule (info) (let* ((cancelled (seq-filter (lambda (o) (string= (plist-get o :status) "CANCELLED")) info))) (concat - (format - "
\n" - (format-time-string "%FT%T%z" (plist-get (car info) :start-time) t)) + "
\n" (mapconcat (lambda (o) (let* ((status (pcase (plist-get o :status) @@ -621,9 +641,11 @@ resources." (let ((result "") (attrs (list :title (plist-get o :title) - :url (plist-get o :url) + :url (concat "/" (plist-get o :url)) :speakers (plist-get o :speakers) - :track (plist-get o :track) + :track (if (eq emacsconf-publishing-phase 'program) + nil + (plist-get o :track)) :slug (plist-get o :slug) :status (if (eq emacsconf-publishing-phase 'program) nil -- cgit v1.2.3