This document explains how to create a documentation for a CrypTool 2 component for the new online, XML based, documentation system.

First, create (by using Visual Studio) a new xml file inside the C# project of the component which you want to documentate. Select this xml file in the "Solution Explorer" and make sure, that its "Build Action" setting is set to "Resource". The following picture shows how this can look like:

Now, open the main C# sourcecode file of the component (i.e. the file which contains the class with the "PluginInfo" Attribute). Take a look at the PluginInfo Attribute. It looks like this:

[PluginInfo("Cryptool.Plugins.Cryptography.Encryption.Properties.Resources", false, "PluginCaption", "PluginTooltip", "SDES/DetailedDescription/doc.xml", "SDES/icon.png", "SDES/Images/encrypt.png", "SDES/Images/decrypt.png")]

Important for us is the fifth parameter (which is "null" in this case). You have to insert the path to the new XML file as a string there. For the SDES Plugin, this path is "SDES/DetailedDescription/doc.xml" (note the fact, that the path must contain the assembly name).

Now, CrypTool 2 knows where to find the documentation file of the component. What's left is filling the XML file with appropriate content.

Structure of the XML file

Open the new XML file and paste the following template code into it:

<?xml version="1.0" encoding="utf-8" ?>

  <language culture="en"/>

  <introduction lang="en">

  <usage lang="en">

  <presentation lang="en">

The first XML Element "language" is to tell the doc parser, for which languages the documentation page should be generated. The template only supports english. If you additionally want to support german, just add <language culture="de-DE"/>. Please note, that it is required to always support at least the english language, or else the doc file will be ignored.

The xml file consists of three sections. You are free to fill them with formatted (see below) content. The different sections fulfill the following purposes:

  • Introduction: Should explain something about the purpose and maybe the history of the component or its underlying technique.
  • Usage: Should contain some instruction on how to use this component in CrypTool 2.
  • Presentation: Should explain something about the visual presentation of this component (if available).

All of these sections are optional and can be omitted if appropriate.

You can define each section multiple times with different "lang" attributes. If you define one of these sections in some language without defining the language with "language" XML element, as described above, the doc parser will ignore that language. So the "language" element is some kind of switch for activating the language.

Editor for online help

After creating the help page as described before, you can easily edit the online help page using the OnlineDocumentationEditor. This editor has to be downloaded via the CrypToolStore. Open the CrypToolStore tab and search for OnlineDocumentationEditor. Download it. Then restart CrypTool 2. After that, you can open the editor using the "New" button of CrypTool 2. Select your help by searching for the type of your component in the dropdown list on the top left side of the editor. Then, you can edit your help easily. To (re-)generate the html help shown on the right side, press Ctrl+G.

Hint: The OnlineDocumentationEditor does not store the help xml file in your component. Each time you edited your help file, you need to save it (or use copy+paste) and then manually put it into the help file of your component.

Important hint: If you close the OnlineDocumentationEditor without copying or storing your edited help xml, it is lost.

Formatting the sections content

When filling the sections with text, you can use several XML tags to format it. These are listet below:

  • <b> bold </b>
  • <i> italic </i>
  • <u> underlined </u>
  • <newline/> for defining the end of a line.
  • The "enum" tag, which enumerates elements given by "item" tags (see below).
  • The "list" tag, which lists elements (unordered) given by "item" tags (see below).
  • <docRef item="Cryptool.TextInput.TextInput"/> to reference the documentation of another CrypTool 2 component
  • <external ref=""/> to reference external URLs.
  • <img src="TextInput/Documentation/Demonstration.png"/> to include images (see below how to handle the image file inside the project).
  • <section headline="A section"> to structure the document further.

This is how the "introduction" section can look like:

  <introduction lang="en">
    TextInput is a <b>very</b> useful component... <newline/>
    <img src="TextInput/Documentation/Demonstration.png"/>
    <section headline="New Section">
      This demonstrates the capability to create sections.
        <item>the enumeration</item>
        <item>the (unordered) listing</item>
        <item>capability! <b>Formating</b> is also possible! </item>

    <section headline="And another section">
      External links are possible: <external ref=""/>
      <newline />
      External links with a link text are possible, too: <external ref="">Click here!</external>
      <newline />
      Internal links are possible: <docRef item="Cryptool.TextInput.TextInput"/>

When using the "img" tag, you have to make sure, that the referenced image file is appropriately integrated into the components C# project. So, when referencing the path "TextInput/Documentation/Demonstration.png", the png file is contained in the "Documentation" directory. Like with the XML file, make sure that the "Build Action" of the png file is "Resource", or else the doc parser can't read it.

It is also possible to define tables with <table> <tr> <td> and <th> tags:

    <table border="1">
        <th>Header 1</th>
        <th>Header 2</th>
        <td>row 1, cell 1</td>
        <td>row 1, cell 2</td>
        <td>row 2, cell 1</td>
        <td>row 2, cell 2</td>


It is also possible to include a list of (external) references in the documentation xml. There are currently two kinds of references: Book references and link references. While the first one is described by an author, a publisher, a year, and the name of the book, the link reference is described by a link (i.e. an URL) and a caption, which describes the linked content.

The reference section can look like this:

<?xml version="1.0" encoding="utf-8" ?>

  <language culture="en"/>
  <language culture="de-DE"/>


      <link lang="en" url=""/>
      <caption lang="en">Text Display</caption>
      <link lang="de-DE" url=""/>
      <caption lang="de-DE">Text Anzeige</caption>

    <bookReference id="LordOfTheRings">
      <author>John Ronald Reuel Tolkien</author>
      <publisher lang="en">Harpercollins UK</publisher>
      <publisher lang="de-DE">Klett-Cotta</publisher>
      <name lang="en">The Lord of the Rings</name>
      <name lang="de-DE">Der Herr der Ringe</name>

As you can see, every reference can be described in several languages.

You can give references an ID to reference them in your description text (i.e. in one of the three sections "introduction", "usage" and "presentation". You can do this by using the <ref id="LordOfTheRings"/> tag.

Last modified 12 months ago Last modified on Mar 10, 2020, 3:13:27 PM

Attachments (2)

Download all attachments as: .zip