Skip to content

Commit ab0b616

Browse files
committed
chore: update docs and adds screenshots
1 parent ea91802 commit ab0b616

12 files changed

+47
-34
lines changed

generate-docs.js

+8-9
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
11
/**
22
* Requires jsdoc and jsdoc-to-markdown
33
*/
4-
4+
55
/* eslint-disable no-console */
6-
const fs = require('fs')
7-
const path = require('path')
8-
const glob = require('glob')
9-
const { execSync } = require('child_process');
6+
import fs from 'fs';
7+
8+
import path from 'path';
9+
import glob from 'glob';
10+
import { execSync } from 'child_process';
1011

1112
/**
1213
* Runs through packages folders looking for JSDoc and generates markdown docs
1314
*/
1415
function generateDocs() {
1516
console.log('Generating package docs')
1617
// Use glob to get all js/ts files
17-
const pathPattern = path.join(__dirname, './lib/**/*.[jt]s?(x)')
18+
const pathPattern = path.join(process.cwd(), './lib/**/*.[jt]s?(x)')
1819
const filePaths = glob.sync(pathPattern, {
1920
ignore: [
2021
'**/node_modules/**',
@@ -25,16 +26,14 @@ function generateDocs() {
2526
],
2627
})
2728

28-
console.log(filePaths)
29-
3029
for(const file of filePaths) {
3130
const { base: fileName } = path.parse(file);
3231

3332
const relativePath = path.relative(process.cwd(), file);
3433
const markdown = execSync(`./node_modules/.bin/jsdoc2md ${relativePath}`);
3534

3635
const writeDir = path.join(
37-
__dirname,
36+
process.cwd(),
3837
`website/docs/api/${relativePath.replace(fileName, '')}`,
3938
)
4039

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
"eslint": "^8.11.0",
6161
"eslint-plugin-jest": "^26.1.1",
6262
"jest": "^27.5.1",
63-
"jsdoc": "^3.5.4",
63+
"jsdoc": "^3.6.10",
6464
"jsdoc-to-markdown": "^7.1.1",
6565
"pkg": "^5.5.2"
6666
},

website/docs/api/_category_.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
label: API

website/docs/api/lib/helpers/util.js.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,18 @@
44

55
* [lib/helpers/util](#module_lib/helpers/util)
66
* _static_
7-
* [.mk(directory)](#module_lib/helpers/util.mk) ⇒ <code>Promise</code>
7+
* [.mk](#module_lib/helpers/util.mk) ⇒ <code>Promise</code>
88
* _inner_
99
* [~getPort()](#module_lib/helpers/util..getPort) ⇒ <code>Promise</code>
1010
* [~hash(length)](#module_lib/helpers/util..hash) ⇒ <code>String</code>
1111
* [~contains(arr, contains)](#module_lib/helpers/util..contains) ⇒ <code>Boolean</code>
1212

1313
<a name="module_lib/helpers/util.mk"></a>
1414

15-
### lib/helpers/util.mk(directory) ⇒ <code>Promise</code>
15+
### lib/helpers/util.mk ⇒ <code>Promise</code>
1616
makes a directory recursively
1717

18-
**Kind**: static method of [<code>lib/helpers/util</code>](#module_lib/helpers/util)
18+
**Kind**: static constant of [<code>lib/helpers/util</code>](#module_lib/helpers/util)
1919

2020
| Param | Type | Description |
2121
| --- | --- | --- |

website/docs/intro.md

+29-19
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,57 @@
11
---
22
sidebar_position: 1
3+
title: "Intro"
34
---
45

5-
# Tutorial Intro
6-
7-
Let's discover **Docusaurus in less than 5 minutes**.
8-
96
## Getting Started
107

11-
Get started by **creating a new site**.
8+
Firstly we must install `deploy.sh`.
129

13-
Or **try Docusaurus immediately** with **[docusaurus.new](https://docusaurus.new)**.
10+
```bash
11+
npm install deploy.sh -g
12+
```
1413

1514
### What you'll need
1615

1716
- [Node.js](https://nodejs.org/en/download/) version 14 or above:
1817
- When installing Node.js, you are recommended to check all checkboxes related to dependencies.
18+
- [Docker](https://docs.docker.com/get-docker/) is how deploy.sh runs and is required to start new applications
19+
- [Mongo](https://docs.mongodb.com/manual/administration/install-community/) is required to store application state and logs
1920

20-
## Generate a new site
21+
## Starting deploy.sh server
2122

22-
Generate a new Docusaurus site using the **classic template**.
23+
In order to deploy your applications you will need to spin up a deploy.sh server
2324

24-
The classic template will automatically be added to your project after you run the command:
25+
```bash
26+
deploy server
27+
```
2528

2629
```bash
27-
npm init docusaurus@latest my-website classic
30+
% deploy serve
31+
✔ Started 0 deployment(s) successfully
32+
⛅️ deploy.sh is running on port 5000
2833
```
2934

30-
You can type this command into Command Prompt, Powershell, Terminal, or any other integrated terminal of your code editor.
35+
## Start your site
3136

32-
The command also installs all necessary dependencies you need to run Docusaurus.
37+
In order to do anything you must first go through the registration process by running:
3338

34-
## Start your site
39+
```
40+
deploy register
41+
```
3542

36-
Run the development server:
43+
For this example I am going to use the folder in `examples/docker` in <https://github.com/gabrielcsapo/deploy.sh>.
3744

3845
```bash
39-
cd my-website
40-
npm run start
46+
deploy
4147
```
4248

43-
The `cd` command changes the directory you're working with. In order to work with your newly created Docusaurus site, you'll need to navigate the terminal there.
49+
![../static/img/intro/deploy.png](../static/img/intro/deploy.png)
4450

45-
The `npm run start` command builds your website locally and serves it through a development server, ready for you to view at http://localhost:3000/.
51+
To look at the logs from the docker container itself, simply run `deploy logs`
52+
53+
```bash
54+
deploy logs
55+
```
4656

47-
Open `docs/intro.md` (this page) and edit some lines: the site **reloads automatically** and displays your changes.
57+
![../static/img/intro/logs.png](../static/img/intro/logs.png)

website/docusaurus.config.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const config = {
99
title: 'deploy.sh',
1010
tagline: 'an open source continuous deployment service; deploying to the ☁️ shouldn\'t be 🚀🔬',
1111
url: 'https://gabrielcsapo.github.io',
12-
baseUrl: '/',
12+
baseUrl: '/gabrielcsapo/deploy.sh/',
1313
onBrokenLinks: 'throw',
1414
onBrokenMarkdownLinks: 'warn',
1515
favicon: 'img/favicon.ico',
@@ -19,7 +19,8 @@ const config = {
1919
[
2020
require.resolve("docusaurus-plugin-search-local"),
2121
{}
22-
]
22+
],
23+
require.resolve('docusaurus-plugin-image-zoom')
2324
],
2425
presets: [
2526
[
@@ -47,6 +48,7 @@ const config = {
4748
themeConfig:
4849
/** @type {import('@docusaurus/preset-classic').ThemeConfig} */
4950
({
51+
zoom: {},
5052
navbar: {
5153
title: 'deploy.sh',
5254
logo: {

website/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
"@docusaurus/preset-classic": "2.0.0-beta.17",
3131
"@mdx-js/react": "^1.6.22",
3232
"clsx": "^1.1.1",
33+
"docusaurus-plugin-image-zoom": "^0.0.2",
3334
"docusaurus-plugin-search-local": "^0.4.0",
3435
"prism-react-renderer": "^1.2.1",
3536
"react": "^17.0.1",

website/static/img/docusaurus.png

-5.02 KB
Binary file not shown.

website/static/img/intro/deploy.png

1.83 MB
Loading

website/static/img/intro/logs.png

1.81 MB
Loading
Binary file not shown.
-29.3 KB
Binary file not shown.

0 commit comments

Comments
 (0)