Documenting your plugin
This guide covers what you need to document when writing a plugin.
A plugin must include a documentation file that covers how to use the plugin. The documentation will be available from within Funnelback and also the plugin marketplace. Documentation must be written in markdown and supplied as a single
readme.md file at the root of the plugin bundle.
At a minimum, the documentation must cover:
How to enable the plugin
Configuring the plugin
Examples on how to test and see that the plugin is working correctly
Where to go for help
The example markdown file below documents the
# Plugin: title-prefix-plugin This plugin cleans search result titles by replacing the start of a title which matches a pattern with a provided pattern. If a replacement is not provided, it will remove the matching part of the title. ## Usage Add the following to your results page configuration to enable the plugin. ```ini plugin.title-prefix-plugin.enabled=true plugin.title-prefix-plugin.version=1.0 ``` The following results page settings can be used to configure the plugin: * `plugin.title-prefix-plugin.config.pattern`: Pattern to look for at the start of each result title * `plugin.title-prefix-plugin.config.replaceWith`: (Optional) Text to replace the pattern with If `replaceWith` is not provided, then matching patterns will be removed. For example, if you were to set the following settings in `collection.cfg`: ```ini plugin.title-prefix-plugin.config.pattern=Product Documentation | plugin.title-prefix-plugin.config.replaceWith=Funnelback Documentation v16 | ``` On any search results for that results page, titles which begin with `'Product Documentation |'` will now start with `'Funnelback Documentation v16'` instead.
The next tutorial covers how to write unit tests to test your plugin.