diff options
author | Sacha Chua <sacha@sachachua.com> | 2022-12-09 22:46:25 -0500 |
---|---|---|
committer | Sacha Chua <sacha@sachachua.com> | 2022-12-09 22:46:25 -0500 |
commit | c1a32ad031d6a5fc7dc644fcfc442c3c9a6e107c (patch) | |
tree | da21e24a057dfde16817ab01fa89fd1924d0e84b /emacsconf-extract.el | |
parent | 923de3f273dd82f52072cffcb9a84737fc287f7f (diff) | |
download | emacsconf-el-c1a32ad031d6a5fc7dc644fcfc442c3c9a6e107c.tar.xz emacsconf-el-c1a32ad031d6a5fc7dc644fcfc442c3c9a6e107c.zip |
code for adding questions to the Q&A transcript
Diffstat (limited to 'emacsconf-extract.el')
-rw-r--r-- | emacsconf-extract.el | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/emacsconf-extract.el b/emacsconf-extract.el index 77c8d0b..e158764 100644 --- a/emacsconf-extract.el +++ b/emacsconf-extract.el @@ -270,5 +270,40 @@ (unless (string= (or questions "") "") (insert "## Questions and answers\n\n" questions "\n\n")) ))) + +(defun emacsconf-extract-question-headings (slug) + (with-temp-buffer + (insert-file-contents + (expand-file-name + (concat slug ".md") + (expand-file-name "talks" + (expand-file-name emacsconf-year emacsconf-directory)))) + (goto-char (point-min)) + (let (results) + (while (re-search-forward "^-[ \t]+Q:[ ]*" nil t) + (setq results + (cons + (string-trim + (replace-regexp-in-string + "[\n \t ]+" " " + (replace-regexp-in-string + "\\\\" + "" + (buffer-substring + (point) + (and (re-search-forward "^[ \t]+-\\|^[ \t]+*$" nil t) + (match-beginning 0)))))) + results))) + (nreverse results)))) +;; (emacsconf-extract-question-headings "asmblox") + +(defun emacsconf-extract-insert-note-with-question-heading (question) + (interactive + (list + (completing-read + "Question: " + (emacsconf-extract-question-headings + (emacsconf-get-slug-from-string (file-name-base (buffer-file-name))))))) + (insert "NOTE " question "\n\n")) (provide 'emacsconf-extract) ;;; emacsconf-extract.el ends here |