Browse Source

Fix minor doc issues (#1293)

Fix minor doc issues
Fabien Lelaquais 1 year ago
parent
commit
1c467adca3

+ 2 - 17
taipy/gui/_renderers/__init__.py

@@ -106,21 +106,6 @@ class _Renderer(Page, ABC):
         return text
 
     def set_content(self, content: str) -> None:
-        """Set a new page content.
-
-        Reads the new page content and reinitializes the `Page^` instance to reflect the change.
-
-        !!! important
-            This function can only be used in an IPython notebook context.
-
-        Arguments:
-            content (str): The text content or the path to the file holding the text to be transformed.
-                If *content* is a path to a readable file, the file is read entirely as the text
-                template.
-
-        Exceptions:
-            RuntimeError: If this method is called outside an IPython notebook context.
-        """
         if not _is_in_notebook():
             raise RuntimeError("'set_content()' must be used in an IPython notebook context")
         self.__process_content(content)
@@ -157,7 +142,7 @@ class Markdown(_Renderer):
     user interfaces.
 
     You can find details on the Taipy Markdown-specific syntax and how to add
-    Taipy Visual Elements in the [section on HTML](../gui/pages/index.md#using-markdown)
+    Taipy Visual Elements in the [section on Markdown](../gui/pages/markdown.md)
     of the User Manual.
     """
 
@@ -185,7 +170,7 @@ class Html(_Renderer):
     user interfaces.
 
     You can find details on HTML-specific constructs and how to add
-    Taipy Visual Elements in the [section on HTML](../gui/pages/index.md#using-html)
+    Taipy Visual Elements in the [section on HTML](../gui/pages/html.md)
     of the User Manual.
     """
 

+ 19 - 0
taipy/gui/page.py

@@ -88,6 +88,25 @@ class Page:
         """
         return None
 
+    def set_content(self, content: str) -> None:
+        """Set a new page content.
+
+        Reads the new page content and reinitializes the `Page^` instance to reflect the change.
+
+        !!! important
+            This function can only be used in an IPython notebook context.
+
+        Arguments:
+            content (str): The text content or the path to the file holding the text to be transformed.
+                If *content* is a path to a readable file, the file is read entirely as the text
+                template.
+
+        Exceptions:
+            RuntimeError: If this method is called outside an IPython notebook context.
+        """
+        # Implemented in the private _Renderer class
+        raise NotImplementedError("Not in a valid Page class.")
+
     def _get_locals(self) -> t.Optional[t.Dict[str, t.Any]]:
         return (
             self._class_locals

+ 11 - 0
taipy/gui/viselements.json

@@ -235,6 +235,12 @@
                         "default_value": "False",
                         "doc": "If set, this allows de-selection and the value is set to unselected_value."
                     },
+                    {
+                        "name": "unselected_value",
+                        "type": "any",
+                        "default_value": "None",
+                        "doc": "Value assigned to <i>value</i> when no item is selected."
+                    },
                     {
                         "name": "mode",
                         "type": "str",
@@ -1335,6 +1341,11 @@
                         "type": "str",
                         "doc": "The title of the menu."
                     },
+                    {
+                        "name": "inactive_ids",
+                        "type": "dynamic(str|list[str])",
+                        "doc": "Semicolon (';')-separated list or a list of menu items identifiers that are disabled."
+                    },
                     {
                         "name": "width",
                         "type": "str",

+ 6 - 7
tests/gui/builder/control/test_chat.py

@@ -34,8 +34,8 @@ def test_chat_builder_1(gui: Gui, test_client, helpers):
     expected_list = [
         "<Chat",
         'defaultUsers="[[&quot;Fred&quot;, &#x7B;&quot;path&quot;: &quot;/images/favicon.png&quot;, &quot;text&quot;: &quot;Fred.png&quot;&#x7D;], [&quot;Fredi&quot;, &#x7B;&quot;path&quot;: &quot;/images/fred.png&quot;, &quot;text&quot;: &quot;Fred.png&quot;&#x7D;]]"',  # noqa: E501
-        "messages={tpec_TpExPr_messages_TPMDL_0}",
-        'updateVarName="tpec_TpExPr_messages_TPMDL_0"',
+        "messages={_TpD_tpec_TpExPr_messages_TPMDL_0}",
+        "updateVarName=\"_TpD_tpec_TpExPr_messages_TPMDL_0\""
     ]
     helpers.test_control_builder(gui, page, expected_list)
 
@@ -60,10 +60,9 @@ def test_chat_builder_2(gui: Gui, test_client, helpers):
     expected_list = [
         "<Chat",
         'defaultUsers="[[&quot;Fred&quot;, &#x7B;&quot;path&quot;: &quot;/images/favicon.png&quot;, &quot;text&quot;: &quot;Fred.png&quot;&#x7D;], [&quot;Fredi&quot;, &#x7B;&quot;path&quot;: &quot;/images/fred.png&quot;, &quot;text&quot;: &quot;Fred.png&quot;&#x7D;]]"',  # noqa: E501
-        "messages={tpec_TpExPr_messages_TPMDL_0}",
-        'updateVarName="tpec_TpExPr_messages_TPMDL_0"',
-        "users={_TpL_tpec_TpExPr_users_TPMDL_0}",
-        'updateVars="users=_TpL_tpec_TpExPr_users_TPMDL_0"'
+        "messages={_TpD_tpec_TpExPr_messages_TPMDL_0}",
+        "updateVarName=\"_TpD_tpec_TpExPr_messages_TPMDL_0\"",
+        "users={_TpL_tp_TpExPr_gui_get_adapted_lov_users_list_TPMDL_0_0}",
+        "updateVars=\"users=_TpL_tp_TpExPr_gui_get_adapted_lov_users_list_TPMDL_0_0\""
     ]
     helpers.test_control_builder(gui, page, expected_list)
-