From 61f2d5d5e4ff576a759e00fb19c7e4aae5472222 Mon Sep 17 00:00:00 2001 From: Sacha Chua Date: Sun, 20 Dec 2020 00:54:10 -0500 Subject: Add code for adding transcript --- 2020/organizers-notebook.org | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/2020/organizers-notebook.org b/2020/organizers-notebook.org index 142ac539..f12e111a 100644 --- a/2020/organizers-notebook.org +++ b/2020/organizers-notebook.org @@ -805,7 +805,7 @@ Take advantage of provided scripts or autogenerated files *** Add transcript sections -#+begin_src emacs-lisp :eval no :tangle no +#+begin_src emacs-lisp (defvar conf/wiki-directory "~/vendor/emacsconf-wiki" "Directory that has the public conference wiki.") (defmacro conf/with-talk-info-file (talk &rest body) @@ -828,7 +828,13 @@ If TALK is not specified, do it in the current buffer." (goto-char (point-min)) (let (subtitles subed-auto-find-video all) (while (re-search-forward "subtitles=\"/\\(.+?\\)\"" nil t) - (setq subtitles (cons (match-string 1 subtitles) subtitles))) + (setq subtitles (cons (match-string 1) subtitles)) + (when (re-search-forward "^$\\|\\[View transcript" nil t) + (unless (string= (match-string 0) "[View transcript") + (insert + (if (string-match "questions" (car subtitles)) + "[View transcript for Q&A](#transcript-questions)\n" + "[View transcript](#transcript)\n"))))) (when subtitles (mapc (lambda (subtitle-file) @@ -845,13 +851,16 @@ If TALK is not specified, do it in the current buffer." (delete-region (match-beginning 1) (match-end 1))) (goto-char (point-max)) (insert (format "\n\n\n\n" subtitle-file)) + (insert (if (string-match "questions" subtitle-file) + "\n# Transcript: Q&A\n\n" + "\n# Transcript\n\n")) (save-excursion (insert "\n\n\n"))) (save-excursion (insert all))) (reverse subtitles)))))) -;; (conf/add-transcript (conf/find-talk "03")) - +;; (conf/add-transcript (conf/find-talk "03")), or call from a talk info page #+end_src + * Other useful tidbits ** Restarting ikiwiki manually -- cgit v1.2.3