content_template.eex (2427B)
1 <?xml version="1.0" encoding="UTF-8"?> 2 <package xmlns="http://www.idpf.org/2007/opf" 3 unique-identifier="project-<%= config.project %>" 4 version="3.0"> 5 <metadata xmlns:dc="http://purl.org/dc/elements/1.1/"> 6 <dc:title><%= config.project %> - <%= config.version %></dc:title> 7 <dc:identifier id="project-<%= config.project %>"><%= uuid %></dc:identifier> 8 <dc:language><%= config.language %></dc:language> 9 <%= for {author, index} <- Enum.with_index(config.authors || [], 1) do %> 10 <dc:creator id="author<%= index %>"><%= author %></dc:creator> 11 <% end %> 12 <meta property="dcterms:modified"><%= datetime %></meta> 13 <%= if config.cover do %> 14 <meta name="cover" content="cover-image"/> 15 <% end %> 16 </metadata> 17 <manifest> 18 <item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav scripted"/> 19 <item id="cover" href="title.xhtml" media-type="application/xhtml+xml" properties="scripted"/> 20 <%= for {_title, extras} <- config.extras do %> 21 <%= for extra <- extras do %> 22 <item id="<%= extra.id %>" href="<%= extra.id %>.xhtml" media-type="application/xhtml+xml" properties="scripted"/> 23 <% end %> 24 <% end %> 25 <%= for filter <- [:modules, :tasks] do %> 26 <%= for node <- nodes[filter] do %> 27 <item id="<%= node.id %>" href="<%= node.id %>.xhtml" media-type="application/xhtml+xml" properties="scripted"/> 28 <% end %> 29 <% end %> 30 <%= for static_file <- static_files do %> 31 <item id="<%= static_file_to_id(static_file) %>" href="<%= static_file %>" media-type="<%= media_type(Path.extname(static_file)) %>"/> 32 <% end %> 33 <%= if config.cover do %> 34 <%= if Path.extname(config.cover) == ".png" do %> 35 <item id="cover-image" href="assets/cover.png" media-type="image/png"/> 36 <% end %> 37 <%= if Path.extname(config.cover) == ".jpg" do %> 38 <item id="cover-image" href="assets/cover.jpg" media-type="image/jpeg"/> 39 <% end %> 40 <% end %> 41 </manifest> 42 <spine> 43 <itemref idref="cover"/> 44 <itemref idref="nav"/> 45 <%= for {_title, extras} <- config.extras do %> 46 <%= for extra <- extras do %> 47 <itemref idref="<%= extra.id %>"/> 48 <% end %> 49 <% end %> 50 <%= for filter <- [:modules, :tasks] do %> 51 <%= for node <- nodes[filter] do %> 52 <itemref idref="<%= node.id %>"/> 53 <% end %> 54 <% end %> 55 </spine> 56 </package>