#!/bin/sh
rm -rf out
mkdir out

../../bin/w2x -v -o xhtml_css -p convert.charset UTF-8 -pu edit.before.finish-styles customize/patch_manual.xed  manual.docx out/manual.html

../../bin/w2x -v -o xhtml_css -p convert.charset UTF-8 -pu edit.before.finish-styles customize/patch_manual_restyled.xed -p edit.finish-styles.css-uri manual_restyled_css/manual.css -pu edit.finish-styles.custom-styles-url-or-file customize/custom.css manual.docx out/manual_restyled.html

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p convert.set-column-number yes -p transform.cals-tables yes -p transform.pre-element-name programlisting -o docbook -t customize/custom_docbook.xslt  manual.docx out/manual_dbk4.xml

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p convert.set-column-number yes -p transform.cals-tables yes -p transform.pre-element-name programlisting -o docbook5 -t customize/custom_docbook5.xslt  manual.docx out/manual_dbk5.xml

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p convert.set-column-number yes -p transform.cals-tables yes -p transform.pre-element-name programlisting -p transform2.topic-path manual_assembly_topics -p transform2.section-depth 2 -o assembly -t customize/custom_docbook5.xslt  manual.docx out/manual_assembly.xml

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p transform.root-topic-id manual -o topic -t customize/custom_topic.xslt  manual.docx out/manual_topic.dita

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p transform.root-topic-id manual -p transform2.topic-path manual_map_topics -p transform2.section-depth 6 -o map -t customize/custom_topic.xslt  manual.docx out/manual_map.ditamap

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p transform.root-topic-id manual -p transform2.topic-path manual_bookmap_topics -p transform2.section-depth 6 -o bookmap -t customize/custom_topic.xslt  manual.docx out/manual_bookmap.ditamap

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p transform.number-footnotes yes -o xhtml_strict \
	manual.docx out/manual_strict.xhtml

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p edit.do.sections "" -o xhtml_loose  \
	manual.docx out/manual_loose.xhtml

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -o xhtml1_1 manual.docx out/manual_1_1.xhtml

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -o xhtml5  manual.docx out/manual_5.xhtml

../../bin/w2x -v -p convert.charset UTF-8 -pu edit.before.finish-styles customize/patch_manual.xed -p split.split-before-level 1 -p split.use-id-as-filename yes -o frameset manual.docx out/frameset/manual.html

../../bin/w2x -v -p convert.charset UTF-8 -pu edit.before.finish-styles customize/patch_manual_restyled.xed -pu edit.finish-styles.custom-styles-url-or-file customize/custom.css -p split.split-before-level 1 -p split.use-id-as-filename yes -o frameset  manual.docx out/frameset2/manual.html

../../bin/w2x -v -pu edit.before.finish-styles customize/patch_manual.xed -p webhelp.split-before-level 1 -p webhelp.use-id-as-filename yes -o webhelp manual.docx out/webhelp/manual.html

../../bin/w2x -v -pu edit.before.finish-styles customize/patch_manual_restyled.xed -pu edit.finish-styles.custom-styles-url-or-file customize/custom.css -p webhelp.split-before-level 1 -p webhelp.use-id-as-filename yes -p webhelp.wh-layout corporate -pu webhelp.wh-favicon webhelp_icon.png -o webhelp manual.docx out/webhelp2/manual.html

../../bin/w2x -v -pu edit.before.finish-styles customize/patch_manual.xed -p epub.identifier http://www.xmlmind.com/w2x/1.14.1/manual.epub -pu epub.cover-image-url-or-file manual-cover.png -p epub.split-before-level 1 -o epub manual.docx out/manual.epub

../../bin/w2x -v -pu edit.before.finish-styles customize/patch_manual_restyled.xed -pu edit.finish-styles.custom-styles-url-or-file customize/custom.css -p epub.identifier http://www.xmlmind.com/w2x/1.14.1/manual2.epub -pu epub.cover-image-url-or-file manual-cover.png -p epub.split-before-level 1 -o epub manual.docx out/manual2.epub

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p split.split-before-level 1 -p split.use-id-as-filename yes -o frameset_strict manual.docx \
	out/frameset_strict/manual.xhtml

../../bin/w2x -v -p convert.charset UTF-8 -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -pu edit.finish-styles.custom-styles-url-or-file customize/xmlmind.css -p split.split-before-level 1 -p split.use-id-as-filename yes -o frameset_loose manual.docx \
	out/frameset_loose/manual.html

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p split.split-before-level 2 -p split.use-id-as-filename no -o frameset1_1 manual.docx \
	out/frameset1_1/manual.xhtml

../../bin/w2x -v -p convert.charset UTF-8 -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -pu edit.finish-styles.custom-styles-url-or-file customize/xmlmind.css -p split.split-before-level 1 -p split.use-id-as-filename yes -o frameset5 manual.docx \
	out/frameset5/manual.html

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p webhelp.split-before-level 1 -p webhelp.use-id-as-filename yes -o webhelp_strict manual.docx \
	out/webhelp_strict/manual.xhtml

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -pu edit.finish-styles.custom-styles-url-or-file customize/xmlmind.css -p webhelp.split-before-level 1 -p webhelp.use-id-as-filename yes -p webhelp.omit-toc-root yes -p webhelp.wh-layout corporate -pu webhelp.wh-favicon xmlmind_icon.ico -o webhelp_loose manual.docx \
	out/webhelp_loose/manual.html

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -p webhelp.split-before-level 2 -p webhelp.use-id-as-filename no -o webhelp1_1 manual.docx \
	out/webhelp1_1/manual.html

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -pu edit.finish-styles.custom-styles-url-or-file customize/xmlmind.css -p webhelp.split-before-level 1 -p webhelp.use-id-as-filename yes -p webhelp.omit-toc-root yes -p webhelp.wh-layout simple -o webhelp5 manual.docx \
	out/webhelp5/manual.html

../../bin/w2x -v -p edit.prune.preserve "p-ProgramListing p-DefinitionExample" -p edit.inlines.convert " c-Code code ! c-Abbrev abbr ! c-Variable var " -p edit.blocks.convert "p-Term dt g:id='dl' g:container='dl' ! p-Definition dd g:id='dl' g:container='dl' ! p-DefinitionExample dd g:id='dl' g:container='dl' ! p-ProgramListing span g:id='pre' g:container='pre'" -pu edit.before.blocks customize/definition_examples.xed -pu edit.after.blocks customize/notes.xed -pu edit.finish-styles.custom-styles-url-or-file customize/xmlmind.css -p epub.identifier http://www.xmlmind.com/w2x/1.14.1/manual1_1.epub -pu epub.cover-image-url-or-file manual-cover.png -p epub.split-before-level 1 -p epub.omit-toc-root yes -o epub1_1 manual.docx \
	out/epub1_1/manual.epub
