WoodWing Help Center

Exporting InDesign layouts for import in Inception - script installation and configuration

Exporting InDesign layouts for import in Inception - script installation and configuration

The content of a layout can be exported from InDesign and subsequently imported into Inception as a new Story.

Example of an InDesign layout imported as a Story in Inception

Figure: Example of an InDesign layout (left) imported as a Story in Inception (right). Imported are the title (A), subtitle (B), author (C) and body text (D). Images are currently added as attachments (E) and can be manually added.

This method requires scripts to be installed and configured in InDesign.

Installation

Step 1. Download the latest version of the scripts:

inception-indesign-export-1.0.59.zip (91 KB, December 2015)

Step 2. Unzip the downloaded file.

Step 3. Copy the folders named inception and Startup Scripts into the Scripts folder of InDesign or into the Scripts folder of the user.

Note: When a Startup Scripts folder already exists, copy the content of the Startup Scripts folder into the existing folder.

Step 4. Restart InDesign.

A new menu named 'Inception' is added to the main menu bar.

The Inception menu in InDesign

Figure: The installed scripts add a new Inception menu to the menu bar of InDesign.

Configuration

The following features can be configured:

  • The location of the folder where the files are exported to.
  • Which paragraphs should be included when automatically generating an InDesign Article.
  • Into which Inception components each paragraph should be imported.
  • Which text formatting should be treated as bold and italic.
  • Which characters in the output should be replaced.

Changing the location of the export folder

By default, the export files are exported to the following location:

~/Desktop/inception-indesign-export

To change this location, do the following:

Step 1. Access the inception-config.jsx file.

Step 2. Change the exportDirectory option.

// The directory used as base directory for the export. The script will create directories with the document name
// inside the base folder to separate the export of different documents. Consecutive exports of the same document
// will overwrite existing files. Orphaned files will not be removed.
exportDirectory: '~/Desktop/inception-indesign-export',

Controlling which paragraphs to export and linking them to Inception components

An InDesign Article can be generated automatically by choosing Inception > Create InDesign Article. During this process, paragraphs are automatically added to an InDesign Article as items.

During export, it needs to be defined into which Inception component each paragraph needs to be loaded.

Both actions are controlled by associating a paragraph style with an Inception component. This is done in the configuration file.

Example: A paragraph has the style 'Title-black" applied. In the configuration file, the Inception component 'title' is associated with the paragraph style 'Title-black'.

  • When automatically creating the InDesign Article, the paragraph is added as an item because its paragraph style is defined in the configuration file.
  • When exporting the layout, the paragraph is designated to be imported into Inception as a title component because the paragraph style is associated with the Inception component in the configuration file.

Step 1. Access the inception-config.jsx file.

Step 2. In the textFilterList option, add a paragraph style to its corresponding Inception component.

Example: For the Title component, add the paragraph style(s) that is used for styling the title in InDesign; for the Subtitle component, add the paragraph style(s) that is used for styling the subtitle in InDesign, and so on.

Note: For examples, see the inception-config-sample.jsx file.

// Object with all Inception component types. Each type has an array of style names that will be used
// to define the type. Style names can be either strings or regular expressions (in string form)
textFilterList: {
	title: [
	],
	subtitle: [
	],
	caption:[
	],
	author: [
	],
	intro: [
	],
	quote: [
	],
	body: [
	],
	footer: [
	]
},

Example:

textFilterList: {
		title: [
            "/(T|t)itle.*/"
		],
		subtitle: [
            "/Subtitle.*/",
            "/Subsubtitle.*/"
		],
		caption:[
            "Caption"
		],
		author: [
            "Author"
		],
		intro: [
            "Body-white"
		],
		quote: [
            "Quote"
		],
		body: [
            "Body-black"
		],
		footer: [
            "Footer"
		]
	},

Note about what to do when no paragraph styles are used in the layout

Although not recommended, it is not uncommon that layouts have no custom paragraph styles defined and that text is solely formatted through the use of character styles or local styling.

To still export the content from the layout to Inception, associate the default paragraph styles "[No Paragraph Style]" and "[Basic Paragraph]" with an Inception component. Most practical will be to associate them to the Body component.

Example: Here, all text that has the default paragraph styles assigned is exported as an Inception body text component:

body: [
"[No Paragraph Style]",
"[Basic Paragraph]"
]

Defining which text formatting should be treated as bold and italic

Text that is formatted as bold or italic (or should be treated as such) can be defined in the configuration file.

Step 1. Access the inception-config.jsx file.

Step 2. In the styles section, use any of the available methods to define which text should be treated as bold or italic:

  • By using a character style (preferred method)
  • By using a font style
  • By using a paragraph style

Note: Use the following syntax: 

"name of character style, font style or paragraph style": {formatting style: true or false}

For examples, see the inception-config-sample.jsx file.

// The 'styles' section provides the export details about what styling should result in bold and italic
// overrides in the output.
styles: {
	// Mark character styles as bold or italic. Matching is on full character style name. Most commonly used.
	character: {
	},
	// Mark use of certain font styles as bold or italic in the output. Be aware that this will match for all
	// font families used with the specified font style
	font: {
	},
	// Mark entire paragraphs as bold or italic. Not commonly used.
	paragraph: {
	}
},

Example:

styles: {
    character: {
        "MP   Seitenzahl": {},
        "MP   Praefix GEO": {},
        "00   negativ": {},
        "01   semibold": {bold: true},
        "03   semibold versal": {bold: true},
        "06   bold negativ": {bold: true},
        "10   bold versal negativ": {bold: true},
        "13   kursiv": {italic: true}
    },

Replacing characters in the output

Because of the differences between print and Web, some changes may need to be made to the output so that the content displays correctly in HTML.

Example: Hard line breaks may need to be removed.

Step 1. Access the inception-config.jsx file.

Step 2. In the htmlEncode option of the output section, define the changes that need to be made.

// The 'output' section [...] offers the opportunity to remove and/or replace
// characters in the output. Html special characters will automatically be
// escaped in the output.
output: {
	...
	htmlEncode: [
	]
	},

Note: For examples, see the inception-config-sample.jsx file.

Preparing templates

In order for the exported content to be properly imported, make a Story template available for the user that matches the components that are present in the export as much as possible.

For more information, see Creating a Story template in Inception.

Testing the configuration

Test the configuration by exporting a layout and importing it into Inception.

Was this article helpful?
0 out of 0 found this helpful / Created: / Updated:
Have more questions? Submit a request

0 Comments

Please sign in to leave a comment.