Difference between revisions of "Courses/Hybrid publishing resources"

From Publication Station
Line 85: Line 85:


[[File:pandoc_diagram.png]]
[[File:pandoc_diagram.png]]
== ****************** ==


== markup a text in MS Word/Libre Office/Open Office ==
== markup a text in MS Word/Libre Office/Open Office ==
Line 133: Line 137:
== **** ==
== **** ==


== stream line ==
 
This same approach of converting between markups using Pandoc can be automated.
== stream line it ==
This same approach for converting between markups using Pandoc can be automated.


Since computers are good at doing repetitive and boring tasks, we can take advantage from it.
Since computers are good at doing repetitive and boring tasks, we can take advantage from it.


We can make them perform the same task on multiple source files, and make them produce multiple outputs (E.G. EPUB, ICML, HTML).
We can store commands in scripts and have them perform the same task on multiple source files, producing multiple outputs (E.G. EPUB, ICML, HTML).




== Overview ==
== Overview ==
In this process, from several .docx files we'll try to create two outputs: '''ICML''' files for inDesign, and an '''EPUB'''.
In this process, from several .docx files we'll try to create two outputs:  
* an '''ICML''' files for inDesign
* an '''EPUB'''  


We'll also try to keep a connection between the '''source''' and its '''outcomes'''.
And we'll also try to keep a connection between the '''source''' and its '''outcomes'''.


== Steps ==
== Steps ==
This hybrid publishing recipe will involve the following steps:
This hybrid publishing recipe will involve the following steps:
 
# '''.docx - manuscript''' - editing the manuscript using word styles
# '''.docx - Manuscript''' - .docx - editing the manuscript according to the INC style guide
# '''Markdown - source''' - converting the manuscript (.docx) files to Markdown (.md) files.
# '''Markdown - Source''' - converting the manuscript files to Markdown files.
# '''ICML - output''' - converting Markdown source files into ICML files that can be imported into inDesign
# '''ICML files for inDesign''' - converting the individual Markdown source into ICML files that can be imported into inDesign
# '''EPUB - output''' -converting the compound Markdown (book.md) into an EPUB
# '''EPUB Output''' -converting the compound Markdown source file to an EPUB


Note: The section "6.3. Do-it-yourself EPUB using Pandoc" form [[From%20Print%20to%20Ebooks|http://networkcultures.org/blog/publication/from-print-to-ebooks-a-hybrid-publishing-toolkit-for-the-arts/]] is an important complement to this tutorial and set of tools
Note: The section "6.3. Do-it-yourself EPUB using Pandoc" form [[From%20Print%20to%20Ebooks|http://networkcultures.org/blog/publication/from-print-to-ebooks-a-hybrid-publishing-toolkit-for-the-arts/]] is an important complement to this tutorial and set of tools
Line 159: Line 165:


== Makefile ==
== Makefile ==
My proposal involves using a Makefile to automate conversions between markup-languages
My proposal involves using a Makefile to automate the conversions between markups.


Makefiles are usually used to in the free-software community to compile source code into running applications.  
Makefiles are used in the free-software community to compile source code into running applications.  
However they are not more than a notebook of commands to process stuff and generate other stuff from it: e.g. create executables programs out of source code files. There is nothing stopping us from using makefiles to automate conversions between markup-languages.
However they are not more than a notebook of commands to process stuff and generate other stuff from it.
E.g. create executables programs out of source code files. There is nothing stopping us from using makefiles to automate conversions between markup-languages.


Read more about Makefiles in the context of hybrid publishing:
Read more about Makefiles in the context of hybrid publishing:
* the blog post [http://networkcultures.org/digitalpublishing/2014/10/01/make-book/ Make Book] by Michael Murtaugh
* blog post [http://networkcultures.org/digitalpublishing/2014/10/01/make-book/ Make Book] by Michael Murtaugh
* the [http://lwn.net/Articles/589196/ report] on the Don Marti's presentation at SCALE
* [http://lwn.net/Articles/589196/ Report] on the Don Marti's presentation at SCALE
* [http://www.gnu.org/software/make/ GNU Make official site ]
* [http://www.gnu.org/software/make/ GNU Make official site ]




== Recipe Preparation ==
== Recipe Preparation ==
http://27.media.tumblr.com/tumblr_lv1oy5tBwQ1qm4heyo1_500.gif
http://27.media.tumblr.com/tumblr_lv1oy5tBwQ1qm4heyo1_500.gif
== (install Make) ==
* Download http://rudix.org/download/2014/10.8/make-3.82-4.pkg
* Using the finder go to Downloads and begin installing that package


== clone Hybrid Publishing Resources  ==
== clone Hybrid Publishing Resources  ==
Line 189: Line 191:
* Unzip
* Unzip


content.zip contains a couple of .docx files, which you will use as your content. Any other structured (with Styles).docx files could be used.
content.zip contains a couple of .docx files, which you will use as your content. Other structured(with Styles) .docx files could be used.


There is also a .ttf font file and an image.
There is also a .ttf font file and an image.
Line 214: Line 216:


== 1. Manuscript: .docx ==
== 1. Manuscript: .docx ==
 
This is a preparatory stage. Yet it is important for the series of conversions that will lead to the different publication's outputs.
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 -, possibly according to a style-guide.
You'll be editing the text document handed by the author - the manuscript -, possibly according to a style-guide.


(See [[#markup|a text in MS Word/Libre Office/Open Office previous section]] on how to structure a .docx file)
(See [[#markup|a text in MS Word/Libre Office/Open Office previous section]] on how to structure a .docx file)
Line 224: Line 224:


== 2. Source: converting the manuscript files to Markdown files ==
== 2. Source: converting the manuscript files to Markdown files ==
Run: <code>make markdowns</code> to start this stage.
Run: <code>make markdowns</code> to start this stage.


Line 233: Line 232:


=== 2.1 Images in Markdown ===
=== 2.1 Images in Markdown ===
 
At this stage you should insert the images onto the essays, now in markdown format.
At this stage you should insert the images in to the essays, now in markdown format.


First of all, you need to '''save all the images included in the essays in the folder''' <code>md/imgs/</code> Then '''place the images on the markdown document''': <code>![My image caption](imgs/myImage.jpg)</code>
First of all, you need to '''save all the images included in the essays in the folder''' <code>md/imgs/</code> Then '''place the images on the markdown document''': <code>![My image caption](imgs/myImage.jpg)</code>
Line 252: Line 250:


== 4.0 make book.md ==
== 4.0 make book.md ==
This step is essential to the creation of the EPUB. However, '''you don't have to perform this step, as the makefile does it for you'''.
This step is essential to the creation of the EPUB. It generates a single Markdown file <code>book.md</code> and save it it inside the <code>md/</code> folder. However, you don't have to perform this step, as the makefile does it for you.
 
