diff --git a/Makefile b/Makefile index 7ccbb41..1240788 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,9 @@ WASM2C := $(WABT_DIR)/bin/wasm2c %.wat: %.py py2wasm/*.py venv/.done venv/bin/python -m py2wasm $< $@ +%.wat.html: %.wat + venv/bin/pygmentize -l wat -O full -f html $^ -o $@ + %.wasm: %.wat $(WAT2WASM) $^ -o $@ @@ -15,7 +18,7 @@ WASM2C := $(WABT_DIR)/bin/wasm2c # %.exe: %.c # cc $^ -o $@ -I $(WABT_DIR)/wasm2c -examples: venv/.done $(subst .py,.wasm,$(wildcard examples/*.py)) +examples: venv/.done $(subst .py,.wasm,$(wildcard examples/*.py)) $(subst .py,.wat.html,$(wildcard examples/*.py)) venv/bin/python3 -m http.server --directory examples test: venv/.done diff --git a/examples/.gitignore b/examples/.gitignore index 50765be..6edc9f7 100644 --- a/examples/.gitignore +++ b/examples/.gitignore @@ -1,2 +1,3 @@ *.wasm *.wat +*.wat.html diff --git a/examples/buffer.html b/examples/buffer.html index d21c84d..294ba0f 100644 --- a/examples/buffer.html +++ b/examples/buffer.html @@ -6,7 +6,7 @@