docs: commit docs
This commit is contained in:
1 parent
9fb5019929
commit
9301a55abf
3 files changed
+78
-1
No files matched your search
@@ -6,4 +6,6 @@
|
||||
- [Configure Project](./configure.md)
|
||||
- [Commands](./cmd/README.md)
|
||||
- [Build](./cmd/build.md)
|
||||
- [Serve](./cmd/serve.md)
|
||||
- [Serve](./cmd/serve.md)
|
||||
- [Clean](./cmd/clean.md)
|
||||
- [Translate](./cmd/translate.md)
|
||||
@@ -0,0 +1,18 @@
|
||||
# Clean
|
||||
|
||||
`dioxus clean` will call `target clean` and remove `out_dir` directory.
|
||||
|
||||
```
|
||||
dioxus-clean
|
||||
Clean output artifacts
|
||||
|
||||
USAGE:
|
||||
dioxus clean
|
||||
```
|
||||
|
||||
you can use this command to clean all build cache and the `out_dir` content.
|
||||
|
||||
```
|
||||
dioxus clean
|
||||
```
|
||||
|
||||
@@ -0,0 +1,57 @@
|
||||
# Translate
|
||||
|
||||
`dioxus translate` can translate some source file into Dioxus code.
|
||||
|
||||
```
|
||||
dioxus-translate
|
||||
Translate some source file into Dioxus code
|
||||
|
||||
USAGE:
|
||||
dioxus translate [OPTIONS] [OUTPUT]
|
||||
|
||||
ARGS:
|
||||
<OUTPUT> Output file, stdout if not present
|
||||
|
||||
OPTIONS:
|
||||
-c, --component Activate debug mode
|
||||
-f, --file <FILE> Input file
|
||||
```
|
||||
|
||||
## Translate HTML to stdout
|
||||
|
||||
```
|
||||
dioxus transtale --file ./index.html
|
||||
```
|
||||
|
||||
## Output in a file
|
||||
|
||||
```
|
||||
dioxus translate --component --file ./index.html component.rsx
|
||||
```
|
||||
|
||||
set `component` flag will wrap `dioxus rsx` code in a component function.
|
||||
|
||||
## Example
|
||||
|
||||
```html
|
||||
<div>
|
||||
<h1> Hello World </h1>
|
||||
<a href="https://dioxuslabs.com/">Link</a>
|
||||
</div>
|
||||
```
|
||||
|
||||
Translate HTML to Dioxus component code.
|
||||
|
||||
```rust
|
||||
fn component(cx: Scope) -> Element {
|
||||
cx.render(rsx! {
|
||||
div {
|
||||
h1 { "Hello World" },
|
||||
a {
|
||||
href: "https://dioxuslabs.com/",
|
||||
"Link"
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
```
|
||||
Reference in new issue
Block a user