Stay in touch

Concordion on Facebook Concordion on Google+ Concordion on LinkedIn Concordion on Pinterest Concordion on Twitter

Extensions

You can add additional functionality to Concordion.NET with the help of extensions. For example additional commands, event listeners, or output modifiers can be introduced based on Concordion.NET extensions.

Extensions API

A dedicated section of the executable specifications describe the extensions API of Concordion.NET. The fixture classes demonstrate how to use the extensions API.

See also the extensions of the Java version of Concordion for examples what can be achived with the help of the extensions API.

Adding extensions to Concordion.NET

Extensions are added to Concordion.NET by:

For further details see the extension configuration specification.

Building your own extension

Extensions must implement the ConcordionExtension interface, which allows extensions to hook into the Concordion.NET processing through the ConcordionExtender interface.

Example: Adding custom CSS

Amongst other features, the ConcordionExtender interface provide a means for adding CSS, JavaScript or arbitrary resources to the Concordion.NET output folder.

The following example extension copies /my_concordion.css from the classpath to the root folder of the Concordion.NET output, and links to it from the Concordion.NET output HTML.

using org.concordion.api.extension;

namespace Com.Acme
{
    public class MyCssExtension : ConcordionExtension {
        public void addTo(ConcordionExtender concordionExtender) {
            concordionExtender.withLinkedCSS("/my_concordion.css",
                new Resource("/my_concordion.css"));
        }
}
}

Note: if you have already declared a link to the CSS file in your HTML, you should use concordionExtender.withResource() rather than concordionExtender.withLinkedCSS() to avoid a duplicate declaration.

If you'd prefer to embed the CSS in the HTML, use concordionExtender.withEmbeddedCSS(). Similar methods exist for including JavaScript in the output, or you can use withResource() to copy images or other resources to the output.