git.iko.soy/typeable/pandoc
on master help sign in
EPUB, EPUB3 templates: Handle structured metadata on titlepage.

Previously we just expected 'title', 'subtitle', 'author', 'date'. Now we still support those, but also support the format recommended for epub metadata in the pandoc README: --- title: - type: main text: My Book - type: subtitle text: An investigation of metadata creator: - role: author text: John Smith - role: editor text: Sarah Jones identifier: - scheme: DOI text: doi:10.234234.234/33 publisher: My Press rights: (c) 2007 John Smith, CC BY-NC ...

commit2d5491bc0b167a5b20c03e4bc02ef8b5fc20379f authorJohn MacFarlane <jgm@berkeley.edu> dateSun 31 Aug 2014, 12:00 (12 years ago) parent7be841c
2 files changed+37−7
default.epub+16−1 default.epub3+21−6
default.epub+16−1
@@ -17,15 +17,30 @@ $endfor$
1717</head>
1818<body>
1919$if(titlepage)$
20+$for(title)$
21+$if(title.text)$
22+ <h1 class="$title.type$">$title.text$</h1>
23+$else$
2024 <h1 class="title">$title$</h1>
25+$endif$
26+$endfor$
2127$if(subtitle)$
2228 <h1 class="subtitle">$subtitle$</h1>
2329$endif$
2430$for(author)$
2531 <h2 class="author">$author$</h2>
2632$endfor$
33+$for(creator)$
34+ <h2 class="$creator.type$">$creator.text$</h2>
35+$endfor$
36+$if(publisher)$
37+ <p class="publisher">$publisher$</p>
38+$endif$
2739$if(date)$
28− <h3 class="date">$date$</h3>
40+ <p class="date">$date$</p>
41+$endif$
42+$if(rights)$
43+ <p class="rights">$rights$</p>
2944$endif$
3045$else$
3146$body$
default.epub3+21−6
@@ -21,18 +21,33 @@ $endfor$
2121</head>
2222<body>
2323$if(titlepage)$
24− <section epub:type="titlepage">
25− <h1 class="title">$title$</h1>
24+<section epub:type="titlepage">
25+$for(title)$
26+$if(title.type)$
27+ <h1 class="$title.type$">$title.text$</h1>
28+$else$
29+ <h1 class="title">$title$</h1>
30+$endif$
31+$endfor$
2632$if(subtitle)$
27− <h1 class="subtitle">$subtitle$</h1>
33+ <h1 class="subtitle">$subtitle$</h1>
2834$endif$
2935$for(author)$
30− <h2 class="author">$author$</h2>
36+ <h2 class="author">$author$</h2>
3137$endfor$
38+$for(creator)$
39+ <h2 class="$creator.type$">$creator.text$</h2>
40+$endfor$
41+$if(publisher)$
42+ <p class="publisher">$publisher$</p>
43+$endif$
3244$if(date)$
33− <h3 class="date">$date$</h3>
45+ <p class="date">$date$</p>
46+$endif$
47+$if(rights)$
48+ <p class="rights">$rights$</p>
3449$endif$
35− </section>
50+</section>
3651$else$
3752$body$
3853$endif$