diff --git a/Cargo.toml b/Cargo.toml index 48f2579..7221816 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,4 +12,5 @@ license = "GPL-3.0" [dependencies] clap = { version = "4.1.6", features = ["derive"] } -markdown = "1.0.0" +markdown = { path = "../markdown-rs" } +env_logger = "0.11" diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9520811 --- /dev/null +++ b/Makefile @@ -0,0 +1,24 @@ +release/build: + docker run --rm -it \ + -v "${PWD}":/home/rust/src \ + -v "${PWD}/../markdown-rs":/home/rust/markdown-rs \ + messense/rust-musl-cross:x86_64-musl /bin/sh -c "cargo build --release && chown -R 1000:1001 target" + +release/install: release/build + @cp target/x86_64-unknown-linux-musl/release/md_to_html ~/.local/bin/md_to_html + @cp target/x86_64-unknown-linux-musl/release/md_to_html ../wiki/docker/rootfs/bin/md_to_html + +debug/build: + @docker run --rm -it \ + -v "${PWD}":/home/rust/src \ + -v "${PWD}/../markdown-rs":/home/rust/markdown-rs \ + messense/rust-musl-cross:x86_64-musl /bin/sh -c "cargo build && chown -R 1000:1001 target" + +debug/install: debug/build + @cp target/x86_64-unknown-linux-musl/debug/md_to_html ~/.local/bin/md_to_html + @cp target/x86_64-unknown-linux-musl/debug/md_to_html ../wiki/docker/rootfs/bin/md_to_html + +test: release/install + @#RUST_LOG=debug cargo run md_to_html + @RUST_LOG=debug md_to_html convert --file ../wiki/container-data/pages/home.md --to /tmp/output.html + @cat /tmp/output.html diff --git a/markdown-rs b/markdown-rs new file mode 120000 index 0000000..c530eea --- /dev/null +++ b/markdown-rs @@ -0,0 +1 @@ +../markdown-rs/ \ No newline at end of file diff --git a/src/main.test.rs b/src/main.test.rs new file mode 100644 index 0000000..05fb3e7 --- /dev/null +++ b/src/main.test.rs @@ -0,0 +1,12 @@ +#![allow(clippy::single_match)] + +fn main() -> Result<(), markdown::message::Message> { + env_logger::init(); + + println!( + "{:?}", + markdown::to_mdast("::test:", &markdown::ParseOptions::default())? + ); + + Ok(()) +}