How-To Markup
Back to current version Restore this version

How to create a new markup #

KnowWE is designed for the easy introduction of new (e.g., project specific) markups. Therefore, an extra plugin extension point is provided. Further, a markup template is defined that allows to make benefit of existing implementations of parser and autocompletion functionality. We call this template DefaultMarkup. The implementation of a new markup based on the DefaultMarkup can be achieved at very low implementation workload. It is recommended to always make use of this template when creating a new markup (except for the very rare cases where it is not suitable).

Create a new markup derived from default markup#

The DefaultMarkup has a particular predefined syntactical structure that can be coined by a custom keyword and custom annotation.
public class HelloWorldMarkup extends DefaultMarkupType {

	public static final String IMAGE_KEY = "image";
	
	private static final DefaultMarkup MARKUP;

	static {
		MARKUP = new DefaultMarkup("CIDashboard");
		MARKUP.addAnnotation(NAME_KEY, true);
		MARKUP.addAnnotation(TEST_KEY, true);
		MARKUP.addAnnotation(TRIGGER_KEY, true);
		MARKUP.addAnnotationContentType(TEST_KEY, new TestIgnoreType());
		MARKUP.addAnnotationContentType(TEST_KEY, new TestDeclarationType());
	}

	public HelloWorldMarkup() {
		super(MARKUP);
	}
}

! Extend Class DefaultMarkupType

To create a new markup based on DefaultMarkup, the class de.knowwe.kdom.defaultMarkup.DefaultMarkupType needs to be extended. The following code snipplet shows a Hello-World extension of DefaultMarkup.

Add Annotations#

Create a renderer#

Create entry into the plugin.xml#

Create an new general markup#