Skip to content

Commit 71f5d73

Browse files
committed
use language detection in the demo
1 parent 6a86f9b commit 71f5d73

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

docsite/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ publish = false
1111

1212
[dependencies]
1313
dioxus = { version = "0.7.0", features = ["router"] }
14-
dioxus-code = { workspace = true, features = ["runtime", "lang-toml"] }
14+
dioxus-code = { workspace = true, features = ["runtime", "detection", "lang-toml"] }
1515
dioxus-code-editor = { workspace = true }
1616
dioxus-primitives = { git = "https://github.com/DioxusLabs/components", version = "0.0.1", default-features = false, features = ["router"] }
1717

docsite/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -701,9 +701,9 @@ fn Playground(
701701
div { class: "playground-grid",
702702
Card { class: "card-editor",
703703
div { class: "card-bar",
704-
span { "source.rs" }
704+
span { "source" }
705705
span { class: "editor-meta",
706-
span { "rust · " {format!("{} chars", source().chars().count())} }
706+
span { "auto · " {format!("{} chars", source().chars().count())} }
707707
span { class: "editor-meta-divider" }
708708
Select::<usize> {
709709
value: Some(value.into()),
@@ -732,9 +732,9 @@ fn Playground(
732732
ClientOnly {
733733
CodeEditor {
734734
value: source(),
735-
language: Language::Rust,
735+
language: Language::Auto,
736736
theme,
737-
aria_label: "Rust source editor",
737+
aria_label: "Auto-detected source editor",
738738
class: "playground-code-editor",
739739
oninput: move |value| source.set(value),
740740
}

0 commit comments

Comments
 (0)