5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-04 02:51:56 +08:00

Improve documentation

This commit is contained in:
Lea Anthony 2023-12-13 22:40:35 +11:00
parent 984db8620a
commit ea409a2cb2
No known key found for this signature in database
GPG Key ID: 33DAF7BB90A58405
7 changed files with 183 additions and 87 deletions

View File

@ -1,12 +1,13 @@
# Next Steps
Now that you have Wails installed, you can start exploring the alpha version.
Now that you have created your first application, you can start exploring the other features that v3 alpha provides.
## Examples
The best place to start is the `examples` directory in the Wails repository.
This contains a number of examples that you can run and play with.
## Running an example
To run an example, you can simply use:
```shell
@ -15,25 +16,5 @@ go run .
in the example directory.
The status of the examples is on the [roadmap](../roadmap.md).
## Creating a new project
To create a new project, you can use the `wails3 init` command. This will create
a new project in the current directory.
Wails3 uses [Task](https://taskfile.dev) as its build system by default,
although there is no reason why you can't use your own build system, or use
`go build` directly. Wails has the task build system built in and can be run
using `wails3 task`.
If you look through the `Taskfile.yaml` file, you will see that there are a
number of tasks defined. The most important one is the `build` task. This is the
task that is run when you use `wails3 build`.
The task file is unlikely to be complete and is subject to change over time.
## Building a project
To build a project, you can use the `wails3 build` command. This is a shortcut
for `wails3 task build`.
!!! note
Some examples may not work during alpha development.

View File

@ -0,0 +1,80 @@
# Your First Application
Creating your first application with Wails v3 Alpha is an exciting journey into the world of modern desktop app development. This guide will walk you through the process of creating a basic application, showcasing the power and simplicity of Wails.
## Prerequisites
Before you begin, ensure you have the following installed:
- Go (version 1.21 or later)
- Node.js (LTS version)
- Wails v3 Alpha (see the [installation guide](/getting-started/installation) for instructions)
## Step 1: Creating a New Project
Open your terminal and run the following command to create a new Wails project:
`wails3 init -n myfirstapp`
This command creates a new directory called `myfirstapp` with all the necessary files.
## Step 2: Exploring the Project Structure
Navigate to the `myfirstapp` directory. You'll find several files and folders:
- `build`: Contains files used by the build process.
- `frontend`: Contains your web frontend code.
- `go.mod` & `go.sum`: Go module files.
- `main.go`: The entry point for your Wails application.
- `Taskfile.yml`: Defines all the tasks used by the build system. Learn more at the [Task](https://taskfile.dev/) website.
Take a moment to explore these files and familiarize yourself with the structure.
!!! note
Although Wails v3 uses [Task](https://taskfile.dev/) as its default build system, there is nothing stopping you from using `make` or any other alternative build system.
## Step 3: Building Your Application
To build your application, execute:
`wails3 build`
This command compiles a debug version of your application and saves it in a new `bin` directory.
You can run this like you would any normal application:
=== "Mac"
`./bin/myfirstapp`
=== "Windows"
`bin\myfirstapp.exe`
=== "Linux"
`./bin/myfirstapp`
You'll see a simple UI, the starting point for your application. As it is the debug version, you'll also see logs in the console window. This is useful for debugging purposes.
## Step 4: Making Changes
Now, let's make a small change:
1. Open `frontend/main.js`.
2. Change the line that has `<h1>Hello Wails!</h1>` to `<h1>Hello World!</h1>`.
3. Save the file.
## Step 5: Building the Application Again
Once you're happy with your changes, build your application again:
`wails3 build`
You'll notice that the build time was faster this time. That's because the new build system only builds the parts of your application that have changed.
You should see a new executable in the `build` directory.
## Conclusion
Congratulations! You've just created and built your first Wails application. This is just the beginning of what you can achieve with Wails v3 Alpha. Explore the documentation, experiment with different features, and start building amazing applications!

View File

@ -1,5 +1,38 @@
---
template: home.en.html
---
# Home
Welcome to the Wails v3 Alpha documentation. This is your starting point for exploring the latest version of Wails, a powerful framework for building desktop applications using Go and modern web technologies.
## Introduction
Wails v3 Alpha is the latest iteration of the Wails project, bringing new features and improvements to make desktop application development more efficient and enjoyable. This version is still in alpha, so some features might change before the final release.
## What's New
Here are some of the exciting new features and improvements in Wails v3 Alpha:
- Multiple Windows
- System Trays
- Improved bindings generation
- Improved build system
- Improved events system
More information about these features and other changes can be found in the [What's new](/whats-new/) section.
## Getting Started
To get started with Wails v3 Alpha:
1. [Installation](/getting-started/installation/): Follow our simple guide to install Wails on your system.
2. [Create Your First Application](/getting-started/your-first-app/): Learn how to create your first Wails application with our step-by-step tutorial.
3. [Explore the API Reference](/API/): Dive deeper into the API documentation.
## Alpha Version Notice
Please note that this is an alpha version of Wails v3. Features may be added, removed, or changed in future updates. This version is intended for early adopters and those who wish to contribute to the development of Wails.
## Feedback and Contributions
Your feedback is vital to making Wails better. If you encounter any issues or have suggestions, please let us know through our [GitHub repository](https://github.com/wailsapp/wails). Contributions to the project are also welcome!
Thank you for trying out Wails v3 Alpha!
Welcome to The Wails Project

View File

@ -73,7 +73,7 @@ Examples:
**Bindings**:
{{ read_csv("alpha3-bindings.csv") }}
{{ read_csv("alpha3-bindings-callbyid.csv") }}
**Models**:

View File

@ -1,7 +1,6 @@
# What's new in v3?
# What's New in Wails v3 Alpha
!!! note The features that will be included in the v3 release may change from
this list.
Wails v3 Alpha moves from the v2's single-window, declarative API to a procedural one. This intuitive API makes code development easier, boosts readability, and unlocks complex multi-window apps. Wails v3 Alpha isn't just an improvement on past versions - it reimagines desktop application development capabilities with Go and modern web technologies.
## Multiple Windows
@ -335,3 +334,6 @@ An experimental feature to call runtime methods using plain html, similar to
</body>
</html>
```
## Examples
There are more examples available in the [examples](https://github.com/wailsapp/wails/tree/v3-alpha/v3/examples) directory. Check them out!

View File

@ -60,61 +60,61 @@ plugins:
default: true
name: English
build: true
- locale: zh
name: 简体中文
build: true
site_description: Wails 项目 - 使用 Go 构建美观的跨平台应用程序
extra:
announcement: 这些文档是自动生成的。 如有错误,请告知我们。
nav:
- 主页: index.md
- 入门:
# - 介绍: introduction.md
- 安装: getting-started/installation.md
# - 创建项目: getting-started/creating-a-project.md
# - 它是如何工作的: how-does-it-work.md
# - 开发您的应用程序: getting-started/developing-your-application.md
# - 编译您的项目: getting-started/compiling-your-project.md
# - API 参考:
# - 运行时:
# - 介绍: reference/runtime/introduction.md
# - CLI: reference/cli.md
# - 社区:
# - 模板: community/templates.md
# - 指南:
# - Angular: guides/angular.md
# - 展示:
# - Emaillit: community/showcase/emailit.md
# - 贡献: community/contributing.md
# - 链接: community/links.md
- 下一步: getting-started/next-steps.md
- 反馈: getting-started/feedback.md
- 反馈: getting-started/feedback.md
- v3 版本中的新内容是什么?: whats-new.md
- API:
- 应用程序: API/application.md
- 窗口: API/window.md
- 系统托盘: API/systray.md
- 菜单: API/menu.md
- 主线程: API/mainthread.md
- 完整 API: API/fullapi.md
- 开发:
- 介绍: development/introduction.md
- 状态: development/status.md
- v3 变更: development/changes.md
- 路线图: roadmap.md
- 更改日志: changelog.md
- 赞助❤️: https://github.com/sponsors/leaanthony
# - locale: zh
# name: 简体中文
# build: true
# site_description: Wails 项目 - 使用 Go 构建美观的跨平台应用程序
# extra:
# announcement: 这些文档是自动生成的。 如有错误,请告知我们。
# nav:
# - 主页: index.md
# - 入门:
# # - 介绍: introduction.md
# - 安装: getting-started/installation.md
# # - 创建项目: getting-started/creating-a-project.md
# # - 它是如何工作的: how-does-it-work.md
# # - 开发您的应用程序: getting-started/developing-your-application.md
# # - 编译您的项目: getting-started/compiling-your-project.md
# # - API 参考:
# # - 运行时:
# # - 介绍: reference/runtime/introduction.md
# # - CLI: reference/cli.md
# # - 社区:
# # - 模板: community/templates.md
# # - 指南:
# # - Angular: guides/angular.md
# # - 展示:
# # - Emaillit: community/showcase/emailit.md
# # - 贡献: community/contributing.md
# # - 链接: community/links.md
# - 下一步: getting-started/next-steps.md
# - 反馈: getting-started/feedback.md
# - 反馈: getting-started/feedback.md
# - v3 版本中的新内容是什么?: whats-new.md
# - API:
# - 应用程序: API/application.md
# - 窗口: API/window.md
# - 系统托盘: API/systray.md
# - 菜单: API/menu.md
# - 主线程: API/mainthread.md
# - 完整 API: API/fullapi.md
# - 开发:
# - 介绍: development/introduction.md
# - 状态: development/status.md
# - v3 变更: development/changes.md
# - 路线图: roadmap.md
# - 更改日志: changelog.md
# - 赞助❤️: https://github.com/sponsors/leaanthony
extra:
alternate:
- name: English
link: /
lang: en
- name: 简体中文
link: /zh/
lang: zh
# alternate:
# - name: English
# link: /
# lang: en
# - name: 简体中文
# link: /zh/
# lang: zh
social:
- icon: fontawesome/brands/github-alt
@ -148,6 +148,7 @@ nav:
# - Emaillit: community/showcase/emailit.md
# - Contributing: community/contributing.md
# - Links: community/links.md
- Your First Application: getting-started/your-first-app.md
- Next Steps: getting-started/next-steps.md
- Feedback: getting-started/feedback.md
- Feedback: getting-started/feedback.md

View File

@ -1,8 +1,7 @@
# v3
This directory is experimental. It probably won't work for you. There's no support for this directory. Dragons be here. You have been warned!
*NOTE*: The examples in this directory may or may not compile / run at any given time during alpha development.
The examples in this directory may or may not compile / run at any given time. But the general method to try them out is as follows:
## Running the examples