Skip to content

WikipediaTaglet

brunobraga edited this page Nov 7, 2011 · 7 revisions

A Taglet representing {@wikipedia target[ title]}. This tag can be used in any kind of Doc. It is an inline tag, so it relies on extended information within the brackets to build the link to Wikipedia website.

The syntax above will be rendered as:

<a href="http://en.wikipedia.org/{target}">{title||target}</a>

Examples

"{@wikipedia test}" would be shown as: [test] (http://en.wikipedia.org/test)

"{@wikipedia test My Test}" would be shown as: [My Test] (http://en.wikipedia.org/test)

When documenting your code, just use this tag whenever you need to link Wikipedia sources. An external source example is presented below:

/**
 * Documentation for test 2 
 * Wikipedia tests:
 * <p>
 * {@wikipedia}
 * <p>
 * {@wikipedia test}
 * <p>
 * {@wikipedia test }
 * <p>
 * {@wikipedia test this}
 * <p>
 * {@wikipedia test this is }
 * <p>
 * {@wikipedia test this is a test !}
 */
public void test2() {}

The code above, from javadoc will generate the HTML:

WikipediaTaglet

More information on how to generate documentation with javadoc [here] (HowToJavadoc).

Notes

  • Make sure to use the value of target as a single string, as this tag is following same standard adopted by other built-in tags, where following text will represent the title of the link to the specified target.
  • If no target is informed, title will be used in its place.
  • Make sure to use the value of target as a single string, as this tag is following same standard adopted by other built-in tags, where following text will represent the title of the link to the specified target.
  • If badly specified (eg. no target), the returning value will be an red coloured error string, to call attention about the issue to be resolved.

For developers

If you need to use different Wikipedia (non-English), you will have to take this code and replace the website link in this file's source code, at your own risk.

Clone this wiki locally