You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
`Language::Auto` is available only with the `detection` feature. Without detection, pass a concrete language such as `Language::Rust`. The default `runtime` feature includes Rust; pass `lang-python`, `lang-toml`, or `all-languages` for the rest.
75
+
Pass a [`Language`] variant when building [`SourceCode`]. The `runtime` feature includes Rust; enable the matching `lang-*` feature, or `all-languages`, for additional grammars.
79
76
80
77
## Editor
81
78
82
-
[`dioxus-code-editor`] is a sibling crate that pairs the highlighter with a `contenteditable` input layer:
79
+
[`dioxus-code-editor`] is a sibling crate that pairs the highlighter with a textarea input layer:
83
80
84
81
```rust
85
82
# usedioxus::prelude::*;
@@ -133,7 +130,7 @@ Code {
133
130
134
131
```sh
135
132
dx serve --example dioxus-code-basic # macro + runtime side by side
136
-
dx serve --example dioxus-code-macro-only # compile-time only, no parser in the binary
Copy file name to clipboardExpand all lines: code-editor/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,7 +53,7 @@ The component is controlled — drive [`CodeEditorProps::value`] from your own s
53
53
| prop | description |
54
54
|---|---|
55
55
|[`CodeEditorProps::value`]| Current editor contents. |
56
-
|[`CodeEditorProps::language`]|Tree-sitter grammar selection. Pass a [`Language`] variant (for example [`Language::Rust`]) or use [`Language::from_slug`] for custom slugs. |
56
+
|[`CodeEditorProps::language`]|Syntax grammar selection. Pass a [`Language`] variant (for example [`Language::Rust`]) or use [`Language::from_slug`] for runtime slugs. |
57
57
|[`CodeEditorProps::theme`]| Syntax theme selection shared with [`dioxus-code`](https://crates.io/crates/dioxus-code); accepts [`Theme`] or [`CodeTheme`]. |
58
58
|[`CodeEditorProps::line_numbers`]| Show a one-based line gutter. Defaults to `true`. |
59
59
|[`CodeEditorProps::read_only`]| Disable editing while preserving highlighting. |
Copy file name to clipboardExpand all lines: dioxus-code-macro/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,7 +19,7 @@
19
19
20
20
Implementation crate for the [`code!`] macro re-exported by [`dioxus-code`](https://crates.io/crates/dioxus-code) under its default `macro` feature. You usually depend on `dioxus-code` instead of pulling this in directly.
21
21
22
-
The macro reads a source file at compile time, parses it with [`arborium`](https://crates.io/crates/arborium), and expands to a static span tree. The runtime binary ships only the spans — no parser.
22
+
The macro reads a source file at compile time, parses it with [`arborium`](https://crates.io/crates/arborium), and expands to a static span tree that can be rendered by `dioxus-code`.
0 commit comments