Skip to content

Commit fa88aa5

Browse files
committed
document homepage fn
1 parent d216874 commit fa88aa5

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/homepage.rs

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
1+
use crate::Request;
2+
3+
/// Add a new icon and/or widget to the Kinode homepage. Note that the process calling this
4+
/// function must have the `homepage:homepage:sys` messaging capability.
5+
///
6+
/// An icon must be a base64 encoded SVG.
7+
///
8+
/// A path will be automatically placed underneath the namespace of the process. For example,
9+
/// if the process is named `my:process:pkg`, and the path given is `/mypath`, the full path
10+
/// will be `my:process:pkg/mypath`.
11+
///
12+
/// A widget should be HTML: it will be displayed in an iframe.
113
pub fn add_to_homepage(label: &str, icon: Option<&str>, path: Option<&str>, widget: Option<&str>) {
2-
crate::Request::to(("our", "homepage", "homepage", "sys"))
14+
Request::to(("our", "homepage", "homepage", "sys"))
315
.body(
416
serde_json::json!({
517
"Add": {

0 commit comments

Comments
 (0)