Fix document section assignments in EPUB writer.

For example, introduction should go in bodymatter, not frontmatter, and
epigraph, conclusion, and afterward should go in bodymatter, not
backmatter.

For the full list of assignments, see the manual.

Closes .
This commit is contained in:
John MacFarlane 2019-06-04 09:20:29 -07:00
parent dddad515e8
commit b5af8eed38
2 changed files with 19 additions and 9 deletions
MANUAL.txt
src/Text/Pandoc/Writers

View file

@ -4944,17 +4944,24 @@ abstract frontmatter
acknowledgments frontmatter acknowledgments frontmatter
copyright-page frontmatter copyright-page frontmatter
dedication frontmatter dedication frontmatter
credits frontmatter
keywords frontmatter
imprint frontmatter
contributors frontmatter
other-credits frontmatter
errata frontmatter
revision-history frontmatter
titlepage frontmatter
halftitlepage frontmatter
seriespage frontmatter
foreword frontmatter foreword frontmatter
halftitle, frontmatter
introduction frontmatter
preface frontmatter preface frontmatter
seriespage frontmatter seriespage frontmatter
titlepage frontmatter titlepage frontmatter
afterword backmatter
appendix backmatter appendix backmatter
colophon backmatter colophon backmatter
conclusion backmatter bibliography backmatter
epigraph backmatter index backmatter
[epub-type]: http://www.idpf.org/epub/31/spec/epub-contentdocs.html#sec-epub-type-attribute [epub-type]: http://www.idpf.org/epub/31/spec/epub-contentdocs.html#sec-epub-type-attribute

View file

@ -584,11 +584,14 @@ pandocToEPUB version opts doc = do
_ -> (Pandoc nullMeta bs, "bodymatter") _ -> (Pandoc nullMeta bs, "bodymatter")
frontMatterTypes = ["prologue", "abstract", "acknowledgments", frontMatterTypes = ["prologue", "abstract", "acknowledgments",
"copyright-page", "dedication", "copyright-page", "dedication",
"foreword", "halftitle", "credits", "keywords", "imprint",
"introduction", "preface", "contributors", "other-credits",
"errata", "revision-history",
"titlepage", "halftitlepage", "seriespage",
"foreword", "preface",
"seriespage", "titlepage"] "seriespage", "titlepage"]
backMatterTypes = ["afterword", "appendix", "colophon", backMatterTypes = ["appendix", "colophon", "bibliography",
"conclusion", "epigraph"] "index"]
chapterEntries <- zipWithM chapToEntry [1..] chapters chapterEntries <- zipWithM chapToEntry [1..] chapters