Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
91 changes: 91 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

24 changes: 18 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ anstream = "0.6.17"
anstyle = "1.0.9"
# Easier error handling
anyhow = "1.0.91"
# (De)serializing cache data
bincode = "1.3.3"
# System preferred color scheme detection
dark-light = "1.1.1"
# System specific directories
Expand All @@ -51,6 +53,8 @@ glyphon = "0.3"
html-escape = "0.2.13"
# Parsing the HTML document that the markdown+html was converted into
html5ever = "0.27.0"
http = "1.1.0"
http-cache-semantics = "2.1.0"
# Provides some extra helpers that we use for our custom panic hook
human-panic = "2.0.0"
# Generic image decoding
Expand All @@ -74,7 +78,9 @@ pollster = "0.4.0"
raw-window-handle = "0.5.2"
# SVG rendering
resvg = "0.39.0"
# Parses the optional YAML frontmatter (replace with just a yaml parser)
# Sqlite DB for our image cache
rusqlite = { version = "0.31.0", features = ["bundled"] }
# Parses the optional YAML frontmatter (TODO: replace with just a yaml parser)
serde_yaml = "0.9.34"
# Easy `Debug` formatting changes used to keep snapshot tests more succinct
smart-debug = "0.0.3"
Expand All @@ -92,7 +98,8 @@ two-face = "0.4.0"
# More text hashing...
twox-hash = "1.6.3"
# HTTP client for requesting images from urls
ureq = "2.10.1"
ureq = { version = "2.10.1", features = ["http-crate"] }
url = "2.5.0"
# Cross platform GPU magic sauce
wgpu = "0.16"

Expand Down Expand Up @@ -195,13 +202,18 @@ lto = true

# Selectively bump up opt level for some dependencies to improve dev build perf
[profile.dev.package]
ttf-parser.opt-level = 2
rustybuzz.opt-level = 2
backtrace.opt-level = 2
cosmic-text.opt-level = 2
png.opt-level = 2
fontdb.opt-level = 2
gif.opt-level = 2
image.opt-level = 2
image-webp.opt-level = 2
lz4_flex.opt-level = 2
miniz_oxide.opt-level = 2
backtrace.opt-level = 2
png.opt-level = 2
rustybuzz.opt-level = 2
tiny-skia.opt-level = 2
ttf-parser.opt-level = 2

[lints.rust.unexpected_cfgs]
level = "warn"
Expand Down
Binary file modified assets/test_data/cargo_public_api.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
10 changes: 7 additions & 3 deletions src/file_watcher/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ mod tests;

use std::path::{Path, PathBuf};
use std::sync::mpsc;
use std::thread;
use std::time::Duration;

use crate::InlyneEvent;
Expand Down Expand Up @@ -106,9 +107,12 @@ impl Watcher {
let notify_watcher =
new_debouncer(Duration::from_millis(10), None, MsgHandler(msg_tx)).unwrap();

std::thread::spawn(move || {
endlessly_handle_messages(notify_watcher, msg_rx, reload_callback, file_path);
});
thread::Builder::new()
.name("file-watcher".into())
.spawn(move || {
endlessly_handle_messages(notify_watcher, msg_rx, reload_callback, file_path);
})
.expect("failed to spawn thread");

watcher
}
Expand Down
8 changes: 3 additions & 5 deletions src/file_watcher/tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ use std::path::{Path, PathBuf};
use std::sync::mpsc;
use std::time::Duration;

use crate::test_utils::temp;

use super::{Callback, Watcher};

use tempfile::TempDir;
Expand Down Expand Up @@ -62,11 +64,7 @@ impl Delays {

fn init_test_env() -> (TestEnv, TempDir) {
// Create our dummy test env
let temp_dir = tempfile::Builder::new()
.prefix("inlyne-tests-")
.tempdir()
.unwrap();
let base = temp_dir.path();
let (temp_dir, base) = temp::dir();
let main_file = base.join("main.md");
let rel_file = base.join("rel.md");
fs::write(&main_file, "# Main\n\n[rel](./rel.md)").unwrap();
Expand Down
7 changes: 2 additions & 5 deletions src/history.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,11 @@ mod tests {
use std::fs;

use super::*;
use crate::test_utils::temp;

#[test]
fn sanity() {
let temp_dir = tempfile::Builder::new()
.prefix("inlyne-tests-")
.tempdir()
.unwrap();
let temp_path = temp_dir.path().canonicalize().unwrap();
let (_temp_dir, temp_path) = temp::dir();

let root = temp_path.join("a");
let fork1 = temp_path.join("b");
Expand Down
Loading