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

Properties



It is possible to define key / values for string replacements in the text (both by using the GUI or by the command-line). This can be used to configure some parts of the text, for example, to print version number in the header.

Portions of text containing the pattern "${key}" will be replaced with the associated value.

Note that you can also use the property in the dictionary or the categories description.

Default properties

The default properties are:
  • "date": the date of the generation
  • "docjVersion": the version of docJGenerator used for the generation
  • "count": the number of articles
  • "todo": the number of remaining TODOs
  • "comments": the number of comments and remaining TODOs
  • "errors": the number of errors emitted during the generation
  • "locale": the Locale of the wiki
  • "language": the language of the wiki

date property

The "date" property shows the date of the generation and is always provided by default.

For example:
      Generated on ${date}

docjVersion property

The "docjVersion" property shows the version of docJGenerator used for the generation.

For example:
      Generated by docJGenerator version ${docjVersion}

count property

Main Article: count property

The "count" property shows the number of articles and is always provided by default[1]
Note that its value will be different if used in a category
.

For example:
      The wiki has ${count} articles.
Result: The wiki has 227 articles.

todo property

Main Article: Todo

The "todo" property shows the number of todo in the wiki and is always provided by default.

Note the the todolist element allows to show a list of all TODOs in the wiki.

For example:
      The wiki has ${todo} TODOs.
Result: The wiki has 0 TODOs.

comment property

Main Article: Review

The "comment" property shows the number of comments and todo in the wiki and is always provided by default.

For example:
      The wiki has ${comment} comments.
Result: The wiki has ${comment} comments.

errors property

The "errors" property shows the number of errors detected when parsing the source of the wiki and is always provided by default. Note that external links errors (external links not found) are not included in this count.

For example:
      The parsing emitted ${errors} errorss.

locale property

Main Article: Localization

The "locale" property shows the locale of the wiki and is always provided by default.

For example:
      The wiki uses the ${locale} locale.
Result: The wiki uses the en locale.

language property

Main Article: Localization

A "language" property shows the language of the wiki and is always provided by default. For example:
      The wiki uses the ${language} language.
Result: The wiki uses the English language.

User-defined properties

To define a user-defined property, you just have to specify it on the command-line using the "$" character before the name of the property. For example for a version property:
      java -jar docGenerator.jar -input=wiki/input -output=wiki/output -$version=<version_number>
You can also specify a file defining the properties on the command-line with the properties key. For example:
      java -jar docGenerator.jar -input=wiki/input -output=wiki/output -properties=properties.properties
with the following content for this file:
  version=<version_number>

Defining properties though the ant file

We can use ant properties to define our own value for the property on the ant file. For example, if version is an ant property:
   <java classname="org.docgene.main.DocGenerator">
      <arg value="-input=wiki/input"/>
      <arg value="-output=wiki/output"/>
      <arg value="-search=titles"/>
      <arg value="-$version=${version}"/>
      <classpath>
         <pathelement path="docGenerator.jar"/>
      </classpath>
   </java>

Example

Suppose we want to show the text "Version" followed by the version number in the header. We can define a property with the following key/value, for example:
      java -jar docGenerator.jar -input=wiki/input -output=wiki/output -$version=<version_number>
or by specifying in the GUI a file with the following properties:
      version=<version_number>
If the header file contains the following structure:
      <header desc="Version ${version}"/>
Then the header will present what we want.

Notes

  1. ^ Note that its value will be different if used in a category

See also


Categories: configuration

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