mirror of
https://github.com/wavetermdev/wails.git
synced 2026-08-05 13:53:43 -07:00
feat: optimize documentation website (#1849)
* fix(website): fix i18n configuration * feat: add i18n file to auto generate code * feat: move the crowdin configuration file to the website directory * feat(website): add crowdin dependencies and scripts * feat: add COC * feat: use escape hatch syntax to wrap JSX code in MDX files * feat: remove ach language * feat: generate default language configuration * feat: remove compare link * feat: add COC link * feat(website): update documentation * feat: use escape hatch syntax to wrap JSX code in MDX files * style: add prettier * style: format mdx files * chore: remove prettier command * feat: update en docs * feat: sync Chinese documents * feat: update doc * Update website/src/pages/coc.mdx Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
co-authored by
Lea Anthony
parent
d0a39349d4
commit
e9b2c15664
@@ -4,6 +4,7 @@ sidebar_position: 20
|
||||
|
||||
# Dogs API
|
||||
|
||||
```mdx-code-block
|
||||
<div class="text--center">
|
||||
<img
|
||||
src={require("@site/static/img/tutorials/dogsapi/img.webp").default}
|
||||
@@ -12,19 +13,22 @@ sidebar_position: 20
|
||||
/>
|
||||
</div>
|
||||
<br />
|
||||
```
|
||||
|
||||
:::note
|
||||
|
||||
This tutorial has been kindly provided by [@tatadan](https://twitter.com/tatadan) and forms part of
|
||||
their [Wails Examples Repository](https://github.com/tataDan/wails-v2-examples).
|
||||
|
||||
:::
|
||||
|
||||
In this tutorial we are going to develop an application that retrieves photos of dogs from the web
|
||||
In this tutorial we are going to develop an application that retrieves photos of dogs from the web
|
||||
and then displays them.
|
||||
|
||||
### Create the project
|
||||
|
||||
Let's create the application. From a terminal enter:
|
||||
```wails init -n dogs-api -t svelte```
|
||||
Let's create the application. From a terminal enter:
|
||||
`wails init -n dogs-api -t svelte`
|
||||
|
||||
Note: We could optionally add `-ide vscode` or `-ide goland` to the end of this command if you wanted
|
||||
to add IDE support.
|
||||
@@ -151,6 +155,7 @@ import (
|
||||
|
||||
Add the following lines to `frontend/src/App.svelte`:
|
||||
|
||||
<!-- prettier-ignore-start -->
|
||||
```html
|
||||
<script>
|
||||
import { GetRandomImageUrl } from "../wailsjs/go/main/App.js";
|
||||
@@ -233,16 +238,12 @@ Add the following lines to `frontend/src/App.svelte`:
|
||||
}
|
||||
</style>
|
||||
```
|
||||
<!-- prettier-ignore-end -->
|
||||
|
||||
### Testing the application
|
||||
|
||||
To generate the bindings and test the application, run `wails dev`.
|
||||
|
||||
To generate the bindings and test the application, run `wails dev`.
|
||||
|
||||
### Compiling the application
|
||||
|
||||
To compile the application to a single, production grade binary, run `wails build`.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
To compile the application to a single, production grade binary, run `wails build`.
|
||||
|
||||
Reference in New Issue
Block a user