Documentation
¶
Overview ¶
Package book is the book-specific version of Cogent Author for rendering markdown source into various book documents, including .pdf via latex, .html, .docx and epub.
These files should be located in the current directory where the command is run. Author generates the output files based on Book.Name there, with all of the temporary files used in the generation process in the 'author' directory.
Index ¶
- Variables
- func Book(c *author.Config) error
- type BookData
- func (bk *BookData) DOCX(mdfn string) error
- func (bk *BookData) EPUB(mdfn string) error
- func (bk *BookData) GetFiles()
- func (bk *BookData) HTML(mdfn string) error
- func (bk *BookData) LaTeX(mdfn string) error
- func (bk *BookData) Markdown() string
- func (bk *BookData) PDF(mdfn string) error
- func (bk *BookData) Refs() error
Constants ¶
This section is empty.
Variables ¶
View Source
var PandocInputs embed.FS
Functions ¶
func Book ¶
Book generates a book based on a set of markdown files, with the following required file names (with [] indicating optional files):
- metadata.yaml: pandoc metadata with various important options
- cover.png: cover image
- frontmatter.md: with copyright, dedication, foreward, preface, prologue sections.
- chapter-*.md: chapters, using 01 etc numbering to put in order.
- endmatter.md: includes epilogue, acknowledgements, author
- [appendix-*.md] appendicies, using a, b, c, etc labeling.
- [glossary.md] optional glossary that generates links in text.
- allrefs.bib: source of all references in BibTex format, to use in resolving citations.
Types ¶
type BookData ¶
type BookData struct { // Name is the overall name of the book. // Output files will be Name.pdf etc. Name string // names of the chapters, in sorted order. Chapters []string // names of the appendicies. Appendicies []string Metadata map[string]any }
BookData has all of the info about the book.
func NewBookData ¶
func (*BookData) Markdown ¶
Markdown generates the combined markdown file that everything else works on.
Click to show internal directories.
Click to hide internal directories.