1
0
Fork 0

- used 'gpub' as file extension for generated gempub files.

This commit is contained in:
cage 2024-09-18 20:36:05 +02:00
parent 2dfdf804a4
commit f6f3428dbb
4 changed files with 11 additions and 3 deletions

View File

@ -71,6 +71,8 @@
(define-constant +metadata-entry-name+ "metadata.txt" :test #'string=)
(define-constant +gempub-file-extension+ "gpub" :test #'string=)
(defun extract-metadata (zip-file)
(when (gempub:gempub-file-p zip-file :ignore-errors t)
(let ((entries (zip-info:list-entries zip-file)))

View File

@ -181,7 +181,9 @@
license
copyright
cover-filename))
(os-utils:zip-directory gemtext-directory :flat t)))
(os-utils:zip-directory gemtext-directory
:extension gempub:+gempub-file-extension+
:flat t)))
(defun create-gempub (gemtext-dir)
(gui:with-modal-toplevel (toplevel :title (_ "Add Metadata"))

View File

@ -319,13 +319,16 @@ numerical user ID, as an assoc-list."
(when (not (process-exit-success-p process))
(error (format nil (_ "File ~s extraction from ~s failed") file-entry zip-file))))))
(defun zip-directory (dir &key (flat nil))
(defun zip-directory (dir &key (extension nil) (flat nil))
(with-output-to-string (stream)
(let* ((process (run-external-program +zip-bin+
(append (when flat
(list "-j"))
(list "-r"
dir
(format nil
"~a~@[.~a~]"
dir
extension)
dir))
:search t
:wait t

View File

@ -2946,6 +2946,7 @@
(:shadowing-import-from :misc :random-elt :shuffle)
(:export
:+metadata-entry-name+
:+gempub-file-extension+
:gempub-file-p
:extract-metadata
:sync-library