Skip to content

Commit 6b0886b

Browse files
committed
Docs: Updated formatting
1 parent 2472362 commit 6b0886b

File tree

17 files changed

+474
-217
lines changed

17 files changed

+474
-217
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ These libraries are different modules of ProzillaOS that can be installed separa
2525

2626
- [`prozilla-os`][prozilla-os]: A bundle containing the core packages and all standard applications of ProzillaOS
2727
- [`@prozilla-os/core`][core]: Core functionality, React components and hooks
28-
- [`@prozilla-os/skins`](./shared/): Customizable skins for ProzillaOS
28+
- [`@prozilla-os/skins`][skins]: Customizable skins for ProzillaOS
2929
- [`@prozilla-os/shared`][shared]: Shared functions and utilities
3030

3131
#### Standard applications
@@ -127,6 +127,7 @@ These resources can help you get started with ProzillaOS.
127127
[prozilla]: https://prozilla.dev/
128128
[prozilla-os]: ./packages/prozilla-os/
129129
[core]: ./packages/core/
130+
[skins]: ./packages/skins/
130131
[shared]: ./packages/shared/
131132
[file-explorer]: ./packages/apps/file-explorer/
132133
[terminal]: ./packages/apps/terminal/

packages/README.md

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,13 @@
1-
<div align="center">
2-
<br />
3-
<p>
4-
<a href="https://os.prozilla.dev/"><img src="https://os.prozilla.dev/assets/banner-logo-title-small.png" width="576" alt="ProzillaOS" /></a>
5-
</p>
6-
<p>
7-
<a href="https://github.com/prozilla-os/ProzillaOS/blob/main/LICENSE.md"><img alt="License" src="https://img.shields.io/github/license/Prozilla/ProzillaOS?style=flat-square&color=FF4D5B&label=License"></a>
8-
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Stars" src="https://img.shields.io/github/stars/Prozilla/ProzillaOS?style=flat-square&color=FED24C&label=%E2%AD%90"></a>
9-
<a href="https://github.com/prozilla-os/ProzillaOS"><img alt="Forks" src="https://img.shields.io/github/forks/Prozilla/ProzillaOS?style=flat-square&color=4D9CFF&label=Forks&logo=github"></a>
10-
<a href="https://www.npmjs.com/package/prozilla-os"><img alt="NPM Version" src="https://img.shields.io/npm/v/prozilla-os?logo=npm&style=flat-square&label=prozilla-os&color=FF4D5B"></a>
11-
</p>
12-
</div>
13-
14-
## Packages
15-
16-
### Libraries (public)
1+
# Packages
2+
3+
## Libraries (public)
174

185
- [`prozilla-os`](./prozilla-os/): A bundle containing the core packages and all standard applications of ProzillaOS
196
- [`@prozilla-os/core`](./core/): Core functionality, React components and hooks
20-
- [`@prozilla-os/skins`](./shared/): Customizable skins for ProzillaOS
7+
- [`@prozilla-os/skins`](./skins/): Customizable skins for ProzillaOS
218
- [`@prozilla-os/shared`](./shared/): Shared functions and utilities
229

23-
#### Standard applications
10+
### Standard applications
2411

2512
- [`@prozilla-os/file-explorer`](./apps/file-explorer/): File explorer app
2613
- [`@prozilla-os/terminal`](./apps/terminal/): Terminal/shell app
@@ -30,11 +17,11 @@
3017
- [`@prozilla-os/browser`](./apps/browser/): Browser app
3118
- [`@prozilla-os/calculator`](./apps/calculator/): Calculator app
3219

33-
#### Non-standard applications
20+
### Non-standard applications
3421

3522
- [`@prozilla-os/logic-sim`](./apps/logic-sim/): Logic simulator app
3623

37-
### Sites (internal)
24+
## Sites (internal)
3825

3926
- [`@prozilla-os/demo`](./demo/): Demo site
4027
- [`@prozilla-os/docs`](./docs/): Documentation site
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<template>
2+
<div v-if="frontmatter.package">
3+
<Badge class="package" type="info">
4+
<a title="Package" target="_blank" :href="`https://www.npmjs.com/package/${frontmatter.package}`">{{ frontmatter.package }}</a>
5+
</Badge>
6+
</div>
7+
</template>
8+
9+
<script setup>
10+
import { useData } from "vitepress";
11+
12+
const { frontmatter } = useData();
13+
</script>
14+
15+
<style scoped>
16+
.package {
17+
font-size: 1rem;
18+
margin-bottom: 32px;
19+
}
20+
21+
.package > a {
22+
color: inherit;
23+
text-decoration: none;
24+
vertical-align: super;
25+
white-space: nowrap;
26+
}
27+
</style>

