mirror of
https://github.com/jgm/pandoc.git
synced 2026-09-24 00:15:44 +00:00
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 ...
This commit is contained in:
+16
-1
@@ -17,15 +17,30 @@ $endfor$
|
||||
</head>
|
||||
<body>
|
||||
$if(titlepage)$
|
||||
$for(title)$
|
||||
$if(title.text)$
|
||||
<h1 class="$title.type$">$title.text$</h1>
|
||||
$else$
|
||||
<h1 class="title">$title$</h1>
|
||||
$endif$
|
||||
$endfor$
|
||||
$if(subtitle)$
|
||||
<h1 class="subtitle">$subtitle$</h1>
|
||||
$endif$
|
||||
$for(author)$
|
||||
<h2 class="author">$author$</h2>
|
||||
$endfor$
|
||||
$for(creator)$
|
||||
<h2 class="$creator.type$">$creator.text$</h2>
|
||||
$endfor$
|
||||
$if(publisher)$
|
||||
<p class="publisher">$publisher$</p>
|
||||
$endif$
|
||||
$if(date)$
|
||||
<h3 class="date">$date$</h3>
|
||||
<p class="date">$date$</p>
|
||||
$endif$
|
||||
$if(rights)$
|
||||
<p class="rights">$rights$</p>
|
||||
$endif$
|
||||
$else$
|
||||
$body$
|
||||
|
||||
+22
-7
@@ -21,18 +21,33 @@ $endfor$
|
||||
</head>
|
||||
<body>
|
||||
$if(titlepage)$
|
||||
<section epub:type="titlepage">
|
||||
<h1 class="title">$title$</h1>
|
||||
<section epub:type="titlepage">
|
||||
$for(title)$
|
||||
$if(title.type)$
|
||||
<h1 class="$title.type$">$title.text$</h1>
|
||||
$else$
|
||||
<h1 class="title">$title$</h1>
|
||||
$endif$
|
||||
$endfor$
|
||||
$if(subtitle)$
|
||||
<h1 class="subtitle">$subtitle$</h1>
|
||||
<h1 class="subtitle">$subtitle$</h1>
|
||||
$endif$
|
||||
$for(author)$
|
||||
<h2 class="author">$author$</h2>
|
||||
<h2 class="author">$author$</h2>
|
||||
$endfor$
|
||||
$if(date)$
|
||||
<h3 class="date">$date$</h3>
|
||||
$for(creator)$
|
||||
<h2 class="$creator.type$">$creator.text$</h2>
|
||||
$endfor$
|
||||
$if(publisher)$
|
||||
<p class="publisher">$publisher$</p>
|
||||
$endif$
|
||||
</section>
|
||||
$if(date)$
|
||||
<p class="date">$date$</p>
|
||||
$endif$
|
||||
$if(rights)$
|
||||
<p class="rights">$rights$</p>
|
||||
$endif$
|
||||
</section>
|
||||
$else$
|
||||
$body$
|
||||
$endif$
|
||||
|
||||
Reference in New Issue
Block a user