diff options
| author | LLLL Colonq <llll@colonq> | 2024-11-26 03:23:31 -0500 |
|---|---|---|
| committer | LLLL Colonq <llll@colonq> | 2024-11-26 03:23:31 -0500 |
| commit | 0b95071fe628d91238549b062961e724088d3b8b (patch) | |
| tree | b4cf3ae960e0b52ed014ab4ba423fda1075e5d60 /src/gizmo/wasp-newspaper.el | |
| parent | 6e3c47b1ad746f0891592a97cc6ffb6e0280adbb (diff) | |
Update :4
Diffstat (limited to 'src/gizmo/wasp-newspaper.el')
| -rw-r--r-- | src/gizmo/wasp-newspaper.el | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/gizmo/wasp-newspaper.el b/src/gizmo/wasp-newspaper.el index 9723ad63..4bdb9caf 100644 --- a/src/gizmo/wasp-newspaper.el +++ b/src/gizmo/wasp-newspaper.el @@ -8,6 +8,7 @@ (require 'ht) (require 'wasp-utils) (require 'wasp-db) +(require 'wasp-glossary) (defvar w/newspaper-todays-articles nil) @@ -40,11 +41,23 @@ "a snack for friend" "59 frames per second")) +(defun w/newspaper-screenshot (k) + "Take a screenshot and pass the path of that screenshot to K." + (let ((path (s-concat (make-temp-name "/tmp/wasp-newspaper-screenshot") ".png"))) + (make-process + :name "*wasp-newspaper-screenshot*" + :buffer nil + :command `("newspaper-screenshot" ,path) + :sentinel + (lambda (_ _) + (funcall k path))))) + (w/defstruct w/newspaper-article headline author - content) + content + image) (defun w/newspaper-wrap-emoji (s) "Wrap emoji with appropriate TeX in S." @@ -79,6 +92,13 @@ "}{" (w/newspaper-wrap-emoji (w/newspaper-escape (w/newspaper-article-author a))) "}\n" + (if (w/newspaper-article-image a) + (s-concat + "\\includegraphics[width=0.8\\linewidth]{" + (w/newspaper-article-image a) + "}\\\\" + ) + "") (w/newspaper-wrap-emoji (w/newspaper-escape (w/newspaper-article-content a))) "\n\\closearticle\n")) @@ -128,7 +148,8 @@ Pass the path of the generated PDF to K." (w/make-newspaper-article :headline "omg hi oomfie" :author "Joel" - :content "\\lipsum[1]") + :content "\\lipsum[1]" + :image "/home/llll/tmp/mrgreen.png") (w/make-newspaper-article :headline "omg hi oomfie" :author "Joel" @@ -157,6 +178,7 @@ Pass the path of the generated PDF to K." (defun w/newspaper-publish () "Finalize and publish today's work-in-progress newspaper." (interactive) + (w/glossary-save) (w/db-get "newspaper:edition" (lambda (edstr) |
