Просмотр исходного кода

docs(examples): add missing Readme and clarify existing (#3327)

Co-authored-by: Lucas Nogueira <lucas@tauri.studio>
Jacob 3 лет назад
Родитель
Сommit
e57a303748

+ 5 - 0
examples/README.md

@@ -0,0 +1,5 @@
+# Examples
+
+Following directories contain examples of tauri app functionality.
+
+There are different execution steps depending on the example. See each directory `README.md` for execution method.

+ 13 - 12
examples/api/README.md

@@ -5,17 +5,9 @@ In the future, this app will be used on Tauri's integration tests.
 ![App screenshot](./screenshot.png?raw=true)
 
 ## Running the example
-- Install dependencies (Run inside of this folder tauri/examples/api/)
-```bash
-# with yarn
-$ yarn
-# with npm
-$ npm install
-```
-
-- Compile tauri
-go to root of the tauri repo and run
 
+- Compile Tauri
+go to root of the Tauri repo and run:
 Linux / Mac:
 ```
 # choose to install node cli (1)
@@ -27,7 +19,15 @@ Windows:
 ./.scripts/setup.ps1
 ```
 
-- Compile the app (Run inside of this folder tauri/examples/api/)
+- Install dependencies (Run inside of this folder `examples/api/`)
+```bash
+# with yarn
+$ yarn
+# with npm
+$ npm install
+```
+
+- Run the app in development mode (Run inside of this folder `examples/api/`)
 ```bash
 # with yarn
 $ yarn tauri dev
@@ -35,7 +35,8 @@ $ yarn tauri dev
 $ npm run tauri dev
 ```
 
-- Run the app
+- Build an run the release app (Run inside of this folder `examples/api/`)
 ```bash
+$ yarn tauri build
 $ ./src-tauri/target/release/app
 ```

+ 5 - 0
examples/commands/README.md

@@ -0,0 +1,5 @@
+# Commands Example
+
+A simple Tauri Application showcasing the command API.
+
+To execute run the following on the root directory of the repository: `cargo run --example commands`.

+ 3 - 0
examples/helloworld/README.md

@@ -0,0 +1,3 @@
+# Hello Wolrd Example
+
+To execute run the following on the root directory of the repository: `cargo example --helloworld`.

+ 5 - 0
examples/multiwindow/README.md

@@ -0,0 +1,5 @@
+# Multi-Window Example
+
+An example Tauri Multi-Window Application.
+
+To execute run the following on the root directory of the repository: `cargo run --example multiwindow`.

+ 5 - 0
examples/navigation/README.md

@@ -0,0 +1,5 @@
+# Naviagtion Example
+
+A very simple Tauri Appplication with frontend navigation.
+
+To execute run the following on the root directory of the repository: `cargo run --example navigation`.

+ 2 - 0
examples/resources/README.md

@@ -1,3 +1,5 @@
 # Resource example
 
 This example demonstrates the Tauri bundle resources functionality. The example adds `src-tauri/assets/index.js` as a resource (defined on `tauri.conf.json > tauri > bundle > resources`) and executes it using `Node.js`, locating the JavaScript file using the `tauri::api::path::resolve_path` API.
+
+To execute run the following on the root directory of the repository: `cargo run --example resources`.

+ 40 - 0
examples/sidecar/README.md

@@ -1,3 +1,43 @@
 # Sidecar example
 
 This example demonstrates how to use the Tauri sidecar feature. It uses [pkg](https://github.com/vercel/pkg) to compile a Node.js application and bundle it on the Tauri application.
+
+## Running the example
+
+- Compile Tauri
+go to root of the Tauri repo and run:
+Linux / Mac:
+```
+# choose to install node cli (1)
+bash .scripts/setup.sh
+```
+
+Windows:
+```
+./.scripts/setup.ps1
+```
+
+- Install dependencies (Run inside of this folder `examples/sidecar/`)
+```bash
+# with yarn
+$ yarn
+# with npm
+$ npm install
+
+$ yarn tauri
+$ yarn package
+```
+
+- Run the app in development mode (Run inside of this folder `examples/sidecar/`)
+```bash
+# with yarn
+$ yarn tauri dev
+# with npm
+$ npm run tauri dev
+```
+
+- Build an run the release app (Run inside of this folder `examples/sidecar/`)
+```bash
+$ yarn tauri build
+$ ./src-tauri/target/release/app
+```

+ 5 - 0
examples/state/README.md

@@ -0,0 +1,5 @@
+# State example
+
+A simple Tauri Appplication showcase the application State usage.
+
+To execute run the following on the root directory of the repository: `cargo run --example state`

+ 5 - 0
examples/streaming/README.md

@@ -0,0 +1,5 @@
+# Streaming example
+
+A simple Tauri Appplication showcase the streaming functionality.
+
+To execute run the following on the root directory of the repository: `cargo run --example streaming`.

+ 0 - 0
examples/tauri-dynamic-lib/Readme.md → examples/tauri-dynamic-lib/README.md


+ 29 - 0
examples/updater/README.md

@@ -0,0 +1,29 @@
+# Updater Example
+
+This example showcases the App Updater feature.
+
+## Running the example
+
+- Compile Tauri
+go to root of the Tauri repo and run:
+Linux / Mac:
+```
+# choose to install node cli (1)
+bash .scripts/setup.sh
+```
+
+Windows:
+```
+./.scripts/setup.ps1
+```
+
+- Run the app in development mode (Run inside of this folder `examples/updater/`)
+```bash
+$ cargo tauri dev
+```
+
+- Build an run the release app (Run inside of this folder `examples/updater/`)
+```bash
+$ cargo tauri build
+$ ./src-tauri/target/release/app
+```