diff options
author | Sacha Chua <sacha@sachachua.com> | 2023-10-15 21:40:46 -0400 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2023-10-15 21:40:46 -0400 |
commit | 92983544ea1448c06c57bdbe014c08aa9a41cfe9 (patch) | |
tree | 9b2f86b36b53a95a03d3ffbe69c27d8c80c0caf2 /emacsconf-publish.el | |
parent | 1fd8e1de812399fc0fa617dcc0513e15ca9378f2 (diff) | |
download | emacsconf-el-92983544ea1448c06c57bdbe014c08aa9a41cfe9.tar.xz emacsconf-el-92983544ea1448c06c57bdbe014c08aa9a41cfe9.zip |
move json publishing to emacsconf-publish
Diffstat (limited to 'emacsconf-publish.el')
-rw-r--r-- | emacsconf-publish.el | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/emacsconf-publish.el b/emacsconf-publish.el index 9d311b7..a142fd7 100644 --- a/emacsconf-publish.el +++ b/emacsconf-publish.el @@ -1209,7 +1209,6 @@ Entries are sorted chronologically, with different tracks interleaved." (interactive) (setq filename (or filename (expand-file-name "index.html" emacsconf-backstage-dir))) (let ((info (or emacsconf-schedule-draft (emacsconf-publish-prepare-for-display (emacsconf-get-talk-info)))) - (default-directory emacsconf-cache-dir) (emacsconf-main-extensions (append emacsconf-main-extensions emacsconf-publish-backstage-extensions))) (with-temp-file filename (let* ((talks @@ -1533,6 +1532,32 @@ answers without needing to listen to everything again. You can see <a href=\"htt (and (file-exists-p file) file))) extensions))))) +(defun emacsconf-publish-talks-json () + "Return JSON format with a subset of talk information." + (json-encode + (list + :talks + (mapcar + (lambda (o) + (apply + 'list + (cons :start-time (format-time-string "%FT%T%z" (plist-get o :start-time) t)) + (cons :end-time (format-time-string "%FT%T%z" (plist-get o :end-time) t)) + (mapcar + (lambda (field) + (cons field (plist-get o field))) + '(:slug :title :speakers :pronouns :pronunciation :url :track :file-prefix)))) + (emacsconf-filter-talks (emacsconf-get-talk-info)))))) + +(defun emacsconf-publish-talks-json-to-files () + "Export talk information as JSON so that we can use it in shell scripts." + (interactive) + (mapc (lambda (dir) + (when (and dir (file-directory-p dir)) + (with-temp-file (expand-file-name "talks.json" dir) + (insert (emacsconf-talks-json))))) + (list emacsconf-res-dir emacsconf-ansible-directory))) + (defun emacsconf-talks-csv () "Make a CSV of the talks. Columns are: slug,title,speakers,talk page url,video url,duration,sha." @@ -1595,7 +1620,7 @@ answers without needing to listen to everything again. You can see <a href=\"htt (emacsconf-public-talks (emacsconf-get-talk-info)))))) (insert (orgtbl-to-csv (cons '("Conference" "Slug" "Title" "Speakers" "Talk page URL" "Video URL" "Date" "Duration" "SHA" "Youtube URL" "Toobnix URL") - results) + results) nil))))) (defun emacsconf-generate-pad-template (emacsconf-info) |