codebook ( src-dir -- )


Vocabulary
codebook

Inputs
src-diran object


Outputs
None

Definition


:: codebook ( src-dir -- )
codebook-output-path get normalize-path :> dest-dir
"Generating ebook for " write src-dir write " in " write
dest-dir print flush dest-dir make-directories [
[
src-dir file-name :> name src-dir code-files
:> files src-dir name files code>opf
name ".opf" write-dest-file
"vocab:codebook/cover.jpg" "." copy-file-into
src-dir name files code>ncx
name ".ncx" write-dest-file
src-dir name files code>toc-html
"_toc.html" "" write-dest-file files [| file |
src-dir file code>html
file name>> file-html-name "" write-dest-file
] each "." name ".opf" kindle-path kindlegen
"." name ".mobi" kindle-path dest-dir copy-file-into
dest-dir name ".mobi" kindle-path
:> mobi-path "Job's finished: " write
mobi-path print flush
] cleanup-unique-directory
] with-temp-directory ;