Skip to content

From Manuscript to EPUB

andrecastro0o edited this page Feb 7, 2015 · 37 revisions

The conversion form a manuscript to EPUB it is a step by step process, that consists of:

  1. Manuscript - .docx - editing the manuscript according to the INC style guide
  2. Source - converting the manuscript files to Markdown files.
  3. Compound Source - compiling all the Markdown files into a single book.md Markdown file
  4. Outputs 4.1 EPUB Output converting the compound Markdown source file to an EPUB 4.2 ICML Output converting the individual Markdown source into ICML files that can be imported into inDesign

All steps can be able to be accomplished by running the makefile

0. Work Environment

  • shell
  • working directory - folder structure
  • git

1. Manuscript: .docx

This is a preparatory stage. Yet it is highly important for the series of conversions that will lead to the different publication's outputs.

You'll be editing the text document handed by the author - the manuscript -, according to INC styleguide: section "Document Formatting/Layout", subsection "General".

Do pay special attention to this part of the INC styleguide. Following it rigorously will ensure that your manuscripts will convert flawlessly to markdown (the next step).

Masterclass: Add correct headings to file docx/1_1-Hart_Keith.docx

2. Source: converting the manuscript files to Markdown files

make markdowns is the command you'll need to run in the terminal to start this stage.

This command will convert all the .docx files inside the docx/ folder into corresponding markdown files inside md/ folder.

The resulting markdown files are meant as source files, from which all of the publication's outputs will be generated.

The main reasons for this choice is the easiness by which they can be read and written, they high compatibility with other markup languages (HTML, ICML) and the corresponding outputs (EPUB/Website, inDesign Project)

2.1 Images in Markdown

At this stage you should insert the images, back to the essay, now in markdown format.

First of all, you need to **save all the images included in the essays in the folder md/imgs/ **

Then place the images on the markdown files: ![My image caption](imgs/myImage.jpg)

Don't forget to include captions, if the image has them. Markdown captions will become visible, and associated to the image in the EPUB output

2.2 Metadata in Markdown

Each of the resulting markdown files contain a metadata header. You can fill those fields with the corresponding information.

Note on metadata: You can change the metadata fields and values that are added to each article, by editing the template file used to generate the markdown files: essay.md.template

Masterclass: In md/1_1-Hart_Keith.md complete the metadata, and insert images in their correct location.

3. Compound Source: Assembling the Markdown source files into book.md

make book.md is the command you'll need to run in the terminal to start this stage.

It will generate a single Markdown file book.md comprising the content of all the individual Markdown source files inside md/ folder.

The book.md file will, in step 4.1 give origin to the EPUB output.

4. Outputs

4.1 EPUB Output converting the compound Markdown source file to an EPUB

make book.epub is the command you'll need to run in the terminal to start this stage.

Essential files:

This step requires a few resources, that will be fed into the production of the EPUB, such as its cover image, metadata, stylesheet, and fonts.

  • epub/metadata.xml - metadata for epub MUST BE EDITED
  • epub/styles.epub.css MUST BE EDITED
  • epub/cover.png MUST BE CHANGED
  • lib - fonts

4.2 ICML Output converting the individual Markdown source into ICML files that can be imported into inDesign

make icmls is the command you'll need to run in the terminal to start this stage.

Folder structure

├── compound
│   ├── article.body.template.md
│   ├── article.head.template.md
│   └── TOC.md
├── docs
│   ├── 01_01_Introduction.md
│   ├── 01_02_Colophone.md
│   ├── 01_Intro.md
│   ├── 02_01_article.md
│   ├── 02_02_article.md
│   ├── 02_Content.md
│   └── images
├── epub
│   ├── cover.png
│   ├── metadata.xml
│   └── styles.epub.css
├── gitignore
├── guides
│   ├── Styleguide_INC_2014.md
│   └── Template_INC_essay.md
├── images
│   └── chucky.jpg
├── lib
│   └── UbuntuMono-B.ttf
├── makefile
├── README.md
├── scripts
│   ├── chapter.sh
│   └── expand_toc.py
Clone this wiki locally