diff options
author | Spencer Williams <spnw@plexwave.org> | 2025-07-06 20:16:59 -0400 |
---|---|---|
committer | Spencer Williams <spnw@plexwave.org> | 2025-07-06 20:16:59 -0400 |
commit | 10319bee92d0be2ad417b1635bc36c0a45a1b0a4 (patch) | |
tree | c57ef5e0e5e21a722c0a97f176c4bc4b9f1a43ca /lisp/seam-export.el | |
parent | 3f10699d75dafa7266340b8eb0a2e0fb12b6540a (diff) |
Add support for draft notes
Diffstat (limited to 'lisp/seam-export.el')
-rw-r--r-- | lisp/seam-export.el | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lisp/seam-export.el b/lisp/seam-export.el index b5d7046..743672a 100644 --- a/lisp/seam-export.el +++ b/lisp/seam-export.el @@ -33,6 +33,7 @@ (defvar seam-export--types nil) (defvar seam-export--template nil) (defvar seam-export--root-path nil) +(defvar seam-export--include-drafts nil) (defvar seam-export--no-extension nil) (defvar seam-export--internal-link-class nil) (defvar seam-export--options nil) @@ -70,6 +71,10 @@ properties: The root path used for rendering internal links. Defaults to \"\", which means all paths are relative. + `:include-drafts' + + Whether to export draft notes as well. Defaults to nil. + `:no-extension' Whether to drop the \".html\" file extension in links. Defaults to @@ -278,7 +283,8 @@ notes)." (buffer-string))) (defun seam-export-note (file) - (let ((type (seam-get-note-type file))) + (let ((type (seam-get-note-type file)) + (draft-p (seam-draft-p file))) (cl-loop for (dir . plist) in seam-export-alist do (let ((types (plist-get plist :types)) @@ -294,9 +300,12 @@ notes)." seam-export-template-file)) (seam-export-template-string seam-export-template-string) (t (error "You must specify a template for export (see `seam-export-alist')"))))) - (when (member type types) + (when (and (member type types) + (or (not (seam-draft-p file)) + (plist-get plist :include-drafts))) (let ((seam-export--types types) (seam-export--root-path (or (plist-get plist :root-path) "")) + (seam-export--include-drafts (plist-get plist :include-drafts)) (seam-export--no-extension (plist-get plist :no-extension)) (seam-export--template template) (seam-export--internal-link-class |