d5803c4a12
demo.html can be included in another html file, create a html file that includes demo.html for the demo, rather than using demo.html directly and letting the browser add <html>, <body> etc
25 lines
478 B
Makefile
25 lines
478 B
Makefile
WASM=pkg/jotdown_wasm_bg.wasm
|
|
|
|
SRC=$(shell find src ../../src -name '*.rs')
|
|
|
|
${WASM}: ${SRC}
|
|
wasm-pack build --release --target web
|
|
|
|
wasm: ${WASM}
|
|
|
|
index.html: Makefile demo.html
|
|
echo '<!DOCTYPE html><html>' > $@
|
|
echo '<head>' >> $@
|
|
echo '<title>Jotdown Demo</title>' >> $@
|
|
echo '</head>' >> $@
|
|
echo '<body>' >> $@
|
|
cat demo.html >> $@
|
|
echo '</body>' >> $@
|
|
echo '</html>' >> $@
|
|
|
|
run: ${WASM} index.html
|
|
python -m http.server
|
|
|
|
clean:
|
|
rm -rf pkg index.html
|
|
cargo clean
|