From 46a027d939bf17c6f002c2a5b49cbf62e958c254 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Tue, 25 Jul 2023 10:38:21 -0400 Subject: Remove maybe talks from publishing --- emacsconf-publish.el | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) (limited to 'emacsconf-publish.el') diff --git a/emacsconf-publish.el b/emacsconf-publish.el index 2f46283..d70524f 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -411,7 +411,7 @@ [[${meta} copyright=\"Copyright © ${year} ${speakers}\"]] [[!inline pages=\"internal(${year}/info/${slug}-nav)\" raw=\"yes\"]] - + \n # ${title} @@ -428,6 +428,17 @@ ${abstract-md} ${categories} ")))))) +(defun emacsconf-publish-talk-p (talk) + "Return non-nil if the talk is ready to be published. +Talks that are pending review will not be published yet." + (pcase (plist-get talk :status) + ('nil nil) + ("TODO" nil) + ("TO_REVIEW" nil) + ("TO_ACCEPT" nil) + ("CANCELLED" nil) + (_ t))) + (defun emacsconf-publish-talk-pages (emacsconf-info force) (interactive (list (emacsconf-get-talk-info) (> (prefix-numeric-value current-prefix-arg) 1))) "Populate year/talks/*.md files. @@ -435,7 +446,8 @@ These should include the nav and schedule files, which will be rewritten as needed. After they are generated, they should be all right to manually edit to include things like additional resources." - (mapc (lambda (o) (emacsconf-publish-talk-page o force)) (emacsconf-filter-talks emacsconf-info))) + (mapc (lambda (o) (emacsconf-publish-talk-page o force)) + (emacsconf-filter-talks emacsconf-info))) (defun emacsconf-wiki-talk-resources (o) (setq o (append (list :format 'wiki @@ -753,7 +765,7 @@ Back to the [[talks]] \n" (defun emacsconf-publish-info-pages (&optional info) "Populate year/info/*-nav, -before, and -after files." (interactive) - (setq info (or info (emacsconf-get-talk-info))) + (setq info (or info (seq-filter 'emacsconf-publish-talk-p (emacsconf-get-talk-info)))) (emacsconf-publish-with-wiki-change (let* ((talks (seq-remove (lambda (o) (string= (plist-get o :status) "CANCELLED")) (sort (emacsconf-filter-talks info) #'emacsconf-sort-by-scheduled)))) @@ -774,12 +786,12 @@ Back to the [[talks]] \n" (emacsconf-publish-before-page o info)) info))) -(defun emacsconf-publish-talks-page (emacsconf-info) - (interactive "p") - (let ((info emacsconf-info)) - (with-temp-buffer - (find-file "talk-details.md") - (erase-buffer) +(defun emacsconf-publish-talks-page (&optional emacsconf-info) + (interactive) + (let ((info (or emacsconf-info + (seq-filter #'emacsconf-publish-talk-p + (emacsconf-get-talk-info))))) + (with-temp-file (expand-file-name "talk-details.md" (expand-file-name emacsconf-year emacsconf-directory)) (insert (format "%s
DurationTitleSpeakers
" (mapconcat (lambda (o) @@ -789,9 +801,7 @@ Back to the [[talks]] \n" (plist-get o :duration) (emacsconf-format-talk-link o) (plist-get o :speakers)))) - info "\n"))) - (save-buffer)))) - + info "\n")))))) (defun emacsconf-generate-main-schedule-with-tracks (&optional info) (interactive) @@ -2389,8 +2399,14 @@ This video is available under the terms of the Creative Commons Attribution-Shar (emacsconf-publish-backstage-index)) (defun emacsconf-publish-process-answers-chapters (file) - (interactive (list (read-file-name "Chapters file: "))) + (interactive (list + (if (string-match "chapters" (buffer-file-name)) + (buffer-file-name) + (read-file-name "Chapters file: ")))) (let ((slug (emacsconf-get-slug-from-string (file-name-nondirectory file)))) + (emacsconf-with-talk-heading slug + (when (string= (org-get-todo-state) "TO_INDEX_QA") + (org-todo "TO_CAPTION_QA"))) (unless (string= (expand-file-name file) (expand-file-name (file-name-nondirectory file) emacsconf-cache-dir)) -- cgit v1.2.3