It generates a single Markdown file <code>book.md</code> and save it it inside the <code>md/</code> folder.  


<code>book.md</code> consists of the content from all the individual Markdow files inside the <code>md/</code> folder, in alphabetical order (00 to ZZ). If you want to change the order the publication, you can change the filenames in order to do so.  
<code>book.md</code> consists of the content from all the individual Markdow files inside the <code>md/</code> folder, in alphabetical order (00 to ZZ). If you want to change the order the publication, you can change the filenames in order to do so.  


'''Note: the Mardown filenames should NOT contain spaces or dots, except for the extension''' <code>.md</code>
'''Note: the Markdown filenames should NOT contain spaces or dots, except for the extension''' <code>.md</code>


To generate this single book.md, run: <code>make book.md</code> .
To generate this single book.md, run: <code>make book.md</code> .


== 4.1 make book.epub (EPUB) ==
== 4.1 make book.epub (EPUB) ==
Line 286: Line 281:
This work is in many way as an iterative process.
This work is in many way as an iterative process.


You work in circles: changing the source files (markdown files, the EPUB's stylesheet, the EPUB's metadata) and seeing the results of those changes in Calibre (or other ebook viewr)
You work in circles: changing the source files (markdown files, the EPUB's stylesheet, the EPUB's metadata) and seeing the results of those changes in Calibre (or other ebook-viwerer)




Line 323: Line 318:




 
==****===





Revision as of 19:31, 12 March 2015

<slidy theme="a" />

TO DO

  • can Hybrid Publishing Resources guide the whole class?
    • show that conversion as single command
    • use make to generate a batch conversion
  • proof read and tidy

publicationstation.wdka.hro.nl/wiki

Hybrid Publishing

Focus

