jotdown_wasm: create html wrapper

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
This commit is contained in:
Noah Hellman 2023-03-26 16:33:38 +02:00
parent 4cacb61a68
commit d5803c4a12
2 changed files with 12 additions and 2 deletions

View file

@ -7,9 +7,19 @@ ${WASM}: ${SRC}
wasm: ${WASM}
run: ${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
rm -rf pkg index.html
cargo clean