Examples HTML now serve higlighted WAT
This commit is contained in:
parent
27fa1cc76d
commit
17aa5fd6f9
5
Makefile
5
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
|
||||
|
||||
1
examples/.gitignore
vendored
1
examples/.gitignore
vendored
@ -1,2 +1,3 @@
|
||||
*.wasm
|
||||
*.wat
|
||||
*.wat.html
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
<body>
|
||||
<h1>Buffer</h1>
|
||||
|
||||
<a href="index.html">List</a> - <a href="buffer.py">Source</a> - <a href="buffer.wat">WebAssembly</a>
|
||||
<a href="index.html">List</a> - <a href="buffer.py">Source</a> - <a href="buffer.wat.html">WebAssembly</a>
|
||||
|
||||
<div style="white-space: pre;" id="results"></div>
|
||||
|
||||
|
||||
@ -5,7 +5,7 @@
|
||||
<body>
|
||||
<h1>Fibonacci</h1>
|
||||
|
||||
<a href="index.html">List</a> - <a href="fib.py">Source</a> - <a href="fib.wat">WebAssembly</a>
|
||||
<a href="index.html">List</a> - <a href="fib.py">Source</a> - <a href="fib.wat.html">WebAssembly</a>
|
||||
|
||||
<div style="white-space: pre;" id="results"></div>
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
mypy==0.812
|
||||
pygments==2.12.0
|
||||
pylint==2.7.4
|
||||
pytest==6.2.2
|
||||
pytest-integration==0.2.2
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user