Skip to content

Commit fab8a95

Browse files
committed
Add notes about query args to plugin docs.
1 parent ad55aff commit fab8a95

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

hyperdiv_docs/pages/extending_hyperdiv/plugins.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,16 @@ class counter(hd.Plugin):
9696
registers the plugin with the Hyperdiv Javascript
9797
frontend. `counter.css` styles the plugin.
9898
99+
Query and hash args can be passed to plugin assets:
100+
101+
```py-nodemo
102+
class counter(hd.Plugin):
103+
_assets_root = os.path.join(os.path.dirname(__file__), "assets")
104+
_assets = ["counter.css?x=1", "counter.js?a=1&b=2"]
105+
106+
count = hd.Prop(hd.Int, 0)
107+
```
108+
99109
"""
100110
)
101111

@@ -149,6 +159,16 @@ class counter(hd.Plugin):
149159
"""
150160
)
151161

162+
with hd.alert(variant="warning", opened=True):
163+
hd.markdown(
164+
"""
165+
Note that when using glob syntax, query args cannot be
166+
meaningfully passed to local assets. `"js/**/*.js?x=1"` is
167+
nonsensical and will cause Hyperdiv to fail to correctly
168+
expand the glob.
169+
"""
170+
)
171+
152172
p.heading("### Remote Assets")
153173

154174
docs_markdown(

0 commit comments

Comments
 (0)