Sometimes plain text might not be enough to explain complex commands. Then you might want to use formatting, styling and maybe some functional tags to empower your documentation. You can do this by using following HTML tags: <p>
, <h1>
, <h2>
, <h3>
, <h4>
, <h5>
, <h6>
, <div>
, <br>
, <b>
, <strong>
, <table>
, <a>
and <code>
. How these effect you documentation, will be explained in the following paragraphs!
|
The given examples are using classes as commands. If you are using methods as commands, you can still use these tags in the documentation text!
|
4.1.1. Linebreak
If you want to format the text with a linebreak, you need to use the HTML tag <br>
:
[...]
/**
* This is a sample command for displaying purposes
*
*
* @workflowDocu This is the documentation of this command! (1)
* This results in the line to be continued! <br> (2)
* This will be displayed in the next line!
*/
@JavaCommand
public class Example {
[...]
}
Figure 6. The resulting documentation.
1 |
Regular line breaks in the source code will have no effect on the displayed documentation in the workflow executor. |
2 |
The br tag will result in a linebreak at its location. |
4.1.2. Paragraph
You can also use paragraphs, using the HTML tag <p>
:
[...]
/**
* This is a sample command for displaying purposes
*
*
* @workflowDocu This is the documentation of this command!
* <p> (1)
* This is the paragraphs content!
* </p> (2)
* This will be displayed in the next line!
*/
@JavaCommand
public class Example {
[...]
}
Figure 7. The resulting documentation.
1 |
Paragraphs will always leave an empty line to the content before, if there is any! |
2 |
Paragraphs will always space them self one line apart to the content following the paragraph! |
|
The tags <p> , <div> , <table> and heading tags <h1-6> are unavailable whilst within a paragraphs ⇒ No nesting of these tags inside paragraphs!
|
4.1.3. Headings
The documentation supports 6 different headings. You can use those with the tags <h1>
, <h2>
, <h3>
, <h4>
, <h5>
and <h6>
with the biggest heading being <h1>
and the smallest being <h6>
.
|
Headings can be used in the same way as paragraphs, but they affect font size and text style. Common usage is for dividing the documentation into smaller sections.
|
4.1.4. Container
|
Containers work differently as how they would work in a regular HTML file!
|
Containers in the documentation mark a new line before and after the content.
[...]
/**
* This is a sample command for displaying purposes
*
*
* @workflowDocu This is the documentation of this command!
* <div> (1)
* This is the containers content!
* </div> (2)
* This will be displayed in the next line!
*/
@JavaCommand
public class Example {
[...]
}
Figure 8. The resulting documentation.
1 |
Containers always start in a new line! |
2 |
Any content after the container will start in a new line! |
Containers can be used for wrapping multiple tags.
[...]
/**
* This is a sample command for displaying purposes
*
*
* @workflowDocu This is the documentation of this command!
* <div> (1)
* <p>
* This is the first paragraph!
* </p>
* <p>
* This is the second paragraph!
* </p>
* <p>
* This is the third paragraph!
* </p>
* </div> (2)
* This will be displayed in the next line!
*/
@JavaCommand
public class Example {
[...]
}
Example 1. Command run with no optional inputs
|
|
1 |
The container starts in a new line before the paragraph lists adds it own spacing. |
2 |
The paragraph adds its spacing before the container ends by entering a new line. |
|
With longer lists it gets easier to spot where the list starts and ends using the <div> tag.
|
4.1.5. Table
You can use tables in your documentation.
|
Tables have a fixed format. You cannot change it!
|
|
A table only supports plain text. It ignores any tags that are not part of the table.
|
This is how a table can be structured:
[...]
/**
* This is a sample command for displaying purposes
*
*
* @workflowDocu This is the documentation of this command!
* <table> (1)
* <tr> (2)
* <th> (3)
* Table Heading of column one
* </th> (3)
* <th>
* Table Heading of column one
* </th>
* </tr> (2)
* <tr>
* <td> (4)
* Some table content
* </td> (4)
* <td>
* Some more table content
* </td>
* </tr>
* <caption>This is an example table!</caption> (5)
* </table> (1)
* This will be displayed in the next line!
*/
@JavaCommand
public class Example {
[...]
}
Figure 9. The resulting documentation.
1 |
Everything within the <table> tag is parsed as part of the table. Unknown or wrongly placed tags or elements will be ignored. |
2 |
A table row is signified with the <tr> tag. A table row can contain multiple elements that are the contents of this row. |
3 |
A table head <th> is a special kind of table content as they can be seen as a headline. |
4 |
Regular table data is marked with the <td> tag. |
5 |
(Optional) This is a <caption> for the table that will be displayed above the Table. |
|
You can space the table from the surrounding documentation by nesting the table into containers!
|
|
Inline styles will be ignored.
|
4.2.1. Making text bold
There are currently two different options of making certain text elements bold: Using <b>
or <strong>
|
Both tags work in the exact same way! The only difference between the two is a semantic difference: Use <strong> to highlight something and use <b> out of a stylistic choice!
|
[...]
/**
* This is a sample command for displaying purposes
*
*
* @workflowDocu This is the <strong>documentation</strong> of this command! (1)
* I still want this <b>bold!</b> (2)
*/
@JavaCommand
public class Example {
[...]
}
Figure 10. The resulting documentation.
1 |
Making documentation bold out of an emphasis on this part! |
2 |
Making bold! bold out of a stylistic choice! |
|
Only plain text is allowed within those tags!
|
4.3.1. Links
You can embed links into your documentation with the <a>
tag:
[...]
/**
* This is a sample command for displaying purposes
*
*
* @workflowDocu More information available on our <a href='https://pak.asap.de/'>website</a>! (1)
*/
@JavaCommand
public class Example {
[...]
}
Figure 11. The resulting documentation.
1 |
The word website will have an on click event, which opens an external website in your default browser. The URL specified behind the href is the website that opens, in this case https://pak.asap.de/ ! |
4.3.2. Examples
If you want to add an example that the user can copy, you should use the <code>
tag. The user then can click on the text to copy it into the clipboard
|
This also has a style to highlight the example!
|
[...]
/**
* This is a sample command for displaying purposes
*
*
* @workflowDocu Try to run the command with following input:<code>This is an example that can be used to run the command</code> (1)
*/
@JavaCommand
public class Example {
[...]
}
Figure 12. The resulting documentation.
1 |
The example being highlighted and having an on click event pasting the content into the clipboard for pasting into command inputs! |