Commits

Shlomi Fish committed 544369e

Add the EPUB generation.

  • Participants
  • Parent commits 52384ae

Comments (0)

Files changed (3)

 lib/prod-synd/films/include-me.html
 lib/prod-synd/music/include-me.html
 lib/prod-synd/non-fiction-books/include-me.html
+lib/screenplay-xml/epub/*.epub
 lib/screenplay-xml/from-vcs/Buffy--a-Few-Good-Slayers
 lib/screenplay-xml/from-vcs/Blue-Rabbit-Log
 lib/screenplay-xml/from-vcs/Humanity-the-Movie
 
 DOCBOOK5_ALL_IN_ONE_XHTMLS = $(patsubst %,$(DOCBOOK5_ALL_IN_ONE_XHTML_DIR)/%/all-in-one.xhtml,$(DOCBOOK5_DOCS))
 
+all: splay
+
+include lib/make/docbook/sf-fictions.mak
+include lib/make/docbook/sf-screenplays.mak
 
 SCREENPLAY_RENDERED_HTMLS = $(patsubst %,$(SCREENPLAY_XML_RENDERED_HTML_DIR)/%.html,$(SCREENPLAY_DOCS))
 SCREENPLAY_XML_HTMLS = $(patsubst %,$(SCREENPLAY_XML_HTML_DIR)/%.html,$(SCREENPLAY_DOCS))
-SCREENPLAY_XML_EPUBS = $(patsubst %,$(SCREENPLAY_XML_EPUB_DIR)/%.epub,$(SCREENPLAY_DOCS))
+SCREENPLAY_XML_EPUBS = $(patsubst %,$(SCREENPLAY_XML_EPUB_DIR)/%.epub,$(SCREENPLAY_DOCS_FROM_GEN))
 SCREENPLAY_XML_FOR_OOO_XHTMLS = $(patsubst %,$(SCREENPLAY_XML_FOR_OOO_XHTML_DIR)/%.xhtml,$(SCREENPLAY_DOCS))
 
-all: $(SCREENPLAY_RENDERED_HTMLS) $(SCREENPLAY_XML_HTMLS)
-
-include lib/make/docbook/sf-fictions.mak
-include lib/make/docbook/sf-screenplays.mak
+splay: $(SCREENPLAY_RENDERED_HTMLS) $(SCREENPLAY_XML_HTMLS) $(SCREENPLAY_XML_EPUBS)
 
 $(SCREENPLAY_XML_HTML_DIR)/%.html: $(SCREENPLAY_XML_XML_DIR)/%.xml
 	perl -MXML::Grammar::Screenplay::App::ToHTML -e 'run()' -- \

bin/gen-docbook-make-helpers.pl

 
 my @screenplay_git_checkouts;
 my @screenplay_docs_basenames;
+my @screenplay_epubs;
 
 sub _calc_screenplay_doc_makefile_lines
 {
 
         my $src_varname = "${b}_${suf}_SCREENPLAY_XML_SOURCE";
         my $dest_varname = "${b}_${suf}_TXT_FROM_VCS";
+        my $epub_dest_varname = "${b}_${suf}_EPUB_FROM_VCS";
+        my $src_vcs_dir_var = "${b}_${suf}_SCREENPLAY_XML__SRC_DIR";
 
-        push @ret, "$src_varname = \$($vcs_dir_var)/screenplay/${doc_base}.screenplay-text.txt\n\n";
+        push @screenplay_epubs, $epub_dest_varname;
+
+        push @ret, "$src_vcs_dir_var = \$($vcs_dir_var)/screenplay\n\n";
+        push @ret, "$src_varname = \$($src_vcs_dir_var)/${doc_base}.screenplay-text.txt\n\n";
 
         push @ret, "$dest_varname = \$(SCREENPLAY_XML_TXT_DIR)/${doc_base}.txt\n\n";
 
+        push @ret, "$epub_dest_varname = \$(SCREENPLAY_XML_EPUB_DIR)/${doc_base}.epub\n\n";
+
         push @ret, (
               "\$($dest_varname): \$($src_varname)\n"
             . "\t" . q/cp -f $< $@/ . "\n\n"
         );
+
+        push @ret, <<"EOF";
+\$($epub_dest_varname): \$($src_varname)
+\tcd \$($src_vcs_dir_var) && make epub
+\tcp -f \$($src_vcs_dir_var)/${doc_base}.epub \$($epub_dest_varname)
+EOF
     }
 
 
             docs =>
             [
                 { base => "Star-Trek--We-the-Living-Dead", suffix => "ENG", },
-                { base => "Star-Trek--We-the-Living-Dead-hebrew", suffix => "HEB", },
+                # { base => "Star-Trek--We-the-Living-Dead-hebrew", suffix => "HEB", },
             ],
         },
         {
             @o,
             "\n\nSCREENPLAY_DOCS_FROM_GEN = \\\n",
             (map { "\t$_ \\\n" } @screenplay_docs_basenames),
+            "\n\nSCREENPLAY_DOCS__DEST_EPUBS = \\\n",
+            (map { "\t$_ \\\n" } @screenplay_epubs),
             "\n\n"
         );
     }