This formatter makes getting started with plugins easier, by generating a plugin template with an easy to use CLI. setup files, docker files and the plugin structure are generated for you.
Example usage:
```
plugin_from_template --name <gitlab-username> --plugin_name "My Indexer Plugin"
With the `plugin_from_template` CLI, you can easily create a plugin where all CI pipelines, docker files, and test setups are configured for you. Multiple templates are available, to see the complete list use:
`plugin_from_template --list_templates`
%% Cell type:code id:5c4df6b0 tags:
``` python
# export
@call_parse
defplugin_from_template(
list_templates:Param("List available plugin templates",store_true)=False,
user:Param("Your Gitlab username",str)=None,
repo_url:Param("The url of your empty Gitlab plugin repository",str)=None,
plugin_name:Param("Display name of your plugin",str)=None,
template_name:Param("Name of the template, see the Plugin Templates repository.")=None,
package_name:Param("Name of your plugin python package",str)=None,
description:Param("Description of your plugin",str)=None,
target_dir:Param("Directory to output the formatted template",str)=".",
):
iflist_templates:
print("Available templates:")
fortemplateinget_templates():
print(template)
return
iftemplate_nameisNone:
print("template name not defined, using the classifier_plugin template.")
template_name="classifier_plugin"
ifuserisNone:
print("Define your gitlab user name with `--user <username>`")
return
ifplugin_nameisNone:
print("Define your gitlab user name with `--plugin_name <name>`")
return
ifrepo_urlisNone:
print("Define your gitlab repository url with `--repo_url <url>`")