Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Vic Shóstak committed Jan 6, 2024
1 parent e5d4a76 commit 2292671
Show file tree
Hide file tree
Showing 18 changed files with 290 additions and 195 deletions.
13 changes: 5 additions & 8 deletions docs/.vitepress/config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ const userConfig: UserConfig = {
collapsed: false,
items: [
{ text: 'Установка', link: '/ru/complete-user-guide/installation' },
{ text: 'Info about your system', link: '/ru/complete-user-guide/info-about-system' },
{ text: 'Создание нового проекта', link: '/ru/complete-user-guide/create-new-project' },
{ text: 'Запуск проекта', link: '/ru/complete-user-guide/run-your-project' },
]
Expand Down Expand Up @@ -131,6 +132,7 @@ const userConfig: UserConfig = {
collapsed: false,
items: [
{ text: '安装', link: '/zh_HK/complete-user-guide/installation' },
{ text: 'Info about your system', link: '/zh_HK/complete-user-guide/info-about-system' },
{ text: '创建新项目', link: '/zh_HK/complete-user-guide/create-new-project' },
{ text: '运行项目', link: '/zh_HK/complete-user-guide/run-your-project' },
]
Expand Down Expand Up @@ -192,6 +194,7 @@ const userConfig: UserConfig = {
collapsed: false,
items: [
{ text: 'Instalación', link: '/es/complete-user-guide/installation' },
{ text: 'Info about your system', link: '/es/complete-user-guide/info-about-system' },
{ text: 'Crear un nuevo proyecto', link: '/es/complete-user-guide/create-new-project' },
{ text: 'Ejecute su proyecto', link: '/es/complete-user-guide/run-your-project' },
]
Expand Down Expand Up @@ -255,21 +258,15 @@ const userConfig: UserConfig = {
collapsed: false,
items: [
{ text: 'Installation', link: '/complete-user-guide/installation' },
{ text: 'Info about your system', link: '/complete-user-guide/info-about-system' },
{ text: 'Create a new project', link: '/complete-user-guide/create-new-project' },
{ text: 'Run your project', link: '/complete-user-guide/run-your-project' },
]
}
]
},
socialLinks: [
{ icon: 'github', link: 'https://github.com/gowebly/gowebly' },
{
icon: {
svg: '<svg width="32" height="32" viewBox="0 0 32 32" xmlns="http://www.w3.org/2000/svg"><path d="m30.679 13.367c-.613-.404-1.366-.645-2.175-.645-.093 0-.185.003-.276.009l.012-.001c-.446.001-.882.041-1.306.115l.046-.007c-.235-1.357-1.025-2.495-2.122-3.191l-.019-.011-.429-.248-.282.408c-.336.512-.599 1.108-.756 1.745l-.008.039c-.089.324-.14.696-.14 1.08 0 .831.24 1.605.654 2.258l-.01-.017c-.637.299-1.381.488-2.164.524h-.013-19.729c-.516.001-.934.418-.936.933-.001.056-.001.123-.001.19 0 1.751.317 3.428.897 4.977l-.032-.098c.558 1.633 1.612 2.975 2.98 3.881l.028.017c1.744.903 3.808 1.432 5.995 1.432.207 0 .412-.005.617-.014l-.029.001h.06c1.272 0 2.515-.121 3.72-.352l-.123.02c1.795-.336 3.395-.939 4.845-1.773l-.074.039c1.257-.735 2.331-1.621 3.245-2.652l.012-.014c1.325-1.56 2.403-3.381 3.145-5.365l.041-.125h.276c.055.002.119.004.183.004 1.226 0 2.34-.481 3.163-1.265l-.002.002c.377-.358.676-.793.873-1.281l.009-.024.122-.359zm-26.889 1.482h2.646c.127-.001.23-.104.23-.231v-2.355-.001c0-.127-.103-.23-.23-.231h-2.646c-.127.001-.23.104-.23.231v2.356.001c0 .127.103.23.23.23h.001zm3.644 0h2.644c.127 0 .231-.103.231-.231v-2.355-.001c0-.127-.103-.23-.23-.231h-2.646c-.128 0-.232.104-.232.232v2.355c.001.128.104.231.232.231zm3.698 0h2.646c.127-.001.23-.104.23-.231v-2.355-.001c0-.127-.103-.23-.23-.231h-2.646c-.127.001-.23.104-.23.231v2.356c0 .127.103.231.231.231zm3.656 0h2.643c.128 0 .231-.103.232-.231v-2.355c0-.128-.104-.232-.232-.232h-2.643c-.127 0-.231.103-.231.231v2.356.001c0 .127.103.23.23.23zm-7.354-3.388h2.644c.128-.001.231-.104.231-.232v-2.355c0-.127-.103-.231-.231-.231h-2.644c-.128 0-.231.103-.232.231v2.355c.001.128.104.231.232.232zm3.698 0h2.646c.127-.001.23-.105.23-.232v-2.355c0-.127-.103-.231-.231-.231h-2.643c-.127 0-.231.103-.231.231v2.355c.001.128.103.231.231.232zm3.656 0h2.643c.128-.001.231-.104.232-.232v-2.355c-.001-.128-.104-.231-.232-.231h-2.643c-.127 0-.231.103-.231.231v2.355c0 .128.103.231.231.232zm0-3.388h2.643c.128 0 .232-.104.232-.232v-2.356c-.001-.128-.104-.231-.232-.231h-2.643c-.127 0-.231.103-.231.231v2.356.001c0 .127.103.23.23.23h.001zm3.687 6.776h2.644c.128 0 .231-.103.232-.231v-2.355c0-.128-.104-.232-.232-.232h-2.644c-.128 0-.231.103-.231.231v2.356c0 .127.103.231.231.231z"/></svg>'
},
link: 'https://hub.docker.com/r/gowebly/gowebly',
ariaLabel: 'docker hub'
}
{ icon: 'github', link: 'https://github.com/gowebly/gowebly' }
],
footer: {
message: "<a href='https://github.com/gowebly/gowebly' target='_blank'>Gowebly</a> CLI is 100% free and Open Source project under the Apache 2.0 license.<br/>Official logo distributed under the Creative Commons License (CC BY-SA 4.0 International).",
Expand Down
74 changes: 35 additions & 39 deletions docs/complete-user-guide/create-new-project.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,51 +10,16 @@ gowebly create
```bash [Go]
go run github.com/gowebly/gowebly@latest create
```

```bash [Docker]
docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} gowebly/gowebly:latest create
```
:::

<img width="100%" alt="gowebly create" src="https://raw.githubusercontent.com/gowebly/.github/main/images/gowebly_create.gif"/>

## What CLI does for you?

Every time you execute the `create` command for a project, the **Gowebly** CLI does the following under the hood:

| Step | Description |
| :---: | ------------------------------------------------------------------------------------------------------------------ |
| **1** | **Structure of your project** |
| | CLI creates the project folders and all needed miscellaneous files |
| **2** | **The backend part of your project** |
| | CLI generates the backend files (`go.mod`, chosen Go framework files, and so on) |
| | CLI runs `go mod tidy` and `go fmt` for the first time |
| **3** | **The frontend part of your project** |
| | CLI generates the `scripts.js` file with importing the chosen reactivity library |
| | CLI generates the `styles.scss` file with minimal styles for the chosen CSS framework |
| | CLI generates the needed utility files (`package.json`, config for the chosen CSS framework, and so on) |
| | CLI runs `install` and `build` scripts from the `package.json` file with the chosen JavaScript runtime environment |
And result will be:

For visualization of the **Gowebly** CLI workflow, check the diagram:

```mermaid
stateDiagram-v2
Structure: Generate project structure
Backend: Prepare backend part
Frontend: Prepare frontend part
direction LR
[*] --> Structure
Structure --> Backend
Backend --> Frontend
Frontend --> [*]
```

## Project structure after creating
<img width="100%" alt="gowebly create" src="https://raw.githubusercontent.com/gowebly/.github/main/images/gowebly_create.gif"/>

Typically, after running the `create` command, a created project contains the following files and folders:
Typically, the created project contains the following files and folders:

::: code-group
```bash{18,19} [Without template engines]
```bash{18,19} [Using html/template]
.
├── assets
│ ├── scripts.js
Expand Down Expand Up @@ -131,4 +96,35 @@ Typically, after running the `create` command, a created project contains the fo
Please do **not** edit `*_templ.go` Go files in the `./templates` folder of your project! They're auto-generated by the **Templ** CLI from `*.templ` templates.
:::

## What CLI does for you?

Every time you execute the `create` command for a project, the **Gowebly** CLI does the following under the hood:

| Step | Description |
| :---: | ---------------------------------------------------------------------------------------------------------------- |
| **1** | **The structure of your project** |
| | CLI creates the project folders and all needed miscellaneous files |
| **2** | **The backend part of your project** |
| | CLI generates the backend files (`go.mod`, chosen Go framework files, and so on) |
| | CLI runs `go mod tidy` and `go fmt` for the first time |
| **3** | **The frontend part of your project** |
| | CLI generates the `scripts.js` file with importing the chosen reactivity library |
| | CLI generates the `styles.scss` file with minimal styles for the chosen CSS framework |
| | CLI generates the needed utility files (`package.json`, config for the chosen CSS framework, and so on) |
| | CLI runs `install` and `build` scripts from the `package.json` file with the chosen frontend runtime environment |

To visualize the workflow, please refer to the diagram:

```mermaid
stateDiagram-v2
Structure: Generate project structure
Backend: Prepare backend part
Frontend: Prepare frontend part
direction LR
[*] --> Structure
Structure --> Backend
Backend --> Frontend
Frontend --> [*]
```

<!--@include: ../parts/links.md -->
36 changes: 36 additions & 0 deletions docs/complete-user-guide/info-about-system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Info about your system

To view information about your system, execute the `doctor` command:

::: code-group
```bash [CLI]
gowebly doctor
```

```bash [Go]
go run github.com/gowebly/gowebly@latest doctor
```
:::

And result will be:

```
✓ Your system information has been collected successfully!
│ Copy this information to paste into an issue ↘
│ Gowebly CLI: v2.0.1 (build with go1.21.5 on darwin/arm64)
│ Go: 1.21.5 darwin/arm64
│ Node.js version: 21.5.0 (npm 10.2.4)
│ Bun version: 1.0.21
│ Is Air tool installed? true
│ Is Templ package installed? true
✱ For more information go to the official docs: https://gowebly.org
```

<!--@include: ../parts/links.md -->
12 changes: 0 additions & 12 deletions docs/complete-user-guide/installation.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,6 @@ Then, use the [`go install`][go_install_url] command:
go install github.com/gowebly/gowebly@latest
```

## Docker

Feel free to using **Gowebly** CLI from our [official Docker image][docker_gowebly_image_url] and run it in the container:

``` bash
docker pull gowebly/gowebly:latest
```

::: danger Limitations of the Docker image
This Docker image works **only** on the GNU/Linux systems (`amd64` or `arm64`, including WSL).
:::

## Homebrew

GNU/Linux and Apple macOS users available way to install **Gowebly** CLI via [Homebrew][other_brew_url].
Expand Down
32 changes: 17 additions & 15 deletions docs/complete-user-guide/run-your-project.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
---
next:
text: 'FAQ'
link: '/faq'
---

# Run your project

To run your project in a development mode, execute the `run` command:
Expand All @@ -10,27 +16,23 @@ gowebly run
```bash [Go]
go run github.com/gowebly/gowebly@latest run
```

```bash [Docker]
docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} gowebly/gowebly:latest run
```
:::

## What CLI does for you?

Every time you execute the `run` command for a project, the **Gowebly** CLI does the following under the hood:

| Step | Description |
| :---: | ------------------------------------------------------------------------ |
| **1** | **Start Air tool** |
| | CLI runs your project with live-reloading mode in a simple `air` command |
| **2** | **Live-reloading mode** |
| | Air tool builds frontend part of your project in production mode |
| | Air tool generates Go functions from `*.templ` templates, if needed |
| | Air tool builds the backend part of your project |
| | Air tool watches for changes in your project files and rebuilds them |

For visualization of the **Gowebly** CLI workflow, check the diagram:
| Step | Description |
| :---: | ------------------------------------------------------------------------------------- |
| **1** | **Start Air tool** |
| | CLI runs your project with live-reloading mode in a simple `air -c .air.toml` command |
| **2** | **Live-reloading mode** |
| | Air tool builds frontend part of your project in production mode |
| | Air tool generates Go functions from `*.templ` templates, if needed |
| | Air tool builds the backend part of your project |
| | Air tool watches for changes in your project files and rebuilds them |

To visualize the workflow, please refer to the diagram:

```mermaid
stateDiagram-v2
Expand Down
36 changes: 36 additions & 0 deletions docs/es/complete-user-guide/info-about-system.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Info about your system

To view information about your system, execute the `doctor` command:

::: code-group
```bash [CLI]
gowebly doctor
```

```bash [Go]
go run github.com/gowebly/gowebly@latest doctor
```
:::

And result will be:

```
✓ Your system information has been collected successfully!
│ Copy this information to paste into an issue ↘
│ Gowebly CLI: v2.0.1 (build with go1.21.5 on darwin/arm64)
│ Go: 1.21.5 darwin/arm64
│ Node.js version: 21.5.0 (npm 10.2.4)
│ Bun version: 1.0.21
│ Is Air tool installed? true
│ Is Templ package installed? true
✱ For more information go to the official docs: https://gowebly.org
```

<!--@include: ../parts/links.md -->
8 changes: 0 additions & 8 deletions docs/es/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,23 +19,15 @@ Esto se muestra más claramente en el siguiente diagrama:
stateDiagram-v2
direction LR
Install: Instalar CLI
Init: Inicializar configuración
Doctor: Ver diagnósticos
Create: Crear un nuevo proyecto
Run: Ejecutar proyecto
Build: Construir proyecto
Deploy: Despliegue en el servidor
[*] --> Install
Install --> Init
Install --> Create
Install --> Doctor
Doctor --> [*]
Init --> Create
Create --> Run
Run --> [*]
Create --> Build
Build --> Deploy
Deploy --> [*]
```

<!--@include: ../parts/links.md-->
35 changes: 6 additions & 29 deletions docs/faq.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
---
prev:
text: 'Complete user guide'
link: '/complete-user-guide'
next:
text: 'Troubleshooting'
link: '/troubleshooting'
Expand All @@ -12,7 +15,7 @@ The most common questions that may come up when using the **Gowebly** CLI are co

## What is the right way to ask a question or report a bug?

Running the `doctor` command will give you a list of all the CLI tools that are installed on your system:
Running the `doctor` command will give you a list of all the tools you need to work properly with the **Gowebly** CLI that are installed on your system:

::: code-group
``` bash [CLI]
Expand All @@ -22,10 +25,6 @@ gowebly doctor
``` bash [Go]
go run github.com/gowebly/gowebly@latest doctor
```

``` bash [Docker]
docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} gowebly/gowebly:latest doctor
```
:::

Next, open [GitHub Issues][repo_issues_url] and follow the instructions.
Expand All @@ -34,33 +33,11 @@ Next, open [GitHub Issues][repo_issues_url] and follow the instructions.
Don't forget to include output of the `doctor` command to the issue description! This is a very helpful information for the debugging process.
:::

## How to change the default configuration?

You can change the default configuration in the `.gowebly.yml` file.

Create the `.gowebly.yml` file in the root of your project:

::: code-group
``` bash [CLI]
gowebly init
```

``` bash [Go]
go run github.com/gowebly/gowebly@latest init
```

``` bash [Docker]
docker run --rm -it -v ${PWD}:${PWD} -w ${PWD} gowebly/gowebly:latest init
```
:::

Change the settings to your needs and `create`, `run` or `build` your project as usual.

## Is it possible to see a demonstration of how the CLI works without installation?

Yes, of course! :smile: To give you a visual understanding of the project, we have recorded a short demonstration video on YouTube:
Yes, of course! :smile: To give you a visual understanding of the project, we have recorded a short demonstration GIF for `gowebly create` command:

<iframe width="100%" height="380" src="https://www.youtube-nocookie.com/embed/qazYscnLku4?si=GQSiQS0Aaib-T6zD&amp;controls=0" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" allowfullscreen></iframe>
<img width="100%" alt="gowebly create" src="https://raw.githubusercontent.com/gowebly/.github/main/images/gowebly_create.gif"/>

## Where else can I read something about the CLI?

Expand Down
Loading

0 comments on commit 2292671

Please sign in to comment.