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

Algorithm



The docJGenerator project allows to generate a html site with a list of XML files defining a documentation. It allows to produce an offline wiki-like site. It is also possible to configure the tool to parse files with the mediawiki syntax or the markdown syntax.

Usage

To use the docJGenerator tool, you have to double-click on the Jar file of the application (or perform java -jar docGenerator.jar if you did not associate the Java application to jar files), and configure the generator:
  • The input directory or directories where the input XML files and image resources are to be found. See root directories and packages if you want an explanation on how to use the generator with more than one root directory
  • The output directory where the output web site must be generated
  • (optional): an alternate index file to use if there are more than one input directory
  • (optional): a configuration file (see configuration file)
  • It is possible to define a properties file defining key/value string replacements in the text
  • The value for the maximum number of files to be generated in one directory
The application will generate a web site with an index file (wiki-like). It is also possible to generate a PDF file, a Word file, or an Epub file rather than a web site.

Algorithm

Overview

algorithm
The algorithm for creating the wiki content is the following:
  • The tool parser parses the content of the wiki source ( XML markup, markdown markup, or mediawiki markup) and creates a wiki source tree model containing all the articles and resources definition
  • The wikiContent parameter allows to filter the content of the output and to structure the results for output formats which use chapters
  • Optionnally, the Scripts plugin is called to modify the wiki source tree model
  • Depending on the selected output format, the relevant writer generates the output content

Algorithm steps

Main Article: Performance


algorithm2
The parsing and writing algorithm has the following steps:
  • Pre-parsing identifies the list of files to parse and their types
  • Parsing parse each file identified in the previous step. By default the parsing is performing in the main Thread, but it is possible to perform the parsing in background threads
  • Resolving resolves the inter-wiki links
  • Checking links checks the validity of the external links. This step is performed in background threads at the same time as the resolving step
  • Writing writes the content of the wiki

Note that if the generation is performed in incremental generation, only content which has changed since the last generation will be parsed are written.

Resulting file structure

Main Article: Output structure

See also


Categories: algorithm | general

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