diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index 1f4e42a..372e36b 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -11,30 +11,30 @@ fn greet(name: &str) -> String { #[tauri::command] fn parse_markdown(document: &str) -> String { let mut rendered_markdown: String = String::new(); - tauri::Builder::default().setup(move |app| { - let webview = app.get_webview_window("main").unwrap(); - let arena = Arena::new(); + // tauri::Builder::default().setup(move |app| { + // let webview = app.get_webview_window("main").unwrap(); + let arena = Arena::new(); - // Parse the document into a root `AstNode` - let mut options = Options::default(); - options.render.unsafe_ = true; - // options.render.hardbreaks = true; - let root = parse_document(&arena, document, &options); + // Parse the document into a root `AstNode` + let mut options = Options::default(); + options.render.unsafe_ = true; + // options.render.hardbreaks = true; + let root = parse_document(&arena, document, &options); - // Iterate over all the descendants of root. - for node in root.descendants() { - if let NodeValue::Image(ref mut image_node) = node.data.borrow_mut().value { - // image_node.url = format!("file://{}", image_node.url); - println!("{:?}", webview.eval(&image_node.url)); - } + // Iterate over all the descendants of root. + for node in root.descendants() { + if let NodeValue::Image(ref mut image_node) = node.data.borrow_mut().value { + // image_node.url = format!("file://{}", image_node.url); + // println!("{:?}", webview.eval(&image_node.url)); } - let mut html = vec![]; - format_html(root, &options, &mut html).unwrap(); - println!("{}", String::from_utf8(html.clone()).unwrap()); - rendered_markdown = String::from_utf8(html).unwrap(); - Ok(()) - }); - return "".to_owned(); + } + let mut html = vec![]; + format_html(root, &options, &mut html).unwrap(); + println!("{}", String::from_utf8(html.clone()).unwrap()); + rendered_markdown = String::from_utf8(html).unwrap(); + // Ok(()) + // }); + return rendered_markdown.to_owned(); // String::from_str("lololo").unwrap() } diff --git a/src/styles.css b/src/styles.css index 9ef6949..0b40896 100644 --- a/src/styles.css +++ b/src/styles.css @@ -128,5 +128,6 @@ ul li { #sidebar { visibility: visible; width: var(--sidebar-width); + transition: all 0.1s ease-out; }