From 543b8df48becebfce0fb453cb13a51d98d0607e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?= Date: Tue, 24 Feb 2015 09:29:02 +0100 Subject: [PATCH] Extended documentation to include replace feature for plugin template components --- docs/plugins/index.rst | 1 + docs/plugins/templates.rst | 8 ++++++++ src/octoprint/plugin/types.py | 24 ++++++++++++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 docs/plugins/templates.rst diff --git a/docs/plugins/index.rst b/docs/plugins/index.rst index 76b0621a..b362f118 100644 --- a/docs/plugins/index.rst +++ b/docs/plugins/index.rst @@ -19,6 +19,7 @@ additional slicers. More plugin types are planned for the future. using.rst gettingstarted.rst infrastructure.rst + templates.rst distributing.rst mixins.rst hooks.rst diff --git a/docs/plugins/templates.rst b/docs/plugins/templates.rst new file mode 100644 index 00000000..c4547dfb --- /dev/null +++ b/docs/plugins/templates.rst @@ -0,0 +1,8 @@ +.. _sec-plugins-templates: + +Templates +========= + +.. todo:: + + Needs to be written. \ No newline at end of file diff --git a/src/octoprint/plugin/types.py b/src/octoprint/plugin/types.py index 9de7f04b..48d2b36a 100644 --- a/src/octoprint/plugin/types.py +++ b/src/octoprint/plugin/types.py @@ -201,6 +201,12 @@ class TemplatePlugin(Plugin): - Suffix to attach to the element ID of the injected template, will be ``_`` if not provided and not the first template of the type, with ``index`` counting from 1 and increasing for each template of the same type. + * - div + - Id for the div containing the component. If not provided, defaults to ``plugin_`` plus + the suffix if provided or required. + * - replaces + - Id of navbar component this one replaces, might be either one of the core components or a component + provided by another plugin. See :ref:`this section ` for more on replacing template components. * - custom_bindings - A boolean value indicating whether the default view model should be bound to the navbar entry (``false``) or if a custom binding will be used by the plugin (``true``, default). @@ -238,6 +244,12 @@ class TemplatePlugin(Plugin): - Suffix to attach to the element ID of the injected template, will be ``_`` if not provided and not the first template of the type, with ``index`` counting from 1 and increasing for each template of the same type. + * - div + - Id for the div containing the component. If not provided, defaults to ``plugin_`` plus + the suffix if provided or required. + * - replaces + - Id of sidebar component this one replaces, might be either one of the core components or a component + provided by another plugin. See :ref:`this section ` for more on replacing template components. * - custom_bindings - A boolean value indicating whether the default view model should be bound to the sidebar container (``false``) or if a custom binding will be used by the plugin (``true``, default). @@ -279,6 +291,12 @@ class TemplatePlugin(Plugin): - Suffix to attach to the element ID of the injected template, will be ``_`` if not provided and not the first template of the type, with ``index`` counting from 1 and increasing for each template of the same type. + * - div + - Id for the div containing the component. If not provided, defaults to ``plugin_`` plus + the suffix if provided or required. + * - replaces + - Id of tab component this one replaces, might be either one of the core components or a component + provided by another plugin. See :ref:`this section ` for more on replacing template components. * - custom_bindings - A boolean value indicating whether the default view model should be bound to the tab pane and link in the navigation (``false``) or if a custom binding will be used by the plugin (``true``, default). @@ -320,6 +338,12 @@ class TemplatePlugin(Plugin): - Suffix to attach to the element ID of the injected template, will be ``_`` if not provided and not the first template of the type, with ``index`` counting from 1 and increasing for each template of the same type. + * - div + - Id for the div containing the component. If not provided, defaults to ``plugin_`` plus + the suffix if provided or required. + * - replaces + - Id of settings component this one replaces, might be either one of the core components or a component + provided by another plugin. See :ref:`this section ` for more on replacing template components. * - custom_bindings - A boolean value indicating whether the default settings view model should be bound to the settings pane and link in the navigation (``false``) or if a custom binding will be used by the plugin (``true``, default).