diff --git a/docs/cli/src/SUMMARY.md b/docs/cli/src/SUMMARY.md index 115a0992d..6a6ebb5ef 100644 --- a/docs/cli/src/SUMMARY.md +++ b/docs/cli/src/SUMMARY.md @@ -3,4 +3,7 @@ - [Introduction](./introduction.md) - [Installation](./installation.md) - [Create a Project](./creating.md) -- [Configure Project](./configure.md) \ No newline at end of file +- [Configure Project](./configure.md) +- [Commands](./cmd/README.md) + - [Build](./cmd/build.md) + - [Serve](./cmd/serve.md) \ No newline at end of file diff --git a/docs/cli/src/cmd/README.md b/docs/cli/src/cmd/README.md new file mode 100644 index 000000000..c642b475f --- /dev/null +++ b/docs/cli/src/cmd/README.md @@ -0,0 +1,26 @@ +# Commands + +In this chapter we will introduce all `dioxus-cli` commands. + +> you can also use `dioxus --help` to get cli help info. + +``` +dioxus +Build, bundle, & ship your Dioxus app + +USAGE: + dioxus [OPTIONS] + +OPTIONS: + -h, --help Print help information + -v Enable verbose logging + +SUBCOMMANDS: + build Build the Rust WASM app and all of its assets + clean Clean output artifacts + config Dioxus config file controls + create Init a new project for Dioxus + help Print this message or the help of the given subcommand(s) + serve Build, watch & serve the Rust WASM app and all of its assets + translate Translate some source file into Dioxus code +``` \ No newline at end of file diff --git a/docs/cli/src/cmd/build.md b/docs/cli/src/cmd/build.md new file mode 100644 index 000000000..67261d082 --- /dev/null +++ b/docs/cli/src/cmd/build.md @@ -0,0 +1,47 @@ +# Build + +`dioxsu build` command can help you `pack & build` a dioxus project. + +``` +dioxus-build +Build the Rust WASM app and all of its assets + +USAGE: + dioxus build [OPTIONS] + +OPTIONS: + --example [default: ""] + --platform [default: "default_platform"] + --release [default: false] +``` + +you can use this command to build project to `out_dir` : + +``` +dioxus build --release +``` + +## Target platform + +use option `platform` choose build target platform: + +``` +# for desktop project +dioxus build --platform desktop +``` + +`platform` only supports `desktop` & `web`. + +``` +# for web project +dioxus build --platform web +``` + +## Build Example + +you can use `--example {name}` to build a example code. + +``` +# build `example/test` code +dioxus build --exmaple test +``` \ No newline at end of file diff --git a/docs/cli/src/cmd/serve.md b/docs/cli/src/cmd/serve.md new file mode 100644 index 000000000..c8237512d --- /dev/null +++ b/docs/cli/src/cmd/serve.md @@ -0,0 +1,49 @@ +# Serve + +`dioxsu serve` can start a dev server (include hot-reload tool) to run the project. + +``` +dioxus-serve +Build, watch & serve the Rust WASM app and all of its assets + +USAGE: + dioxus serve [OPTIONS] + +OPTIONS: + --example [default: ""] + --platform [default: "default_platform"] + --release [default: false] +``` + +you can use this command to build project and start a `dev server` : + +``` +dioxus serve +``` + +## Target platform + +use option `platform` choose build target platform: + +``` +# for desktop project +dioxus serve --platform desktop +``` + +`platform` only supports `desktop` & `web`. + +`dev-server` only for `web` project. + +``` +# for web project +dioxus serve --platform web +``` + +## Serve Example + +you can use `--example {name}` to start a example code. + +``` +# build `example/test` code +dioxus serve --exmaple test +``` \ No newline at end of file diff --git a/docs/cli/src/configure.md b/docs/cli/src/configure.md index bc2edfcc0..ddcefb736 100644 --- a/docs/cli/src/configure.md +++ b/docs/cli/src/configure.md @@ -94,3 +94,54 @@ Only include resources at `Dev` mode. "https://cdn.jsdelivr.net/npm/bootstrap/dist/js/bootstrap.js" ] ``` + +## Config example + +```toml +[application] + +# App (Project) Name +name = "{{project-name}}" + +# Dioxus App Default Platform +# desktop, web, mobile, ssr +default_platform = "web" + +# `build` & `serve` dist path +out_dir = "dist" + +# resource (public) file folder +asset_dir = "public" + +[web.app] + +# HTML title tag content +title = "dioxus | ⛺" + +[web.watcher] + +# when watcher trigger, regenerate the `index.html` +reload_html = true + +# which files or dirs will be watcher monitoring +watch_path = ["src", "public"] + +# include `assets` in web platform +[web.resource] + +# CSS style file +style = [] + +# Javascript code file +script = [] + +[web.resource.dev] + +# serve: [dev-server] only + +# CSS style file +style = [] + +# Javascript code file +script = [] +``` \ No newline at end of file