Transforming a source (manuscript) into multiple publishable outputs, within a hybrid publishing workflow

Hybrid Publishing Workflow

  1. various outcomes from one workflow
  2. constant connection between source-content and outcome
  3. avoiding repeating tasks

Hybrid Publishing Workflow

Hybrid-workflow.png

http://networkcultures.org/blog/publication/from-print-to-ebooks-a-hybrid-publishing-toolkit-for-the-arts/

EPUB trailer


How?

How can we achieve a publishing workflow where we can go from the source (a word document, a wiki page, a webpage) to several outputs (an EPUB, a website, an animated gif, an inDesign project)?

Structure

By putting the content into an explicit structure, which can withstand those transformations.

So what is a title (heading) in a format, remains a title when translated to a different format.

How to achieve explicit structure?

An explicit structure is achieved by marking the text with structural information.

marking the text = markup

Markup languages

HTML:

<h1>Revenge of the Text</h1>
 <p>There is a room in the <strong>Musée d’Orsay</strong> that I call the <em>room of possibilities</em>.</p>
 <p>That room contains:</p>
 <ul>
  <li>a snow flake</li>
  <li>the end of a cloud</li>
  <li>a bit of nothing</li>
 </ul>

Wiki markup:


= Revenge of the Text =

There is a room in the '''Musée d’Orsay''' that I call the ''room of possibilities''.

That room contains:

* a snow flake
* the end of a cloud
* a bit of nothing

Markdown:

# Revenge of the Text

There is a room in the **Musée d’Orsay** that I call the *room of possibilities*.

That room contains:

* a snow flake
* the end of a cloud
* a bit of nothing

Pandoc

pandoc: software for converting between markups with

Pandoc diagram.png


******************

markup a text in MS Word/Libre Office/Open Office

styles; Test on WDKA

create a .docx file and mark it up with a few of the following paragraph and characters styles:

  • headings
  • body text
  • block quotes: indented blocks of text
  • footnotes
  • hyperlinks
  • Preformatted text
  • Bold
  • Italics

Save in .docx

convert

Convert your docx file into a an HTML file using Pandoc.

shell
Pandoc command

convert once more, now to EPUB

Can you instead of converting the .docx into HTML convert into an EPUB?

clues

Markdown

Markdown as the source file.

link to Markdown syntax

Any plain text editor such as Sublime Text or Gedit can be used to edit Markdown files. There are also WYSIWYG Markdown editors such as MacDown.

Why Markdown ?

  • simple
  • only one way to create a structure
  • compatible with HTML, but easier to read and write
  • allows the inclusion of HTML tags. E.g.
    <!-- an html comment -->  <span id="mrspan">a div</span>

convert once more, now to Markdown

pandoc argument


****

stream line it

This same approach for converting between markups using Pandoc can be automated.

Since computers are good at doing repetitive and boring tasks, we can take advantage from it.

We can store commands in scripts and have them perform the same task on multiple source files, producing multiple outputs (E.G. EPUB, ICML, HTML).


Overview

In this process, from several .docx files we'll try to create two outputs:

  • an ICML files for inDesign
  • an EPUB

And we'll also try to keep a connection between the source and its outcomes.

Steps

This hybrid publishing recipe will involve the following steps:

  1. .docx - manuscript - editing the manuscript using word styles
  2. Markdown - source - converting the manuscript (.docx) files to Markdown (.md) files.
  3. ICML - output - converting Markdown source files into ICML files that can be imported into inDesign
  4. EPUB - output -converting the compound Markdown (book.md) into an EPUB

Note: The section "6.3. Do-it-yourself EPUB using Pandoc" form http://networkcultures.org/blog/publication/from-print-to-ebooks-a-hybrid-publishing-toolkit-for-the-arts/ is an important complement to this tutorial and set of tools

File:Http://networkcultures.org/wp-content/uploads/2015/02/workflow.png

Makefile

My proposal involves using a Makefile to automate the conversions between markups.

Makefiles are used in the free-software community to compile source code into running applications. However they are not more than a notebook of commands to process stuff and generate other stuff from it. E.g. create executables programs out of source code files. There is nothing stopping us from using makefiles to automate conversions between markup-languages.

Read more about Makefiles in the context of hybrid publishing:


Recipe Preparation

