You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[Deprecate plugins or arguments](#deprecate-plugins-or-arguments)
16
15
17
16
## Creating a new plugin
18
17
@@ -644,7 +643,7 @@ Example of auto-built documentation for `webviz-config` can be seen
644
643
Plugins can be marked as deprecated by using the `@deprecated_plugin(short_message, long_message)` decorator.
645
644
646
645
```python
647
-
from ..webviz_deprecated import deprecated_plugin
646
+
from webviz_config.webviz_deprecated import deprecated_plugin
648
647
649
648
650
649
@deprecated_plugin("This message is shown to the end user in the app.", "This message is shown in the documentation of the plugin.")
@@ -653,27 +652,37 @@ class MyPlugin(WebvizPluginABC):
653
652
```
654
653
655
654
Plugin arguments can be marked as deprecated by using the `@deprecated_plugin_arguments(check={})` decorator in front of the `__init__` function.
656
-
Arguments can either be marked as deprecated in any case (MyPluginExample1) or their values can be checked within a function (MyPluginExample2)
657
-
which returns a tuple containing a short string shown to the end user in the app and a long string shown in the plugin's documentation.
655
+
Arguments can either be marked as deprecated in any case (see `MyPluginExample1`) or their values can be checked within a function (see `MyPluginExample2`) which returns a tuple containing a short string shown to the end user in the app and a long string shown in the plugin's documentation.
658
656
659
657
```python
660
658
from typing import Optional, Tuple
661
-
from ..webviz_deprecated import deprecated_plugin_arguments
659
+
from webviz_config.webviz_deprecated import deprecated_plugin_arguments
662
660
663
661
664
662
class MyPluginExample1(WebvizPluginABC):
665
663
...
666
-
@deprecated_plugin_arguments(check={"arg3": ("This message is shown to the end user in the app.", "This message is shown in the documentation of the plugin.")})
664
+
@deprecated_plugin_arguments(
665
+
{
666
+
"arg3": (
667
+
"Short message shown to the end user both in the app and documentation.",
668
+
(
669
+
"This can be a long message, which is shown only in the documentation, explaining "
670
+
"e.g. why it is deprecated and which plugin should be used instead."
0 commit comments