diff options
author | Spencer Williams <spnw@plexwave.org> | 2025-07-11 14:02:53 -0400 |
---|---|---|
committer | Spencer Williams <spnw@plexwave.org> | 2025-07-11 14:24:04 -0400 |
commit | eabbaa6ca9d046845c2ea3d860456863a3782869 (patch) | |
tree | f8eb1847f78f58b2aa96ed2fb69f67e9924afaab | |
parent | 5c55ec7fcb338306188dac3454782a190205152e (diff) |
Rename and document helpers
-rw-r--r-- | lisp/seam-export.el | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/lisp/seam-export.el b/lisp/seam-export.el index 6f75a21..8cab0ab 100644 --- a/lisp/seam-export.el +++ b/lisp/seam-export.el @@ -209,7 +209,7 @@ notes)." :with-smart-quotes t :with-toc nil)) -(defmacro seam-export--to-string (&rest body) +(defmacro seam-export--export-to-html-string (&rest body) (declare (indent 0)) (let ((buf (gensym))) `(let ((,buf (generate-new-buffer " *seam-export*"))) @@ -223,7 +223,7 @@ notes)." (buffer-string))) (kill-buffer ,buf))))) -(defmacro seam-export--to-plain-string (&rest body) +(defmacro seam-export--export-to-text-string (&rest body) (declare (indent 0)) (let ((buf (gensym))) `(let ((,buf (generate-new-buffer " *seam-export*"))) @@ -238,22 +238,23 @@ notes)." (buffer-string))) (kill-buffer ,buf))))) -;;; Some HACK-ery to get fully escaped and smartquote-ized string. -(defun seam-export--escape-string (s) +(defun seam-export--org-to-html (s) + "Convert single-line Org string to HTML via Org exporter." (string-remove-prefix "<p>\n" (string-remove-suffix "</p>\n" - (seam-export--to-string + (seam-export--export-to-html-string (insert s))))) -(defun seam-export--smartquotize-string (s) +(defun seam-export--org-to-text (s) + "Convert single-line Org string to plain text via Org exporter." (string-chop-newline - (seam-export--to-plain-string + (seam-export--export-to-text-string (insert s)))) (defun seam-export--generate-backlinks (file) - (seam-export--to-string + (seam-export--export-to-html-string (let ((files (cl-sort (let ((seam--subset seam-export--types)) (cl-loop for x in (seam-get-links-to-file file) @@ -275,10 +276,10 @@ notes)." (mustache-render seam-export--template `(("title" . - ,(seam-export--smartquotize-string + ,(seam-export--org-to-text (seam-get-title-from-file note-file))) ("raw-title" . - ,(seam-export--escape-string + ,(seam-export--org-to-html (seam-get-title-from-file note-file))) ("modified" . ,(format-time-string @@ -291,7 +292,7 @@ notes)." modified seam-export-time-zone)) ("contents" . - ,(seam-export--to-string + ,(seam-export--export-to-html-string (insert-file-contents note-file) (re-search-forward "^\\* ") (org-mode) ;Needed for `org-set-property'. |