Home
Categories
Dictionary
Download
Project Details
Changes Log
What Links Here
How To
Syntax
FAQ
License

DOCX generation



It is possible to generate a DOCX document rather than an HTML site. You need to set the following command-line argument or configuration property:
  • "outputType" set to "docx"

Configuration


There are specific properties used for the document generation.

Support for hand-written html articles


There is a limited level of support for the Hand-written html articles in the docx generation.

Syntax support

Main Article: DOCX syntax support

There is a limited level of support for the syntax in the docx generation.

Custom CSS support


There is a limited level of support for the Custom StyleSheet in the docx generation.

Generation algorithm

By default the generator will generate:
  • One introduction chapter with only the content of the index file
  • One chapter for each category
  • For each category, one sub-chapter for each article in the category. Each article will however be only in one chapter, even if it is in more than one category
It is possible to configure the structure of the DOCX file by specifying the "chaptersContent" property. See DOCX content specification.

Configuration

A few specific properties or arguments allow to specifically configure the generation for the PDF format:
  • "fileName": The DOCX file will be generated in the output directory. By default the name of the file will be "wiki.docx", but this property allows to change the name of the file
  • "docFile": the path of the DOCX file. In that case the output directory will be the parent directory of this file
  • "defaultChapter": the name of the default chapter, used for articles which belong in no category
  • "chaptersContent": the path of an XML file allowing to configure much more precisely the structure of the DOCX document. See DOCX content specification.
  • "hasTOC": true if the document should have a Table of Contents. Default is true
  • "title": the title Metadata of the document (default is "Wiki")
  • "author": the author Metadata of the document (default is "theAuthor")

Limitations

There are a few limitations compared to the HTML result:
  • resource elements don't link to their associated resource content
  • Internal wikilinks on img elements are not taken into account
  • Each article is only present in one category

Example

      java -jar docGenerator.jar -input=wiki/input -output=wiki/output -outputType=docx

Example of generation with ant

  <java classname="org.docgene.main.DocGenerator">
     <arg value="-input=wiki/input"/>
     <arg value="-output=wiki/output"/>
     <arg value="-fileName=docGeneratorWiki"/>
     <arg value="-outputType=docx"/>
     <arg value="-chaptersContent=docContent.xml"/>
     <classpath>
        <pathelement path="docGenerator.jar"/>
        <pathelement path="lib/docxWriter.jar"/>
     </classpath>
  </java>

See also


Categories: configuration | docx | plugins

docJGenerator Copyright (c) 2016-2023 Herve Girod. All rights reserved.