http://27.media.tumblr.com/tumblr_lv1oy5tBwQ1qm4heyo1_500.gif

clone Hybrid Publishing Resources

download content =

content.zip contains a couple of .docx files, which you will use as your content. Other structured(with Styles) .docx files could be used.

There is also a .ttf font file and an image.

end of recipe preparation / start cooking

http://jerichogaming.weebly.com/uploads/1/3/9/8/13982770/______7978332_orig.gif


0. Folder structure

To create folder structure, which will be understood by the scripts from this repository, you need to run:

./scripts/create_folders.sh

This script will generate the following folder structure, which you'll use to store the files essentially for the creation of the EPUB.

├── docx 
├── epub 
├── icml 
├── md 
│   └── imgs 
└── scripts


1. Manuscript: .docx

This is a preparatory stage. Yet it is 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 -, possibly according to a style-guide.

(See a text in MS Word/Libre Office/Open Office previous section on how to structure a .docx file)


2. Source: converting the manuscript files to Markdown files

Run: make markdowns 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 the source files, from which all of the publication's outputs will be generated.


2.1 Images in Markdown

At this stage you should insert the images onto the essays, 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 document: ![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.


3. make icmls - ICML files for inDesign

Run: make icmls to start this stage.

The individual Markdown source files, stored in md/, can be converted into ICML files which can be imported into inDesign.

Read more on ICML files and inDesign in section


4. make book.epub

4.0 make book.md

This step is essential to the creation of the EPUB. It generates a single Markdown file book.md and save it it inside the md/ folder. However, you don't have to perform this step, as the makefile does it for you.

book.md consists of the content from all the individual Markdow files inside the md/ folder, in alphabetical order (00 to ZZ). If you want to change the order the publication, you can change the filenames in order to do so.

Note: the Markdown filenames should NOT contain spaces or dots, except for the extension .md

To generate this single book.md, run: make book.md .

4.1 make book.epub (EPUB)

To obtain the epub file book.epub run: make book.epub to start this stage.

4.1.1 Essential files for EPUB =

To produce an EPUB a few resources (files) are needed, namely the cover image, metadata, stylesheet, and fonts.

This files will strongly influence the EPUB's outcome, and consequently should be edited for each publication or series of publication

  • epub/metadata.xml - EPUB metadata
  • epub/styles.epub.css - EPUB css style-sheet MUST BE EDITED
  • epub/cover.jpg - EPUB cover MUST BE CHANGED

4.1.2 Fonts (optional) for EPUB

lib/ is folder for storing custom fonts, that will be used in the EPUB

Note on the use of custom fonts: If you choose to use fonts, make sure to change the makefile to include the use of fonts in the makefile epub rule, such as in the rule bellow, where --epub-embed-font=lib/UbuntuMono-B.ttf \ was added to allow for the use of the Ubuntu Mono font. Also include the font on th EPUB style-sheet with @font-face rule

4.1.3 EPUB check

The health of the created EPUB can be checked with http://validator.idpf.org/

4.1.5 make book.epub : An iterative process

This work is in many way as an iterative process.

You work in circles: changing the source files (markdown files, the EPUB's stylesheet, the EPUB's metadata) and seeing the results of those changes in Calibre (or other ebook-viwerer)


working with ICML files

ICML files are useful, since they ensure that the structural information of the Markdown source files is also present in the inDesign projects, which use them.

Another point in favor of ICML is the possibility of updating the content and structure of the inDesign projects, by updating the Markdown source files, converting the once more to ICML. For this to happens is however necessary that inDesign remains linked to its source, and that the designers works with paragraph and chapter styles, instead of directly into the text.

Note: malformatted links in the markdown files will create problems when imported into inDesign.


Place ICMLs

Open inDesign and ...

Place your output.icml in a inDesign project.

The Place function is in: File > Place (shortcut: Apple+D)

Design with Styles

Style the content using paragraph and character styles.

Paragraph/Characters styles are in: Type > Paragraph/Character Styles

ICML Content updates

Using Sublime Text, edit one ICML file adding some text to it.

See the content being updated in inDesign.


Hands off content

In in inDesgin content shall remain untouched until the last moment

If you change the content of the articles inDesign, the link between the inDesign content and its source ICML file will be lost, and it no longer be able to be updated.

This "disconnection" should only be the last step to be done on your design workflow.


****=

software used