From bd1bb35d6ee703b005d2ea230171c290bade4ca7 Mon Sep 17 00:00:00 2001 From: Cecile Tonglet Date: Sun, 27 Sep 2020 14:49:05 +0200 Subject: [PATCH] Use docs-theme from blueprint (#24) --- Cargo.lock | 9 + Cargo.toml | 35 +--- build.sh | 15 +- dev.sh | 2 +- src/app.rs | 134 --------------- static/index.html | 96 +++-------- yewprint-doc/Cargo.toml | 19 ++ yewprint-doc/build.rs | 50 ++++++ yewprint-doc/src/app.rs | 162 ++++++++++++++++++ {src => yewprint-doc/src}/buttons/example.rs | 0 .../doc.rs => yewprint-doc/src/buttons/mod.rs | 0 {src => yewprint-doc/src}/collapse/example.rs | 0 .../src/collapse/mod.rs | 0 {src => yewprint-doc/src}/example.rs | 2 +- {src => yewprint-doc/src}/icon/example.rs | 0 .../doc.rs => yewprint-doc/src/icon/mod.rs | 0 yewprint-doc/src/lib.rs | 52 ++++++ {src => yewprint-doc/src}/logo.svg | 0 .../doc.rs => yewprint-doc/src/switch/mod.rs | 3 +- {src => yewprint-doc/src}/tree/example.rs | 0 .../doc.rs => yewprint-doc/src/tree/mod.rs | 0 yewprint/Cargo.toml | 21 +++ build.rs => yewprint/build.rs | 51 ------ {src => yewprint/src}/buttons/mod.rs | 3 - {src => yewprint/src}/collapse/mod.rs | 3 - {src => yewprint/src}/icon/mod.rs | 3 - {src => yewprint/src}/lib.rs | 54 ------ {src => yewprint/src}/menu/mod.rs | 0 {src => yewprint/src}/switch/mod.rs | 3 - {src => yewprint/src}/tree/mod.rs | 3 - 30 files changed, 359 insertions(+), 361 deletions(-) delete mode 100644 src/app.rs create mode 100644 yewprint-doc/Cargo.toml create mode 100644 yewprint-doc/build.rs create mode 100644 yewprint-doc/src/app.rs rename {src => yewprint-doc/src}/buttons/example.rs (100%) rename src/buttons/doc.rs => yewprint-doc/src/buttons/mod.rs (100%) rename {src => yewprint-doc/src}/collapse/example.rs (100%) rename src/collapse/doc.rs => yewprint-doc/src/collapse/mod.rs (100%) rename {src => yewprint-doc/src}/example.rs (97%) rename {src => yewprint-doc/src}/icon/example.rs (100%) rename src/icon/doc.rs => yewprint-doc/src/icon/mod.rs (100%) create mode 100644 yewprint-doc/src/lib.rs rename {src => yewprint-doc/src}/logo.svg (100%) rename src/switch/doc.rs => yewprint-doc/src/switch/mod.rs (95%) rename {src => yewprint-doc/src}/tree/example.rs (100%) rename src/tree/doc.rs => yewprint-doc/src/tree/mod.rs (100%) create mode 100644 yewprint/Cargo.toml rename build.rs => yewprint/build.rs (56%) rename {src => yewprint/src}/buttons/mod.rs (97%) rename {src => yewprint/src}/collapse/mod.rs (99%) rename {src => yewprint/src}/icon/mod.rs (98%) rename {src => yewprint/src}/lib.rs (59%) rename {src => yewprint/src}/menu/mod.rs (100%) rename {src => yewprint/src}/switch/mod.rs (96%) rename {src => yewprint/src}/tree/mod.rs (99%) diff --git a/Cargo.lock b/Cargo.lock index 0f2ffbc..c77f0c0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -852,8 +852,17 @@ dependencies = [ "heck", "id_tree", "regex", + "web-sys", + "yew", +] + +[[package]] +name = "yewprint-doc" +version = "0.1.0" +dependencies = [ "syntect", "wasm-bindgen", "web-sys", "yew", + "yewprint", ] diff --git a/Cargo.toml b/Cargo.toml index 9ae1d96..eda0fd8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,30 +1,5 @@ -[package] -name = "yewprint" -version = "0.1.0" -authors = ["Cecile Tonglet "] -edition = "2018" - -# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html - -[lib] -crate-type = ["cdylib"] - -[badges] -travis-ci = { repository = "cecton/yewprint", branch = "main" } -is-it-maintained-issue-resolution = { repository = "cecton/yewprint" } -is-it-maintained-open-issues = { repository = "cecton/yewprint" } - -[features] -default = [] -doc = ["syntect"] - -[dependencies] -wasm-bindgen = "^0.2" -yew = { git = "https://github.com/yewstack/yew.git", rev = "1507c21b" } -web-sys = "0.3" -id_tree = "1.7" - -[build-dependencies] -regex = { version = "1", default-features = false, features = ["std"] } -heck = "0.3" -syntect = { version = "4.4.0", optional = true } +[workspace] +members = [ + "yewprint", + "yewprint-doc", +] diff --git a/build.sh b/build.sh index 19134cd..dfc1df2 100755 --- a/build.sh +++ b/build.sh @@ -1,7 +1,7 @@ #!/bin/bash if [ ${#@} == 0 ]; then - options=(--release -- --features doc) + options=(--release) else options=() fi @@ -10,6 +10,10 @@ if ! [ -f core.tgz ]; then curl -o core.tgz https://registry.npmjs.org/@blueprintjs/core/-/core-3.30.0.tgz fi +if ! [ -f docs-theme.tgz ]; then + curl -o docs-theme.tgz https://registry.npmjs.org/@blueprintjs/docs-theme/-/docs-theme-3.7.1.tgz +fi + # cleanup mkdir -p public rm -fR public/.gitignore public/* @@ -18,13 +22,18 @@ rm -fR public/.gitignore public/* cp static/* public/ # copy favicon -cp src/logo.svg public/favicon.svg +cp yewprint-doc/src/logo.svg public/favicon.svg # download blueprint css tar xzOf core.tgz package/lib/css/blueprint.css > public/blueprint.css +# download blueprint doc css +tar xzOf docs-theme.tgz package/lib/css/docs-theme.css > public/docs-theme.css + # build -wasm-pack build --no-typescript --target web --out-name wasm --out-dir ./public "${options[@]}" "$@" +(cd yewprint-doc && \ + wasm-pack build --no-typescript --target web --out-name wasm \ + --out-dir ../public "${options[@]}" "$@") rc=$? rm -fR public/{.gitignore,package.json,README.md} diff --git a/dev.sh b/dev.sh index 44eea42..fa10a81 100755 --- a/dev.sh +++ b/dev.sh @@ -1,3 +1,3 @@ #!/bin/sh -exec cargo watch -s './build.sh --dev -- --features doc && simple-http-server -i --nocache --cors public/' -i /public +exec cargo watch -s './build.sh --dev && simple-http-server -i --nocache --cors public/' -i /public diff --git a/src/app.rs b/src/app.rs deleted file mode 100644 index 6df472f..0000000 --- a/src/app.rs +++ /dev/null @@ -1,134 +0,0 @@ -use crate::buttons::doc::*; -use crate::collapse::doc::*; -use crate::icon::doc::*; -use crate::switch::doc::*; -use crate::tree::doc::*; -use crate::{ConditionalClass, Menu, MenuItem}; -use yew::prelude::*; - -pub struct App { - link: ComponentLink, - doc_menu: DocMenu, - dark_theme: ConditionalClass, -} - -pub enum Msg { - ToggleLight, - GoToMenu(DocMenu), -} - -impl Component for App { - type Message = Msg; - type Properties = (); - - fn create(_: Self::Properties, link: ComponentLink) -> Self { - App { - dark_theme: true.into(), - doc_menu: DocMenu::Button, - link, - } - } - - fn update(&mut self, msg: Self::Message) -> ShouldRender { - match msg { - Msg::ToggleLight => *self.dark_theme ^= true, - Msg::GoToMenu(doc_menu) => { - self.doc_menu = doc_menu; - } - } - true - } - - fn change(&mut self, _props: Self::Properties) -> ShouldRender { - true - } - - fn view(&self) -> Html { - html! { -
-
-
- - - - - - - - - -
- - Deploys by Netlify - -
-
-
-
-
- { - match self.doc_menu { - DocMenu::Button => html! (), - DocMenu::Switch => html! (), - DocMenu::Collapse => html!(), - DocMenu::Tree => html!(), - DocMenu::Icon => html!(), - DocMenu::Menu => html!(), - } - } -
-
-
- } - } -} - -#[derive(Debug, Copy, Clone)] -pub enum DocMenu { - Button, - Collapse, - Icon, - Menu, - Switch, - Tree, -} diff --git a/static/index.html b/static/index.html index eccc956..fe6349a 100644 --- a/static/index.html +++ b/static/index.html @@ -9,59 +9,26 @@ + diff --git a/yewprint-doc/Cargo.toml b/yewprint-doc/Cargo.toml new file mode 100644 index 0000000..af4ad3e --- /dev/null +++ b/yewprint-doc/Cargo.toml @@ -0,0 +1,19 @@ +[package] +name = "yewprint-doc" +version = "0.1.0" +authors = ["Cecile Tonglet "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[lib] +crate-type = ["cdylib"] + +[dependencies] +wasm-bindgen = "^0.2" +yew = { git = "https://github.com/yewstack/yew.git", rev = "1507c21b" } +web-sys = { version = "0.3", features = ["Window", "MediaQueryList"] } +yewprint = { path = "../yewprint" } + +[build-dependencies] +syntect = "4.4.0" diff --git a/yewprint-doc/build.rs b/yewprint-doc/build.rs new file mode 100644 index 0000000..2d17e8d --- /dev/null +++ b/yewprint-doc/build.rs @@ -0,0 +1,50 @@ +use std::env; +use std::ffi::OsString; +use std::fs; +use std::path::Path; +use syntect::highlighting::{Theme, ThemeSet}; +use syntect::parsing::SyntaxSet; + +fn main() { + let syntax_set = SyntaxSet::load_defaults_newlines(); + let theme_set = ThemeSet::load_defaults(); + let out_dir = env::var_os("OUT_DIR").unwrap(); + + fn recursive>( + base_path: P, + syntax_set: &SyntaxSet, + theme: &Theme, + out_dir: &OsString, + ) { + for entry in fs::read_dir(base_path).unwrap() { + let entry = entry.unwrap(); + let path = entry.path(); + + if path.is_dir() { + recursive(&path, syntax_set, theme, out_dir); + } + + let file_name = path.file_name().unwrap().to_str().unwrap(); + + if path.starts_with("./src") && file_name == "example.rs" && path.is_file() { + let dest_path = Path::new(&out_dir) + .join(env!("CARGO_PKG_NAME")) + .join(&path) + .with_file_name("mod.rs.html"); + let src = + syntect::html::highlighted_html_for_file(&path, syntax_set, theme).unwrap(); + + let _ = std::fs::create_dir_all(dest_path.parent().unwrap()); + fs::write(&dest_path, src.trim_end()).unwrap(); + println!("cargo:rerun-if-changed={}", path.display()); + } + } + } + + recursive( + ".", + &syntax_set, + &theme_set.themes["Solarized (dark)"], + &out_dir, + ) +} diff --git a/yewprint-doc/src/app.rs b/yewprint-doc/src/app.rs new file mode 100644 index 0000000..33eaa59 --- /dev/null +++ b/yewprint-doc/src/app.rs @@ -0,0 +1,162 @@ +use crate::buttons::*; +use crate::collapse::*; +use crate::icon::*; +use crate::switch::*; +use crate::tree::*; +use yew::prelude::*; +use yewprint::{ConditionalClass, IconName, Menu, MenuItem}; + +pub struct App { + link: ComponentLink, + doc_menu: DocMenu, + dark_theme: ConditionalClass, +} + +pub enum Msg { + ToggleLight, + GoToMenu(DocMenu), +} + +impl Component for App { + type Message = Msg; + type Properties = (); + + fn create(_: Self::Properties, link: ComponentLink) -> Self { + App { + dark_theme: web_sys::window() + .and_then(|x| x.match_media("(prefers-color-scheme: dark)").ok().flatten()) + .map(|x| x.matches()) + .unwrap_or(true) + .into(), + doc_menu: DocMenu::Button, + link, + } + } + + fn update(&mut self, msg: Self::Message) -> ShouldRender { + match msg { + Msg::ToggleLight => *self.dark_theme ^= true, + Msg::GoToMenu(doc_menu) => { + self.doc_menu = doc_menu; + } + } + true + } + + fn change(&mut self, _props: Self::Properties) -> ShouldRender { + true + } + + fn view(&self) -> Html { + let netlify_badge = if *self.dark_theme { + "https://www.netlify.com/img/global/badges/netlify-color-accent.svg" + } else { + "https://www.netlify.com/img/global/badges/netlify-color-bg.svg" + }; + let go_to_theme_label = if *self.dark_theme { + "Light theme" + } else { + "Dark theme" + }; + let go_to_theme_icon = if *self.dark_theme { + IconName::Flash + } else { + IconName::Moon + }; + + html! { +
+
+
+
+ + + + + + + + + + +
+ + Deploys by Netlify + +
+
+
+
+
+ { + match self.doc_menu { + DocMenu::Button => html! (), + DocMenu::Switch => html! (), + DocMenu::Collapse => html!(), + DocMenu::Tree => html!(), + DocMenu::Icon => html!(), + DocMenu::Menu => html!(), + } + } +
+
+
+
+ } + } +} + +#[derive(Debug, Copy, Clone)] +pub enum DocMenu { + Button, + Collapse, + Icon, + Menu, + Switch, + Tree, +} diff --git a/src/buttons/example.rs b/yewprint-doc/src/buttons/example.rs similarity index 100% rename from src/buttons/example.rs rename to yewprint-doc/src/buttons/example.rs diff --git a/src/buttons/doc.rs b/yewprint-doc/src/buttons/mod.rs similarity index 100% rename from src/buttons/doc.rs rename to yewprint-doc/src/buttons/mod.rs diff --git a/src/collapse/example.rs b/yewprint-doc/src/collapse/example.rs similarity index 100% rename from src/collapse/example.rs rename to yewprint-doc/src/collapse/example.rs diff --git a/src/collapse/doc.rs b/yewprint-doc/src/collapse/mod.rs similarity index 100% rename from src/collapse/doc.rs rename to yewprint-doc/src/collapse/mod.rs diff --git a/src/example.rs b/yewprint-doc/src/example.rs similarity index 97% rename from src/example.rs rename to yewprint-doc/src/example.rs index a9b96c5..fb94860 100644 --- a/src/example.rs +++ b/yewprint-doc/src/example.rs @@ -1,5 +1,5 @@ -use crate::{Button, Collapse, IconName, Intent}; use yew::prelude::*; +use yewprint::{Button, Collapse, IconName, Intent}; pub struct ExampleContainer { collapsed: bool, diff --git a/src/icon/example.rs b/yewprint-doc/src/icon/example.rs similarity index 100% rename from src/icon/example.rs rename to yewprint-doc/src/icon/example.rs diff --git a/src/icon/doc.rs b/yewprint-doc/src/icon/mod.rs similarity index 100% rename from src/icon/doc.rs rename to yewprint-doc/src/icon/mod.rs diff --git a/yewprint-doc/src/lib.rs b/yewprint-doc/src/lib.rs new file mode 100644 index 0000000..2300ee2 --- /dev/null +++ b/yewprint-doc/src/lib.rs @@ -0,0 +1,52 @@ +#![recursion_limit = "512"] + +mod app; +mod buttons; +mod collapse; +mod example; +mod icon; +mod switch; +mod tree; + +pub use app::*; +pub use example::*; + +#[macro_export] +macro_rules! log { + ($s:expr $(,$args:expr)*) => {{ + yew::services::ConsoleService::log(format!($s $(,$args)*).as_str()); + }}; +} + +#[macro_export] +macro_rules! include_raw_html { + ($file:expr, $class:expr) => {{ + yew::virtual_dom::VNode::VRef(yew::web_sys::Node::from({ + let div = crate::include_raw_html!(element $file); + div.set_class_name($class); + div + })) + }}; + ($file:expr) => {{ + yew::virtual_dom::VNode::VRef(yew::web_sys::Node::from({ + crate::include_raw_html!(element $file) + })) + }}; + (element $file:expr) => {{ + let div = web_sys::window() + .unwrap() + .document() + .unwrap() + .create_element("div") + .unwrap(); + div.set_inner_html(include_str!($file)); + div + }}; +} + +#[wasm_bindgen::prelude::wasm_bindgen(start)] +pub fn run_app() -> Result<(), wasm_bindgen::JsValue> { + yew::start_app::(); + + Ok(()) +} diff --git a/src/logo.svg b/yewprint-doc/src/logo.svg similarity index 100% rename from src/logo.svg rename to yewprint-doc/src/logo.svg diff --git a/src/switch/doc.rs b/yewprint-doc/src/switch/mod.rs similarity index 95% rename from src/switch/doc.rs rename to yewprint-doc/src/switch/mod.rs index 4ec850d..be84305 100644 --- a/src/switch/doc.rs +++ b/yewprint-doc/src/switch/mod.rs @@ -1,4 +1,5 @@ -use super::*; +use yew::prelude::*; +use yewprint::*; pub struct SwitchDoc { props: Props, diff --git a/src/tree/example.rs b/yewprint-doc/src/tree/example.rs similarity index 100% rename from src/tree/example.rs rename to yewprint-doc/src/tree/example.rs diff --git a/src/tree/doc.rs b/yewprint-doc/src/tree/mod.rs similarity index 100% rename from src/tree/doc.rs rename to yewprint-doc/src/tree/mod.rs diff --git a/yewprint/Cargo.toml b/yewprint/Cargo.toml new file mode 100644 index 0000000..ae6857b --- /dev/null +++ b/yewprint/Cargo.toml @@ -0,0 +1,21 @@ +[package] +name = "yewprint" +version = "0.1.0" +authors = ["Cecile Tonglet "] +edition = "2018" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[badges] +travis-ci = { repository = "cecton/yewprint", branch = "main" } +is-it-maintained-issue-resolution = { repository = "cecton/yewprint" } +is-it-maintained-open-issues = { repository = "cecton/yewprint" } + +[dependencies] +yew = { git = "https://github.com/yewstack/yew.git", rev = "1507c21b" } +web-sys = "0.3" +id_tree = "1.7" + +[build-dependencies] +regex = { version = "1", default-features = false, features = ["std"] } +heck = "0.3" diff --git a/build.rs b/yewprint/build.rs similarity index 56% rename from build.rs rename to yewprint/build.rs index 9bcfed6..6024754 100644 --- a/build.rs +++ b/yewprint/build.rs @@ -58,55 +58,4 @@ fn main() { fs::write(&dest_path, src).unwrap(); println!("cargo:rerun-if-changed=build.rs"); - - #[cfg(feature = "doc")] - load_examples_with_colors(); -} - -#[cfg(feature = "doc")] -fn load_examples_with_colors() { - use std::ffi::OsString; - use syntect::highlighting::{Theme, ThemeSet}; - use syntect::parsing::SyntaxSet; - - let syntax_set = SyntaxSet::load_defaults_newlines(); - let theme_set = ThemeSet::load_defaults(); - let out_dir = env::var_os("OUT_DIR").unwrap(); - - fn recursive>( - base_path: P, - syntax_set: &SyntaxSet, - theme: &Theme, - out_dir: &OsString, - ) { - for entry in fs::read_dir(base_path).unwrap() { - let entry = entry.unwrap(); - let path = entry.path(); - - if path.is_dir() { - recursive(&path, syntax_set, theme, out_dir); - } - - let file_name = path.file_name().unwrap().to_str().unwrap(); - - if path.starts_with("./src") && file_name == "example.rs" && path.is_file() { - let dest_path = Path::new(&out_dir) - .join(&path) - .with_file_name("doc.rs.html"); - let src = - syntect::html::highlighted_html_for_file(&path, syntax_set, theme).unwrap(); - - let _ = std::fs::create_dir_all(dest_path.parent().unwrap()); - fs::write(&dest_path, src.trim_end()).unwrap(); - println!("cargo:rerun-if-changed={}", path.display()); - } - } - } - - recursive( - ".", - &syntax_set, - &theme_set.themes["Solarized (dark)"], - &out_dir, - ) } diff --git a/src/buttons/mod.rs b/yewprint/src/buttons/mod.rs similarity index 97% rename from src/buttons/mod.rs rename to yewprint/src/buttons/mod.rs index 7a203e8..2704968 100644 --- a/src/buttons/mod.rs +++ b/yewprint/src/buttons/mod.rs @@ -1,6 +1,3 @@ -#[cfg(feature = "doc")] -pub mod doc; - use crate::{ConditionalClass, Icon, IconName, Intent}; use yew::prelude::*; diff --git a/src/collapse/mod.rs b/yewprint/src/collapse/mod.rs similarity index 99% rename from src/collapse/mod.rs rename to yewprint/src/collapse/mod.rs index 8b33e79..ee76d46 100644 --- a/src/collapse/mod.rs +++ b/yewprint/src/collapse/mod.rs @@ -1,6 +1,3 @@ -#[cfg(feature = "doc")] -pub mod doc; - use std::time::Duration; use web_sys::Element; use yew::prelude::*; diff --git a/src/icon/mod.rs b/yewprint/src/icon/mod.rs similarity index 98% rename from src/icon/mod.rs rename to yewprint/src/icon/mod.rs index 996e96d..587147f 100644 --- a/src/icon/mod.rs +++ b/yewprint/src/icon/mod.rs @@ -1,6 +1,3 @@ -#[cfg(feature = "doc")] -pub mod doc; - use crate::Intent; use yew::prelude::*; diff --git a/src/lib.rs b/yewprint/src/lib.rs similarity index 59% rename from src/lib.rs rename to yewprint/src/lib.rs index 8e7e6c2..ef47e99 100644 --- a/src/lib.rs +++ b/yewprint/src/lib.rs @@ -1,25 +1,14 @@ #![recursion_limit = "512"] -#[cfg(feature = "doc")] -extern crate self as yewprint; - -#[cfg(feature = "doc")] -mod app; mod buttons; mod collapse; -#[cfg(feature = "doc")] -mod example; mod icon; mod menu; mod switch; mod tree; -#[cfg(feature = "doc")] -pub use app::*; pub use buttons::*; pub use collapse::*; -#[cfg(feature = "doc")] -pub use example::*; pub use icon::*; pub use id_tree; pub use menu::*; @@ -29,41 +18,6 @@ pub use tree::*; use std::ops::{Deref, DerefMut}; use yew::virtual_dom::{Classes, Transformer, VComp}; -#[cfg(feature = "doc")] -#[macro_export] -macro_rules! log { - ($s:expr $(,$args:expr)*) => {{ - yew::services::ConsoleService::log(format!($s $(,$args)*).as_str()); - }}; -} - -#[cfg(feature = "doc")] -#[macro_export] -macro_rules! include_raw_html { - ($file:expr, $class:expr) => {{ - yew::virtual_dom::VNode::VRef(yew::web_sys::Node::from({ - let div = crate::include_raw_html!(element $file); - div.set_class_name($class); - div - })) - }}; - ($file:expr) => {{ - yew::virtual_dom::VNode::VRef(yew::web_sys::Node::from({ - crate::include_raw_html!(element $file) - })) - }}; - (element $file:expr) => {{ - let div = web_sys::window() - .unwrap() - .document() - .unwrap() - .create_element("div") - .unwrap(); - div.set_inner_html(include_str!($file)); - div - }}; -} - // NOTE: this class needs to become deprecated when the feature bool_to_option lands in stable // // https://github.com/rust-lang/rust/issues/64260 @@ -112,14 +66,6 @@ impl DerefMut for ConditionalClass { } } -#[cfg(feature = "doc")] -#[wasm_bindgen::prelude::wasm_bindgen(start)] -pub fn run_app() -> Result<(), wasm_bindgen::JsValue> { - yew::start_app::(); - - Ok(()) -} - #[derive(Debug, Copy, Clone, PartialEq)] pub enum Intent { Primary, diff --git a/src/menu/mod.rs b/yewprint/src/menu/mod.rs similarity index 100% rename from src/menu/mod.rs rename to yewprint/src/menu/mod.rs diff --git a/src/switch/mod.rs b/yewprint/src/switch/mod.rs similarity index 96% rename from src/switch/mod.rs rename to yewprint/src/switch/mod.rs index aed9da0..f9ef6bf 100644 --- a/src/switch/mod.rs +++ b/yewprint/src/switch/mod.rs @@ -1,6 +1,3 @@ -#[cfg(feature = "doc")] -pub mod doc; - use yew::prelude::*; pub struct Switch { diff --git a/src/tree/mod.rs b/yewprint/src/tree/mod.rs similarity index 99% rename from src/tree/mod.rs rename to yewprint/src/tree/mod.rs index 5641687..c661f71 100644 --- a/src/tree/mod.rs +++ b/yewprint/src/tree/mod.rs @@ -9,9 +9,6 @@ use std::hash::{Hash, Hasher}; use std::rc::Rc; use yew::prelude::*; -#[cfg(feature = "doc")] -pub mod doc; - #[derive(Clone)] pub struct TreeData { tree: Rc>>>,