mirror of https://codeberg.org/cage/tinmop/
- used 'gpub' as file extension for generated gempub files.
This commit is contained in:
parent
2dfdf804a4
commit
f6f3428dbb
|
@ -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)))
|
||||
|
|
|
@ -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"))
|
||||
|
|
|
@ -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"
|
||||
(format nil
|
||||
"~a~@[.~a~]"
|
||||
dir
|
||||
extension)
|
||||
dir))
|
||||
:search t
|
||||
:wait t
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue