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
@@ -25,7 +32,7 @@ properties of newly added submenus can be freely chosen.
25
32
|`visible_when`|`flask_menu.menu.CONDITION_TRUE`| when to show this submenu<br />- must be of type `callable[[], bool]`<br />- `CONDITION_TRUE` is just a named `lambda: True`<br />- use `CONDITION_FALSE` to hide a submenu |
26
33
| ... | ... | in addtion to the above properties, all arguments for `flask_menu.menu:MenuNode.register` are configurable |
27
34
28
-
For an example consider the user-dashboard pictured above.
35
+
For example, consider the user-dashboard pictured above.
29
36
Its *Uploads* submenu has the following default configuration:
30
37
```python
31
38
{
@@ -42,9 +49,9 @@ Its *Uploads* submenu has the following default configuration:
42
49
Existing menus can be extended by custom-configured submenus.
43
50
To add a new submenu to an existing menu:
44
51
45
-
1.get the name of the to-be-added-to menu from the [list of menus](#list-of-menus)
52
+
1.Get the name of the to-be-added-to menu from the [list of menus](#list-of-menus)
46
53
For example, the user-dashboard is named `"dashboard"` (most names of menus/submenus are straightforward).
47
-
2.write a function that registers the new submenu
54
+
2.Write a function that registers the new submenu
48
55
```python
49
56
# ext.py # ext.py is commonly used, you may use another file though
50
57
@@ -67,9 +74,9 @@ To add a new submenu to an existing menu:
67
74
68
75
...# could .register more submenus here (or do so in another package)
69
76
```
70
-
3.have the endpoint `invenio_base.finalize_app`point at your function
71
-
This will make your function be called at the app-finalization build-step.
72
-
For example, when using setuptools' `setup.cfg` with your python-package, add:
77
+
3.Register your function with the `invenio_base.finalize_app`entrypoint.
78
+
This will make your function be called at the app-finalization build-step.
79
+
For example, when using setuptools' `setup.cfg` with your pythonpackage, add:
73
80
```ini
74
81
# setup.cfg
75
82
@@ -82,8 +89,7 @@ To add a new submenu to an existing menu:
82
89
For entrypoint changes to be picked up, you will need to reinstall the python package.
83
90
*This is necessary even if the package is installed editably!*
84
91
85
-
!!! info "Have you tried to turn it off and on again?"
86
-
After entrypoint changes were picked up,
92
+
After entrypoint changes are picked up,
87
93
you will further need to restart the server for changes to take effect:
88
94
```shell
89
95
<CTRL+C>
@@ -95,12 +101,12 @@ To add a new submenu to an existing menu:
95
101
The defaults of submenus' properties are selectively overridable via config-variables.
96
102
To modify an existing submenu's properties:
97
103
98
-
1.find the name of the corresponding override-variable in the [list of menus](#list-of-menus)
104
+
1.Find the name of the corresponding override-variable in the [list of menus](#list-of-menus)
99
105
For example, the override-variable for the user-dashboard is named `USER_DASHBOARD_MENU_OVERRIDES`.
100
-
2.find the name of the to-be-overridden submenu in that same [list of menus](#list-of-menus)
106
+
2.Find the name of the to-be-overridden submenu in that same [list of menus](#list-of-menus)
101
107
For example, the user-dashboard has a submenu for communities.
102
108
This submenu is named (obviously enough) `"communities"`.
0 commit comments