packages/docs/.vitepress/theme/index.ts

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
import { h } from "vue";
33
import type { Theme } from "vitepress";
44
import DefaultTheme from "vitepress/theme";
5+
import PackageBadge from "./PackageBadge.vue";
56
import "./style.css";
67

78
export default {
89
extends: DefaultTheme,
9-
Layout: () => {
10+
Layout() {
1011
return h(DefaultTheme.Layout, null, {
11-
// https://vitepress.dev/guide/extending-default-theme#layout-slots
12+
"doc-before": () => h(PackageBadge)
1213
});
13-
},
14-
enhanceApp({ app, router, siteData }) {
15-
// ...
1614
}
1715
} satisfies Theme;

packages/docs/.vitepress/theme/style.css

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
.custom-block {
276276
border: none;
277277
border-left: 5px solid;
278+
padding: 12px 12px 6px;
278279
}
279280

280281
.custom-block > .custom-block-title {
@@ -313,6 +314,14 @@
313314
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 512 512'%3E%3Cpath d='M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z'/%3E%3C/svg%3E")
314315
}
315316

317+
.custom-block ul {
318+
margin: 8px 0;
319+
}
320+
321+
.custom-block li + li {
322+
margin-top: 4px;
323+
}
324+
316325
.VPContent.is-home .vp-doc {
317326
margin: 0;
318327
padding: 0;
@@ -338,4 +347,4 @@
338347

339348
.vp-doc .VPTeamMembers.medium.count-1.center .container {
340349
max-width: 368px !important;
341-
}
350+
}
Lines changed: 121 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
---
22
outline: deep
33
description: "An application that can be run by ProzillaOS"
4+
package: "@prozilla-os/core"
45
---
56

67
# Class [`App`](https://github.com/prozilla-os/ProzillaOS/blob/main/packages/core/src/features/system/configs/app.tsx)
78

8-
An application that can be run by ProzillaOS
9+
{{ $frontmatter.description }}
910

1011
Applications can be installed by adding them to the `apps` array in [`AppsConfig`](../system/apps-config#apps-app)
1112

@@ -19,117 +20,192 @@ Applications can be installed by adding them to the `apps` array in [`AppsConfig
1920
2021
### Parameters
2122

22-
- **name** : `string`
23+
<br>
2324

24-
- **id** : `string`
25+
#### name
2526

26-
- **windowContent** : `React.FC<AppProps>`
27+
- **Type:** `string`
2728

28-
- **windowOptions** : `object` (optional)
29+
#### id
2930

30-
- windowOptions.size : [`Vector2`](/reference/classes/utils/vector2)
31+
- **Type:** `string`
32+
33+
#### windowContent
34+
35+
- **Type:** `React.FC<AppProps>`
36+
37+
#### windowOptions
38+
39+
- **Optional**
40+
- **Type:** `WindowOptions`
41+
42+
```ts
43+
interface WindowOptions {
44+
size?: Vector2;
45+
[key: string]: unknown;
46+
}
47+
```
48+
49+
> [!NOTE] References
50+
> - [Vector2](../utils/vector2)
3151
3252
## Properties
3353

34-
### name : `string` {#name}
54+
### name
55+
56+
- **Type:** `string`
57+
- **Default:** `"App"`
3558

3659
The display name of this application
3760

38-
> **@default**
39-
> ```ts
40-
> "App"
41-
> ```
61+
### id
4262

43-
### id : `string` {#id}
63+
- **Type:** `string`
64+
- **Default:** `"app"`
4465

4566
The unique ID of this application
4667

47-
> **@default**
48-
> ```ts
49-
> "app"
50-
> ```
51-
5268
> [!WARNING]
5369
> Every app must have a unique ID that only contains lower case letters (a-z), numbers (0-9) and dashes (-).
5470
55-
### windowContent : `React.FC<AppProps>` {#window-content}
71+
### windowContent
72+
73+
- **Type:** `React.FC<AppProps>`
5674

5775
React component that renders this app inside a window when the app is running
5876

59-
### windowOptions : `object` {#window-options}
77+
### windowOptions
78+
79+
- **Type:** `WindowOptions`
6080

6181
Default options that get passed to the `windowContent` component
6282

63-
You can extend this object with any properties
83+
```ts
84+
interface WindowOptions {
85+
size?: Vector2;
86+
[key: string]: unknown;
87+
}
88+
```
6489

65-
#### Properties
90+
> [!NOTE] References
91+
> - [Vector2](../utils/vector2)
6692
67-
- windowOptions.size : [`Vector2`](/reference/classes/utils/vector2)
93+
### description
6894

69-
### description : `string | null` {#description}
95+
- **Type:** `string | null`
7096

7197
Description of this application
7298

73-
### iconUrl : `string | null` {#icon-url}
99+
### iconUrl
100+
101+
- **Type:** `string | null`
74102

75103
URL of the icon of this application
76104

77-
### role : `string | null` {#role}
105+
### role
106+
107+
- **Type:** `string | null`
78108

79109
Defines what parts of the OS this app is responsible for and how it can be used by other apps
80110

81-
### associatedExtensions : `string[]` {#associated-extensions}
111+
### associatedExtensions
112+
113+
- **Type:** `string | null`
82114

83115
An array of file extensions that this application is used to open and read
84116

85-
### pinnedByDefault : `boolean` {#pinned-by-default}
117+
### pinnedByDefault
118+
119+
- **Type:** `boolean`
120+
- **Default:** `true`
86121

87122
Determines whether the app is pinned by default
88123

89-
> **@default**
90-
> ```ts
91-
> true
92-
> ```
124+
### launchAtStartup
93125

94-
### launchAtStartup : `boolean` {#launch-at-startup}
126+
- **Type:** `boolean`
127+
- **Default:** `false`
95128

96129
Determines whether the app is launched at startup
97130

98-
> **@default**
99-
> ```ts
100-
> false
101-
> ```
102-
103131
## Methods
104132

105-
### setName (name : `string`) => `this` {#set-name}
133+
### setName(name)
134+
135+
- **Parameters**
136+
- **name**
137+
- **Type:** `string`
138+
- **Returns**
139+
- **Type:** `this`
106140

107141
Set the display name of this application
108142

109-
### setDescription (description : `string | null`) => `this` {#set-description}
143+
### setDescription(description)
144+
145+
- **Parameters**
146+
- **description**
147+
- **Type:** `string`
148+
- **Returns**
149+
- **Type:** `this`
110150

111151
Set the description of this application
112152

113-
### setIconUrl (iconUrl : `string | null`) => `this` {#set-icon-url}
153+
### setIconUrl(iconUrl)
154+
155+
- **Parameters**
156+
- **iconUrl**
157+
- **Type:** `string | null`
158+
- **Returns**
159+
- **Type:** `this`
114160

115161
Set the URL of the icon of this application
116162

117-
### setRole (role : `string | null`) => `this` {#set-role}
163+
### setRole(role)
164+
165+
- **Parameters**
166+
- **role**
167+
- **Type:** `string | null`
168+
- **Returns**
169+
- **Type:** `this`
118170

119171
Set the role of this application
120172

121-
### setAssociatedExtensions (extensions : `string[] | null`) => `this` {#set-associated-extensions}
173+
### setAssociatedExtensions(extensions)
174+
175+
- **Parameters**
176+
- **extensions**
177+
- **Type:** `string[] | null`
178+
- **Returns**
179+
- **Type:** `this`
122180

123181
Set the associated extensions of this application
124182

125-
### setPinnedByDefault (pinnedByDefault : `boolean`) => `this` {#set-pinned-by-default}
183+
### setPinnedByDefault(pinnedByDefault)
184+
185+
- **Parameters**
186+
- **pinnedByDefault**
187+
- **Type:** `boolean`
188+
- **Returns**
189+
- **Type:** `this`
126190

127191
Changes whether this application is pinned by default or not
128192

129-
### setLaunchAtStartup (launchAtStartup : `boolean`) => `this` {#set-launch-at-startup}
193+
### setLaunchAtStartup(launchAtStartup)
194+
195+
- **Parameters**
196+
- **launchAtStartup**
197+
- **Type:** `boolean`
198+
- **Returns**
199+
- **Type:** `this`
130200

131201
Changes whether this application is launched at startup or not
132202

133-
### WindowContent (props : `AppProps`) => `React.ReactElement` {#Window-content}
203+
### WindowContent(props)
204+
205+
- **Parameters**
206+
- **props**
207+
- **Type:** `AppProps`
208+
- **Returns**
209+
- **Type:** `React.ReactElement`
134210

135211
Renders the app as a React component

0 commit comments

Comments
 (0)