Single-source workflow

From Publication Station
Jump to: navigation, search



Create ICML and HTML files from a styled docx manuscript file.

  • The ICML is the content of the inDesing project that will originate the print publication
  • The HTML is the content of the Website project


  • updatable: changes to the manuscript are propagated to the outputs
  • reusable: structure (headings, bloque quotes) and paragraphs styles (bold, italics) are maintained from manuscript to outputs

how:Pandoc / Hybrid Publishing Editor

Markups languages

Markups languages are ways of marking text, giving with words specific hierarchical and visual rendering.

By marking the text according to markup languages it is possible to:

  • add reading aids, such bold, italic, blockquotes
  • add a clear text hierarchy: section titles, sub-section titles, sub-sub-sub section titles
  • convert between different markup languages - as they are mostly compatible

Markup languages examples

Each markup uses a different markings


<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>
  <li>a snow flake</li>
  <li>the end of a cloud</li>
  <li>a bit of nothing</li>

Markdown: [1]

# 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

ICML (xml):

<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Header1">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Content>Revenge of the Text</Content>
<Br />
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Content>There is a room in the </Content>
  <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Bold">
    <Content>Musée d’Orsay</Content>
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Content> that I call the </Content>
  <CharacterStyleRange AppliedCharacterStyle="CharacterStyle/Italic">
    <Content>room of possibilities</Content>
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
<Br />
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/Paragraph">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Content>That room contains:</Content>
<Br />
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList &gt; first" NumberingContinue="false">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Content>a snow flake</Content>
<Br />
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Content>the end of a cloud</Content>
<Br />
<ParagraphStyleRange AppliedParagraphStyle="ParagraphStyle/BulList">
  <CharacterStyleRange AppliedCharacterStyle="$ID/NormalCharacterStyle">
    <Content>a bit of nothing</Content>

Word styles in manuscript (.docx)

If changes to the manuscript are needed, use paragraph styles in MS Word/Libre Office/Open Office to "mark" the text, so as to allow those structural markings to propagate to ICML(inDesign) and HTML(website).

Some existing paragraph and characters styles:

  • headings: heading1, heading2, etc
  • body text: regular text
  • block quotes: indented blocks of text
  • footnotes
  • hyperlinks
  • Preformatted text as in
    Hello world
  • Bold
  • Italics

Save in .docx. Pandoc cannot read .doc, only .docx


pandoc: is a software for converting text between different markups

Pandoc diagram.png

Pandoc has a text-based interface, which can be challenging to use, to those unused to use the command-line terminal.

Luckily there are a few Web interfaces to Pandoc, such as Hybrid Publishing Editor by Michael Murtaugh

Hybrid Editor


ICML files

ICML files are essentially XML files, usualy managed by InCopy, Adobe’s own word processor, which can be easily imported into Adobe InDesign.

Importing ICML to InDesign

An ICML file can be imported into InDesign with File>Place

The present paragraph styles and chapter styles that were present in the manuscript which gave origin to the ICML are kept and included in the HTML file.

bold; italic; blockquotes; footnotes; headers; paragraphs; tables; lists.

Images are given an empty placeholder.

Updating content

If the ICML remains linked to the inDesign project, changes performed in manuscript, once converted to the ICML, will be integrated into the inDesign project.

inDesign Styles

See more in

Importing styles from another inDesign project

To import character and paragraph styles from another inDesign project:

  • Choose Load All Text Styles from the Paragraph Styles panel menu
    • InDesign displays the Open a File dialog box.
  • Locate and select the InDesign project file containing the styles you want and click the Open button.
    • InDesign copies the character styles from that publication into the current document.


Importing/Exporting styles

According to course Exporting InDesign styles for CSS and HTML "InDesign writes and creates the CSS for you. This is not an option that I really recommend because InDesign, great as it is, does not write very good CSS. It tries to write CSS that is a very, very close match in appearance to your print layout and that's not necessarily Web-friendly."

Besides the design spaces - the page and the screen have different properties and behaviors.

Conversions to ICML

Pandoc can convert HTML and Markdown markups into ICML, since the file format is is essentially XML markup.

Example command:

pandoc -s -f markdown -t icml -o my.icml

-s option, which stands for “standalone”, produces output with an appropriate header and footer;

-f option, which stands for “from”, is followed by the source format;

-t option, which stands for “to”, is followed by the output format;

-o option, which stands for “output”;; is the markdown source filename.


Updatable Website

  • Download book-website structure
  • unzip
  • place `book-website-master/` in the folder dedicated to the publication

How to integrating changing content & website creation?

Our problem: like in inDesign we want to work on the identity and navigation of our website, while keeping the content updatable.

inDesign addresses this issue with the use of chapter styles.

How can it work for the website creation?

Website-inner outer.svg


The book-website try address this issue, with a quick'n'dirty JS+HTML system for loading html content from content.html into index.html, without a webserver.

NOTE: it will only work in Firefox; Chrome will refuse to so, due to same origin policies

The motivation to do so, is to allow content (in content.html) to be easily updatable, and decoupled from the rest of the webpage files.

Folder structure:

├── content.html    ----> CONTENT
├── index.html      ----> LANDING PAGE 
├── jquery-3.1.1.min.js 
├── load.js         ----> JS where content is loaded, sections and TOC are created
└── style.css       ----> CSS style info

  • content.html will store updatable content
  • style.css stores the CSS Making changes to CSS can be done in
  • index.html receives the content from content.html allows HTML (such as menus) to be added
  • load.js besides loading content, also includes a function which generates a Table-of-contents generate_toc, using the h1 elements to create entries:
    <li><a href="#id_of_firsth1">First h1</a></li>
    <li><a href="#id_ofsecond_h1">Second h2</a></li>

Cite error: <ref> tags exist, but no <references/> tag was found