From 14d0fd8ef13f96d198d9cc854bc55ee708c6f1cc Mon Sep 17 00:00:00 2001 From: Lukas Stancik Date: Tue, 19 May 2026 16:06:40 +0200 Subject: [PATCH] Decouple from markdown-rs folder. Added cleanup and test targets. Shortened readme. --- Makefile | 39 ++++++++++++++++++++++++--------------- README.md | 5 +---- markdown-rs | 1 - 3 files changed, 25 insertions(+), 20 deletions(-) delete mode 120000 markdown-rs diff --git a/Makefile b/Makefile index 9520811..4042eab 100644 --- a/Makefile +++ b/Makefile @@ -1,24 +1,33 @@ -release/build: +DOT_ENV_FILE=../.env + +-include ${DOT_ENV_FILE} + +clean: + rm -rf markdown-rs + rm -rf target + rm -f Cargo.lock + +init: + -git clone https://git.stancik.work/lusk/markdown-rs.git + +release/build: init 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" + -v "${PWD}/markdown-rs":/home/rust/markdown-rs \ + messense/rust-musl-cross:x86_64-musl /bin/sh -c "cargo build --release && chown -R ${SELF_UID}:${SELF_GID} target" + +debug/build: init + @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 ${SELF_UID}:${SELF_GID} 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 +run: + @RUST_LOG=debug md_to_html convert --file test/page.md --to /tmp/test-output.html + @bat /tmp/test-output.html diff --git a/README.md b/README.md index 02e9238..7deb767 100644 --- a/README.md +++ b/README.md @@ -5,10 +5,7 @@ Modified version of [Makudaun](https://github.com/orzklv/makudaun). This version ## Build and Installation ```shell -$ rust-musl-builder -root@f8512336e6ce:/home/rust/src# cargo build --release -exit -$ cp target/x86_64-unknown-linux-musl/release/md_to_html ~/.local/bin/md_to_html +$ make release/install ``` ## Usage diff --git a/markdown-rs b/markdown-rs deleted file mode 120000 index c530eea..0000000 --- a/markdown-rs +++ /dev/null @@ -1 +0,0 @@ -../markdown-rs/ \ No newline at end of file