Make testing and developing of the markdown-rs dependency easier
This commit is contained in:
+2
-1
@@ -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"
|
||||||
|
|||||||
@@ -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
|
||||||
Symlink
+1
@@ -0,0 +1 @@
|
|||||||
|
../markdown-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(())
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user