Skip to content

Commit 5bb9c87

Browse files
committed
update doc; update side panel
1 parent 9343de1 commit 5bb9c87

19 files changed

+38
-58
lines changed

bun.lockb

0 Bytes
Binary file not shown.

data/doc/0.description.md

+1-3
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ Way-Edges is an application written in Rust for Wayland users, widgets can seaml
66

77
- 💻 Do not take up any screen space, better for small screens
88
- ⚙️ Provide presets for audio, screen brightness, system information...
9-
- 🦅 Relative size, edge, anchor, margin customization, you can arrange your widgets more freely
10-
- 🚫 Take in account of `exlusize zone` to calculate relative size (Experimental & need support for each compositor specific)
9+
- 🦅 Relative size, edge, anchor, margin customization, arrange your widgets.
1110
- 📦 Grouping widgets
12-
- 💬 Some Error and Info gets send into desktop notification daemon, no need to go through tons of logs.
1311
- ⚡ Written in Rust (?)
1412

1513
## 🥢 Requirements

data/doc/2.cmd.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ way-edges togglepin <group_name>:<widget_name>
6363

6464
Most of the widgets support `pin`, use `group name` + `:` + `widget name` to toggle a widget's pin state.
6565

66-
## Shell completions
66+
## 🚀 Shell completions
6767

6868
### Bash
6969

@@ -76,12 +76,12 @@ Else then you'll have to copy the `https://github.com/way-edges/way-edges/blob/m
7676
For other shell, you'll have to generate it on your own:
7777

7878
```shell
79-
$ COMPLETE=zsh way-edges
79+
COMPLETE=zsh way-edges
8080
```
8181

8282
But there might be some issues generating completions after colon, you can either find a way and modify the script on your own, or submit an issue on GitHub.
8383

84-
### _AS A REMINDER_:
84+
### _AS A REMINDER_
8585

8686
current clap version: 4.5.20
8787
current clap-complete version: 4.5.36

data/doc/3.basic_config.md

