Template-epub is a bare-bones template for EPUB3. It uses CodeKit's .kit extension to allow easier editing of the OPF file and updating of shared components.
To use the template you will need the following tools and libraries:
Edit _metadata-master.kit to set up your default metadata for the ebook. Some of this will import into your package.opf.
If you want to add features such as external fonts, media, etc you can edit the relevant metadata .kit file, then @import them to package.kit.
This is a test page compiled from content-01.kit and content-01.md.
If you're unfamiliar with CodeKit's .kit language, read this first.
- In *CodeKit > html, create a new .kit file. Say we want to end up with default.xhtml, we create default.kit.
- (Optional) In *CodeKit > content, create a markdown file for the content of the page. Compile it to *CodeKit > html > content-default.html
- Import content-default.html into default.kit.
Add the following .kit variables and imports. Optionally, you can add local variables to override the master variables in _metadata-master.
<!-- $page-id = page-default-html -->
<!-- $page-title = Default HTML -->
<!-- @import metadata-master.kit, 01-header.kit, default.kit, 02-close.kit -->$page-id– added to<body>as an id and<title>- @import – creates the document using the .kit or html files you specify. In this example, the page contains:
** metadata-master.kit - global metadata variables
** 01-header.kit – the doctype,
<html>,<head>and opening<body>tags ** default.kit - the body content ** 02-close.kit – closing</body>and</html>tags
stylesheet.scss imports the following files:
_fonts.scss– add your @font-face rules here, then addfont-familynames to_variables.scss_layout.scss– base layout styles_variables.scss– base variables for fonts, colour schemes, etc.
bourbon.scss(optional) – this automatically imports Bourbon
This template also uses the following files from benmanley/framework-base
reset.scss– a bare-bones reset.mixins.scss– mixins for golden ratios, fonts, properties that use rems but fall back to pixels, plus cross browser support for various properties.