Skip to content
This repository was archived by the owner on Nov 23, 2022. It is now read-only.

Commit b459453

Browse files
committed
chore(docs): update intro, relay, deploy relay and move changelog
1 parent 8c0b8b9 commit b459453

File tree

10 files changed

+590
-564
lines changed

10 files changed

+590
-564
lines changed

docs/docs/deploy-relay.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ It is accesible here: https://relay.dstack.dev
1313

1414
You can check status and uptime here: https://status.dstack.dev
1515

16-
[![Better Uptime Badge](https://betteruptime.com/status-badges/v1/monitor/d3wq.svg)](https://betteruptime.com/?utm_source=status_badge)
17-
1816
---
1917

2018
Docker is only maintained way to run relay

docs/docs/intro.mdx

Lines changed: 49 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,14 @@ or Shard API to share temporary/preview files or structured data between clients
1919

2020
For example, you can create a collaborative real-time WYSIWYG editor with file preview support where all events and file previews are handled without your server infrastructure.
2121

22+
<details>
23+
24+
<summary> WYSIWYG Demo </summary>
25+
2226
![Demo](https://i.imgur.com/cKjBrge.gif)
2327

28+
</details>
29+
2430
## Play with DStack in browser console
2531

2632
https://explorer.dstack.dev/
@@ -46,16 +52,51 @@ npm i -S @dstack-js/lib
4652

4753
### Initialize Stack
4854

55+
<Tabs>
56+
<TabItem value="public-relay" label="Public Relay">
57+
58+
```javascript
59+
import { Stack } from '@dstack-js/lib';
60+
61+
console.log('My Peer ID is:', stack.id);
62+
```
63+
64+
</TabItem>
65+
<TabItem value="custom-relay" label="Custom Relay">
66+
67+
```javascript
68+
import { Stack } from '@dstack-js/lib';
69+
70+
const stack = await Stack.create({
71+
namespace: 'namespace',
72+
relay: 'https://relay.dstack.dev:443/graphql'
73+
});
74+
75+
console.log('My Peer ID is:', stack.id);
76+
```
77+
78+
</TabItem>
79+
80+
<TabItem value="non-browser" label="Non-browser environment">
81+
4982
```javascript
5083
import { Stack } from '@dstack-js/lib';
51-
// In non-browser environment you need to provide WebRTC implementation
52-
// import wrtc from '@dstack-js/wrtc';
53-
// const stack = await Stack.create({ namespace: 'namespace', wrtc });
54-
const stack = await Stack.create({ namespace: 'namespace' });
84+
import wrtc from '@dstack-js/wrtc';
85+
86+
const stack = await Stack.create({
87+
namespace: 'namespace',
88+
wrtc
89+
});
5590

5691
console.log('My Peer ID is:', stack.id);
5792
```
5893

94+
</TabItem>
95+
</Tabs>
96+
97+
98+
99+
59100
### Interact with PubSub
60101

61102
```javascript
@@ -79,10 +120,13 @@ const shard = await stack.store.get('hello');
79120

80121
## Tell others that you use DStack
81122

82-
Badge:
123+
Here is an badge for you:
83124

84125
[![dstack](https://dstack.dev/img/badge.svg)](https://dstack.dev)
85126

86127
```markdown
87128
[![dstack](https://dstack.dev/img/badge.svg)](https://dstack.dev)
88129
```
130+
---
131+
132+
We are searching for projects who are interested to use DStack in production to collect feedback, bug reports and feature requests, [you can apply here](https://6l3fibt6mac.typeform.com/to/NZL0qDN2)

docs/docs/relay.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ It is accesible here: https://relay.dstack.dev
1616

1717
You can check status and uptime here: https://status.dstack.dev
1818

19-
[![Better Uptime Badge](https://betteruptime.com/status-badges/v1/monitor/d3wq.svg)](https://betteruptime.com/?utm_source=status_badge)
20-
2119
## Getting Bootstrap data
2220

2321
As of version v0.2.46 no need to bootstrap

docs/docusaurus.config.js

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
// @ts-check
2-
// Note: type annotations allow type checking and IDEs autocompletion
3-
const darkCodeTheme = require('prism-react-renderer/themes/vsDark');
42

53
/** @type {import('@docusaurus/types').DocusaurusConfig} */
64
module.exports = {
@@ -46,24 +44,22 @@ module.exports = {
4644
indexName: 'dstack',
4745
},
4846
announcementBar: {
49-
id: 'announcement',
47+
id: '2022-q1',
5048
content:
51-
'<a style="text-decoration: none; color: white" href="https://savelife.in.ua/">Support Ukraine <img width="14px" src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" /></a>',
49+
'<a style="text-decoration: none; color: white" href="https://savelife.in.ua/">Support Ukraine <img width="14px" src="https://upload.wikimedia.org/wikipedia/commons/4/49/Flag_of_Ukraine.svg" /></a> | <a style="color: white" href="/blog/2022-Q1">What\'s new in DStack 2022-Q1</a>',
5250
backgroundColor: 'black',
5351
textColor: 'white',
5452
isCloseable: true,
5553
},
5654
colorMode: {
57-
defaultMode: 'dark',
58-
disableSwitch: true,
59-
respectPrefersColorScheme: false,
55+
respectPrefersColorScheme: true,
56+
},
57+
prism: {
58+
theme: require('prism-react-renderer/themes/github'),
59+
darkTheme: require('prism-react-renderer/themes/dracula'),
6060
},
6161
navbar: {
6262
title: 'DStack',
63-
logo: {
64-
alt: 'DStack Logo',
65-
src: 'img/logo.svg',
66-
},
6763
items: [
6864
{
6965
type: 'doc',
@@ -73,7 +69,7 @@ module.exports = {
7369
},
7470
{ to: '/blog', label: 'Blog', position: 'left' },
7571
{
76-
href: '/changelog',
72+
href: 'https://github.com/dstack-js/dstack/blob/main/CHANGELOG.md',
7773
label: 'Changelog',
7874
position: 'right',
7975
},
@@ -150,9 +146,5 @@ module.exports = {
150146
],
151147
copyright: `Copyright © ${new Date().getFullYear()} <a href="https://github.com/dstack-js/dstack/graphs/contributors">DStack Contributors</a>`,
152148
},
153-
prism: {
154-
theme: darkCodeTheme,
155-
darkTheme: darkCodeTheme,
156-
},
157149
}),
158150
};

docs/package.json

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
]
1313
},
1414
"dependencies": {
15-
"@docusaurus/core": "2.0.0-beta.17",
16-
"@docusaurus/preset-classic": "2.0.0-beta.17",
17-
"@mdx-js/react": "1.6.22",
18-
"clsx": "1.1.1",
19-
"prism-react-renderer": "1.3.1",
20-
"react": "17.0.2",
21-
"react-dom": "17.0.2",
22-
"usehooks-ts": "^2.4.2"
15+
"@docusaurus/core": "latest",
16+
"@docusaurus/preset-classic": "latest",
17+
"@mdx-js/react": "^1.6.22",
18+
"clsx": "^1.1.1",
19+
"markdown-to-jsx": "^7.1.7",
20+
"prism-react-renderer": "^1.2.1",
21+
"react": "^17.0.1",
22+
"react-dom": "^17.0.1"
2323
},
2424
"devDependencies": {
25-
"@docusaurus/module-type-aliases": "2.0.0-beta.17",
25+
"@docusaurus/module-type-aliases": "latest",
2626
"@tsconfig/docusaurus": "^1.0.4",
2727
"typescript": "^4.6.2"
2828
},

docs/src/css/custom.css

Lines changed: 30 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -4,55 +4,44 @@
44
* work well for content-centric websites.
55
*/
66

7-
/* You can override the default Infima variables here. */
87
:root {
9-
--docusaurus-btt-color: black;
10-
--ifm-color-primary: #fcf9e8;
11-
--ifm-color-primary-dark: rgb(33, 175, 144);
12-
--ifm-color-primary-darker: rgb(31, 165, 136);
13-
--ifm-color-primary-darkest: rgb(26, 136, 112);
14-
--ifm-color-primary-light: rgb(70, 203, 174);
15-
--ifm-color-primary-lighter: rgb(102, 212, 189);
16-
--ifm-color-primary-lightest: rgb(146, 224, 208);
17-
--ifm-code-font-size: 95%;
18-
--ifm-navbar-link-color: black;
19-
--ifm-link-color: #d8d2b5;
20-
--ifm-color-primary: #fcf9e8;
21-
--ifm-navbar-shadow: none;
22-
--ifm-color-secondary: white;
23-
--ifm-footer-background-color: black;
24-
--ifm-hover-overlay: black;
25-
--ifm-navbar-link-hover-color: gray;
26-
--ifm-font-color-base-inverse: black;
27-
--ifm-background-color: black;
28-
--ifm-background-surface-color: black;
29-
--ifm-navbar-link-hover-color: rgba(0, 0, 0, 0.9);
30-
}
31-
32-
.docusaurus-highlight-code-line {
33-
background-color: rgba(0, 0, 0, 0.1);
34-
display: block;
35-
margin: 0 calc(-1 * var(--ifm-pre-padding));
36-
padding: 0 var(--ifm-pre-padding);
37-
}
38-
39-
html[data-theme='dark'] .docusaurus-highlight-code-line {
40-
background-color: rgba(0, 0, 0, 0.3);
8+
--ifm-color-primary: #201b21;
9+
--ifm-color-primary-dark: #1d181e;
10+
--ifm-color-primary-darker: #1b171c;
11+
--ifm-color-primary-darkest: #161317;
12+
--ifm-color-primary-light: #231e24;
13+
--ifm-color-primary-lighter: #251f26;
14+
--ifm-color-primary-lightest: #2a232b;
15+
--ifm-background-color: #fffefa;
16+
--ifm-footer-background-color: var(--ifm-background-color);
4117
}
4218

43-
.clean-btn > svg {
19+
.hero {
20+
background-color: #fcf9e8;
4421
color: black;
4522
}
4623

47-
.footer {
48-
background-color: black;
24+
[data-theme='dark'] {
25+
--ifm-color-primary: #fcf9e8;
26+
--ifm-color-primary-dark: #f6eebd;
27+
--ifm-color-primary-darker: #f4e8a8;
28+
--ifm-color-primary-darkest: #ebd768;
29+
--ifm-color-primary-light: #ffffff;
30+
--ifm-color-primary-lighter: #ffffff;
31+
--ifm-color-primary-lightest: #ffffff;
32+
--ifm-background-color: #201b21;
33+
--ifm-footer-link-color: black;
4934
}
5035

51-
nav.navbar {
52-
background-color: #fcf9e8;
53-
color: black;
36+
.footer,
37+
.footer__copyright,
38+
.footer__title,
39+
.footer__link-item,
40+
.footer__copyright > a {
41+
background-color: var(--ifm-font-color-base-inverse);
42+
color: var(--ifm-font-color-base);
5443
}
5544

56-
.navbar-sidebar__brand > .navbar__brand {
57-
color: white;
45+
.clean-btn.close {
46+
color: var(--ifm-font-color-base);
5847
}

docs/src/pages/changelog.mdx

Lines changed: 0 additions & 9 deletions
This file was deleted.

docs/static/img/logo_dark.svg

Lines changed: 4 additions & 0 deletions
Loading

docs/static/img/logo_white.svg

Lines changed: 2 additions & 2 deletions
Loading

0 commit comments

Comments
 (0)