Make testing and developing of the markdown-rs dependency easier

This commit is contained in:
Lukas Stancik
2026-04-05 10:56:15 +02:00
parent da83856042
commit 1de849914a
4 changed files with 39 additions and 1 deletions
+2 -1
View File
@@ -12,4 +12,5 @@ license = "GPL-3.0"
[dependencies] [dependencies]
clap = { version = "4.1.6", features = ["derive"] } clap = { version = "4.1.6", features = ["derive"] }
markdown = "1.0.0" markdown = { path = "../markdown-rs" }
env_logger = "0.11"
+24
View File
@@ -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
+1
View File
@@ -0,0 +1 @@
../markdown-rs/
+12
View File
@@ -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(())
}