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 must be set explicitly with the same [`CodeOptions`]builder used by[`code!`]. 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.
77
76
78
77
## Editor
79
78
80
-
[`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:
81
80
82
81
```rust
83
82
# usedioxus::prelude::*;
@@ -131,7 +130,7 @@ Code {
131
130
132
131
```sh
133
132
dx serve --example dioxus-code-basic # macro + runtime side by side
134
-
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
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,7 +23,7 @@ A controlled, syntax-highlighted code editor for Dioxus. Pairs an editable input
23
23
24
24
```toml
25
25
[dependencies]
26
-
dioxus-code-editor = 0.1.0"
26
+
dioxus-code-editor = "0.1.0"
27
27
```
28
28
29
29
```rust
@@ -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