+15-18
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ _Example:_
8181
"type": "string",
8282
"enum": ["top", "bottom", "background", "overlay"]
8383
},
84-
"margin": {
84+
"margins": {
8585
"type": "object",
8686
"properties": {
8787
"top": {
@@ -98,12 +98,9 @@ _Example:_
9898
}
9999
}
100100
},
101-
"monitor_id": {
102-
"type": "integer",
103-
"minimum": 0
104-
},
105-
"monitor_name": {
106-
"type": "string"
101+
"monitor": {
102+
"type": ["integer", "string"],
103+
"default": 0
107104
},
108105
"widget": {
109106
"$ref": "#/definitions/AllWidgets"
@@ -116,25 +113,25 @@ _Example:_
116113

117114
Array of widget items. If multiple widgets pile up, the last one in array gets to be on the top.
118115

119-
| Name | Description |
120-
| ----------------------- | -------------------------------------------------------------------- |
121-
| name | Name of the widget, needed with `togglepin` |
122-
| edge | Edge of the screen, `top/bottom/left/right` |
123-
| position | Ancher of the edge, `top/bottom \|\| left/right` |
124-
| layer | Layer of the shell (window), `top/bottom/background/overlay` |
125-
| margin | Support relative number ("24%"), `top/bottom/left/right` |
126-
| monitor_id/monitor_name | Monitor index, or the description of the monitor, index start from 0 |
127-
| widget | the actual widget, goto `widgets` |
116+
| Name | Description |
117+
| -------- | ----------------------------------------------------------------------- |
118+
| name | Name of the widget, needed with `togglepin` |
119+
| edge | Edge of the screen, `top/bottom/left/right` |
120+
| position | Ancher of the edge, `top/bottom \|\| left/right` |
121+
| layer | Layer of the shell (window), `top/bottom/background/overlay` |
122+
| margins | Support relative number ("24%"), `top/bottom/left/right` |
123+
| monitor | Monitor index, or the connector name of the monitor, index start from 0 |
124+
| widget | the actual widget, goto `widgets` |
128125

129126
_Example:_
130127

131128
```json
132129
{
133130
"edge": "top",
134131
"position": "left",
135-
// "monitor_id": 1,
132+
// "monitor": "eDP-1",
136133
"layer": "overlay",
137-
"margin": {
134+
"margins": {
138135
"left": "25%"
139136
},
140137
"widget": {

data/doc/4.widgets/0.button.md

-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ _Example:_
1212
"edge": "top",
1313
"position": "left",
1414
"layer": "overlay",
15-
"margin": {
16-
"left": "25%"
17-
},
1815
"widget": {
1916
"type": "btn",
2017
"width": 15,

data/doc/4.widgets/3.microphone.md

+1-4
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,6 @@ _Example:_
1111
"edge": "top",
1212
"position": "left",
1313
"layer": "overlay",
14-
"margin": {
15-
"left": "12.5%"
16-
},
1714
"widget": {
1815
"type": "microphone",
1916
"width": 20,
@@ -46,7 +43,7 @@ Empty to use default source.
4643
_TO FIND SOURCE NAMES:_
4744

4845
```shell
49-
$ pactl list sources | grep Name:
46+
pactl list sources | grep Name:
5047
```
5148

5249
_Type: `null | string`_

data/doc/4.widgets/4.backlight.md

-3
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@ _Example:_
99
"edge": "top",
1010
"position": "right",
1111
"layer": "overlay",
12-
"margin": {
13-
"right": "12.5%"
14-
},
1512
"widget": {
1613
"type": "backlight",
1714
"width": 20,
File renamed without changes.
File renamed without changes.
File renamed without changes.

data/doc/4.widgets/index.md

+4-19
Original file line numberDiff line numberDiff line change
@@ -28,29 +28,14 @@
2828

2929
- `btn` - Button
3030
- `slide` - Slide
31-
- `speaker` - Speaker
32-
- `microphone` - Microphone
33-
- `backlight` - Backlight
31+
- `speaker` - Speaker
32+
- `microphone` - Microphone
33+
- `backlight` - Backlight
3434
- `box` - Box
3535
- `ring` - Ring (_Provide presets_)
3636
- `text` - Text (_Provide presets_)
37+
- `hyprland-workspace` - Hyprland workspace
3738

3839
## In Plan
3940

40-
- Hyprland workspace
4141
- Tray
42-
43-
## Example
44-
45-
```json
46-
{
47-
"widget": {
48-
// `type` is the most important
49-
"type": "backlight"
50-
// "width": 20,
51-
// "height": "12.5%",
52-
// "frame_rate": 60,
53-
// "fg_color": "#82AAFF"
54-
}
55-
}
56-
```

data/meta.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"title":"🤷 What is this","name":"description","children":[],"path":"/doc/0.description.md","name_path":"description"},{"title":"📥 Installation","name":"installation","children":[],"path":"/doc/1.installation.md","name_path":"installation"},{"title":"⌨️ Command line usage","name":"cmd","children":[],"path":"/doc/2.cmd.md","name_path":"cmd"},{"title":"⚙️ Configuration","name":"basic_config","children":[],"path":"/doc/3.basic_config.md","name_path":"basic_config"},{"title":"🧱 Widgets","name":"widgets","children":[{"title":"Button","name":"button","children":[],"path":"/doc/4.widgets/0.button.md","name_path":"widgets/button"},{"title":"Slide","name":"slide","children":[],"path":"/doc/4.widgets/1.slide.md","name_path":"widgets/slide"},{"title":"Speaker","name":"speaker","children":[],"path":"/doc/4.widgets/2.speaker.md","name_path":"widgets/speaker"},{"title":"Microphone","name":"microphone","children":[],"path":"/doc/4.widgets/3.microphone.md","name_path":"widgets/microphone"},{"title":"Backlight","name":"backlight","children":[],"path":"/doc/4.widgets/4.backlight.md","name_path":"widgets/backlight"},{"title":"Box","name":"box","children":[],"path":"/doc/4.widgets/5.box.md","name_path":"widgets/box"},{"title":"Ring","name":"ring","children":[],"path":"/doc/4.widgets/6.ring.md","name_path":"widgets/ring"},{"title":"Text","name":"text","children":[],"path":"/doc/4.widgets/7.text.md","name_path":"widgets/text"},{"title":"Hyprland Workspace","name":"hyprland-workspace","children":[],"path":"/doc/4.widgets/8.hyprland-workspace.md","name_path":"widgets/hyprland-workspace"}],"path":"/doc/4.widgets/index.md","name_path":"widgets"}]
1+
[{"title":"🤷 What is this","name":"description","children":[],"path":"/doc/0.description.md","name_path":"description"},{"title":"📥 Installation","name":"installation","children":[],"path":"/doc/1.installation.md","name_path":"installation"},{"title":"⌨️ Command line usage","name":"cmd","children":[],"path":"/doc/2.cmd.md","name_path":"cmd"},{"title":"⚙️ Configuration","name":"basic_config","children":[],"path":"/doc/3.basic_config.md","name_path":"basic_config"},{"title":"🧱 Widgets","name":"widgets","children":[{"title":"Button","name":"button","children":[],"path":"/doc/4.widgets/0.button.md","name_path":"widgets/button"},{"title":"Slide","name":"slide","children":[],"path":"/doc/4.widgets/1.slide.md","name_path":"widgets/slide"},{"title":"Speaker","name":"speaker","children":[],"path":"/doc/4.widgets/2.speaker.md","name_path":"widgets/speaker"},{"title":"Microphone","name":"microphone","children":[],"path":"/doc/4.widgets/3.microphone.md","name_path":"widgets/microphone"},{"title":"Backlight","name":"backlight","children":[],"path":"/doc/4.widgets/4.backlight.md","name_path":"widgets/backlight"},{"title":"Box","name":"box","children":[{"title":"Ring","name":"ring","children":[],"path":"/doc/4.widgets/5.box/0.ring.md","name_path":"box/ring"},{"title":"Text","name":"text","children":[],"path":"/doc/4.widgets/5.box/1.text.md","name_path":"box/text"}],"path":"/doc/4.widgets/5.box/index.md","name_path":"widgets/box"},{"title":"Hyprland Workspace","name":"hyprland-workspace","children":[],"path":"/doc/4.widgets/6.hyprland-workspace.md","name_path":"widgets/hyprland-workspace"}],"path":"/doc/4.widgets/index.md","name_path":"widgets"}]

src/app/widgets/ring/page.tsx src/app/box/ring/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { readFileSync } from 'fs'
55
import '@/app/md.css'
66

77
export default async function Page() {
8-
const path = get_file_under_data('/doc/4.widgets/6.ring.md')
8+
const path = get_file_under_data('/doc/4.widgets/5.box/0.ring.md')
99
const content = readFileSync(path).toString()
1010
return (
1111
<MarkdownContent content={content} />

src/app/widgets/text/page.tsx src/app/box/text/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { readFileSync } from 'fs'
55
import '@/app/md.css'
66

77
export default async function Page() {
8-
const path = get_file_under_data('/doc/4.widgets/7.text.md')
8+
const path = get_file_under_data('/doc/4.widgets/5.box/1.text.md')
99
const content = readFileSync(path).toString()
1010
return (
1111
<MarkdownContent content={content} />

src/app/root.css

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
:root {
2+
interpolate-size: allow-keywords;
3+
}
14
* {
25
box-sizing: border-box;
36
transition: all 1s ease;

src/app/widgets/box/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { readFileSync } from 'fs'
55
import '@/app/md.css'
66

77
export default async function Page() {
8-
const path = get_file_under_data('/doc/4.widgets/5.box.md')
8+
const path = get_file_under_data('/doc/4.widgets/5.box/index.md')
99
const content = readFileSync(path).toString()
1010
return (
1111
<MarkdownContent content={content} />

src/app/widgets/hyprland-workspace/page.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { readFileSync } from 'fs'
55
import '@/app/md.css'
66

77
export default async function Page() {
8-
const path = get_file_under_data('/doc/4.widgets/8.hyprland-workspace.md')
8+
const path = get_file_under_data('/doc/4.widgets/6.hyprland-workspace.md')
99
const content = readFileSync(path).toString()
1010
return (
1111
<MarkdownContent content={content} />

src/widgets/toc/common.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,17 @@ export const Collapse = ({ content, index }: CollapseProps) => {
3737
list: {
3838
...list_style.list,
3939
height: `${list_ref.current!.scrollHeight}px`,
40+
// height: null,
4041
},
4142
switch: {
4243
rotate: '90deg',
4344
},
4445
})
46+
let on_transition_end = () => {
47+
list_ref.current!.style.height = 'auto'
48+
list_ref.current!.removeEventListener('transitionend', on_transition_end)
49+
}
50+
list_ref.current!.addEventListener('transitionend', on_transition_end)
4551
} else {
4652
set_list_style({
4753
list: {

0 commit comments

Comments
 (0)